]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: testsuite:Fix problems with incorrect results in vector test cases.
authorchenxiaolong <chenxiaolong@loongson.cn>
Wed, 6 Mar 2024 08:54:06 +0000 (16:54 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Thu, 7 Mar 2024 08:34:57 +0000 (16:34 +0800)
commitae1b05641ccf1cd4739b0998ce61cda6e5b772dd
tree2ce1ef846adc3ba16133fefd62ce6179fde69439
parent2f7d4728dbfd976788f77b8f43d4dc3c718b71b7
LoongArch: testsuite:Fix problems with incorrect results in vector test cases.

In simd_correctness_check.h, the role of the macro ASSERTEQ_64 is to check the
result of the passed vector values for the 64-bit data of each array element.
It turns out that it uses the abs() function to check only the lower 32 bits
of the data at a time, so it replaces abs() with the llabs() function.

However, the following two problems may occur after modification:

1.FAIL in lasx-xvfrint_s.c and lsx-vfrint_s.c
The reason for the error is because vector test cases that use __m{128,256} to
define vector types are composed of 32-bit primitive types, they should use
ASSERTEQ_32 instead of ASSERTEQ_64 to check for correctness.

2.FAIL in lasx-xvshuf_b.c and lsx-vshuf.c
The cause of the error is that the expected result of the function setting in
the test case is incorrect.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/vector/lasx/lasx-xvfrint_s.c: Replace
ASSERTEQ_64 with the macro ASSERTEQ_32.
* gcc.target/loongarch/vector/lasx/lasx-xvshuf_b.c: Modify the expected
test results of some functions according to the function of the vector
instruction.
* gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c: Same
modification as lasx-xvfrint_s.c.
* gcc.target/loongarch/vector/lsx/lsx-vshuf.c: Same
modification as lasx-xvshuf_b.c.
* gcc.target/loongarch/vector/simd_correctness_check.h: Use the llabs()
function instead of abs() to check the correctness of the results.
gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvfrint_s.c
gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvshuf_b.c
gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c
gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c
gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h