From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: David Malcolm <dmalcolm@redhat.com>, Marek Polacek <polacek@redhat.com>
Subject: [pushed 1/2] jit: avoid using __vector in testcase [PR110466]
Date: Fri, 30 Jun 2023 11:54:08 -0400 [thread overview]
Message-ID: <20230630155409.183039-1-dmalcolm@redhat.com> (raw)
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.
Successfully regrtested on x86_64-pc-linux-gnu.
Verified fix on powerpc64le-unknown-linux-gnu (gcc112 in Compile Farm).
Pushed to trunk as r14-2222-g6735d660839533.
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.
Co-authored-by: Marek Polacek <polacek@redhat.com>
---
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 13b3baf79ea..2337b01907e 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};
--
2.26.3
next reply other threads:[~2023-06-30 15:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-30 15:54 David Malcolm [this message]
2023-06-30 15:54 ` [pushed 2/2] jit.exp: handle dwarf version mismatch in jit-check-debug-info [PR110466] David Malcolm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230630155409.183039-1-dmalcolm@redhat.com \
--to=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=polacek@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).