aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchenxiaolong <chenxiaolong@loongson.cn>2023-12-13 09:31:07 +0800
committerLulu Cheng <chenglulu@loongson.cn>2023-12-21 17:21:21 +0800
commit555ecd30c1ed49a025c3c86f8bc989ab15f2614b (patch)
tree0a6d572c44cbc4370306f7177bbd7b533c465396
parent92045913b23db7fde7b686dac519359b58d35e5a (diff)
downloadgcc-555ecd30c1ed49a025c3c86f8bc989ab15f2614b.zip
gcc-555ecd30c1ed49a025c3c86f8bc989ab15f2614b.tar.gz
gcc-555ecd30c1ed49a025c3c86f8bc989ab15f2614b.tar.bz2
LoongArch: Modify the check type of the vector builtin function.
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.
-rw-r--r--gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h13
1 files changed, 7 insertions, 6 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 eb7fbd5..551340b 100644
--- a/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h
+++ b/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h
@@ -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; \
} \
@@ -28,11 +29,11 @@
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)