]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Modify the check type of the vector builtin function.
authorchenxiaolong <chenxiaolong@loongson.cn>
Wed, 13 Dec 2023 01:31:07 +0000 (09:31 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Thu, 21 Dec 2023 09:21:21 +0000 (17:21 +0800)
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/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h

index eb7fbd59cc73fe1bc27bb04f48f792854056b91b..551340bd51f36ecf4fd07570d6dd4979e9e0bb87 100644 (file)
@@ -8,11 +8,12 @@
       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               \
-                      "[%ld]:0x%lx, got: 0x%lx\n",                            \
+                      "[%ld]:0x%016lx, got: 0x%016lx\n",                      \
                       __FILE__, line, i, *temp_ref, *temp_res);               \
               fail = 1;                                                       \
             }                                                                 \
       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               \
-                      "[%ld]:0x%x, got: 0x%x\n",                              \
+                      "[%ld]:0x%08x, got: 0x%08x\n",                          \
                       __FILE__, line, i, *temp_ref, *temp_res);               \
               fail = 1;                                                       \
             }                                                                 \
@@ -47,8 +48,8 @@
     {                                                                         \
       if (ref != res)                                                         \
         {                                                                     \
-          printf (" error: %s at line %ld , expected %d, got %d\n", __FILE__, \
-                  line, ref, res);                                            \
+          printf (" error: %s at line %ld , expected 0x:%016x",               \
+                 "got 0x:%016x\n", __FILE__, line, ref, res);                \
         }                                                                     \
     }                                                                         \
   while (0)