public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v1] LoongArch: Modify the check type of the vector builtin function.
@ 2023-12-04 12:14 chenxiaolong
  2023-12-04 12:31 ` Xi Ruoyao
  0 siblings, 1 reply; 6+ messages in thread
From: chenxiaolong @ 2023-12-04 12:14 UTC (permalink / raw)
  To: gcc-patches; +Cc: xry111, i, xuchenghua, chenglulu, chenxiaolong

On LoongArch architecture, using the latest gcc14 in regression test,
it is found that the vector test cases in vector directory appear FAIL
entries with unmatched pointer types. In order to solve this kind of
problem, the type of the variable in the check result is modified with
the parameter type defined in the vector builtin function.

gcc/testsuite/ChangeLog:

	* gcc.target/loongarch/vector/simd_correctness_check.h:The variable
	types in the check results are modified in conjunction with the
	parameter types defined in the vector builtin function.
---
 .../gcc.target/loongarch/vector/simd_correctness_check.h     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h b/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h
index eb7fbd59cc7..f780f6586b3 100644
--- a/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h
+++ b/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h
@@ -8,7 +8,8 @@
       int fail = 0;                                                           \
       for (size_t i = 0; i < sizeof (res) / sizeof (res[0]); ++i)             \
         {                                                                     \
-          long *temp_ref = &ref[i], *temp_res = &res[i];                      \
+          long long *temp_ref = (long long *)&ref[i],                         \
+		*temp_res = (long long *)&res[i];			      \
           if (abs (*temp_ref - *temp_res) > 0)                                \
             {                                                                 \
               printf (" error: %s at line %ld , expected " #ref               \
@@ -28,7 +29,7 @@
       int fail = 0;                                                           \
       for (size_t i = 0; i < sizeof (res) / sizeof (res[0]); ++i)             \
         {                                                                     \
-          int *temp_ref = &ref[i], *temp_res = &res[i];                       \
+          int *temp_ref = (int *)&ref[i], *temp_res = (int *)&res[i];         \
           if (abs (*temp_ref - *temp_res) > 0)                                \
             {                                                                 \
               printf (" error: %s at line %ld , expected " #ref               \
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-12-07  3:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-04 12:14 [PATCH v1] LoongArch: Modify the check type of the vector builtin function chenxiaolong
2023-12-04 12:31 ` Xi Ruoyao
2023-12-04 12:38   ` Xi Ruoyao
2023-12-05  9:21     ` chenxiaolong
2023-12-05 12:44       ` Xi Ruoyao
2023-12-07  3:21         ` chenxiaolong

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).