public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-8744] jit: avoid using __vector in testcase [PR110466]
@ 2024-05-09 17:11 David Malcolm
  0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2024-05-09 17:11 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b38472ffc1e631bd357573b44d956ce16d94e666

commit r13-8744-gb38472ffc1e631bd357573b44d956ce16d94e666
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Thu May 9 13:09:27 2024 -0400

    jit: avoid using __vector in testcase [PR110466]
    
    r13-4531-gd2e782cb99c311 added test coverage to libgccjit's vector
    support, but used __vector, which doesn't work on Power.  Additionally
    the size param to gcc_jit_type_get_vector was wrong.
    
    Fixed thusly.
    
    gcc/testsuite/ChangeLog:
            PR jit/110466
            * jit.dg/test-expressions.c (run_test_of_comparison): Fix size
            param to gcc_jit_type_get_vector.
            (verify_comparisons): Use a typedef rather than __vector.
    
    (cherry picked from commit r14-2222-g6735d660839533)
    
    Co-authored-by: Marek Polacek <polacek@redhat.com>
    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

Diff:
---
 gcc/testsuite/jit.dg/test-expressions.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/gcc/testsuite/jit.dg/test-expressions.c b/gcc/testsuite/jit.dg/test-expressions.c
index 13b3baf79ea5..2337b01907ec 100644
--- a/gcc/testsuite/jit.dg/test-expressions.c
+++ b/gcc/testsuite/jit.dg/test-expressions.c
@@ -417,7 +417,7 @@ static void run_test_of_comparison(gcc_jit_context *ctxt,
 			 const char *expected)
 {
   gcc_jit_type *vec_type =
-    gcc_jit_type_get_vector (type, 4);
+    gcc_jit_type_get_vector (type, 2);
 
   CHECK_STRING_VALUE (
     make_test_of_comparison (ctxt,
@@ -560,17 +560,17 @@ verify_comparisons (gcc_jit_result *result)
   CHECK_VALUE (test_COMPARISON_GE_on_int (1, 2), 0);
   CHECK_VALUE (test_COMPARISON_GE_on_int (2, 1), 1);
 
-  typedef int __vector __attribute__ ((__vector_size__ (sizeof(int) * 2)));
-  typedef __vector (*test_vec_fn) (__vector, __vector);
+  typedef int v2si __attribute__ ((__vector_size__ (sizeof(int) * 2)));
+  typedef v2si (*test_vec_fn) (v2si, v2si);
 
-  __vector zero_zero = {0, 0};
-  __vector zero_one = {0, 1};
-  __vector one_zero = {1, 0};
+  v2si zero_zero = {0, 0};
+  v2si zero_one = {0, 1};
+  v2si one_zero = {1, 0};
 
-  __vector true_true = {-1, -1};
-  __vector false_true = {0, -1};
-  __vector true_false = {-1, 0};
-  __vector false_false = {0, 0};
+  v2si true_true = {-1, -1};
+  v2si false_true = {0, -1};
+  v2si true_false = {-1, 0};
+  v2si false_false = {0, 0};
 
   test_vec_fn test_COMPARISON_EQ_on_vec_int =
     (test_vec_fn)gcc_jit_result_get_code (result,
@@ -615,7 +615,7 @@ verify_comparisons (gcc_jit_result *result)
   CHECK_VECTOR_VALUE (2, test_COMPARISON_GE_on_vec_int (zero_one, one_zero), false_true);
 
   typedef float __vector_f __attribute__ ((__vector_size__ (sizeof(float) * 2)));
-  typedef __vector (*test_vec_f_fn) (__vector_f, __vector_f);
+  typedef v2si (*test_vec_f_fn) (__vector_f, __vector_f);
 
   __vector_f zero_zero_f = {0, 0};
   __vector_f zero_one_f = {0, 1};

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-09 17:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-09 17:11 [gcc r13-8744] jit: avoid using __vector in testcase [PR110466] David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).