diff mbox series

[v1] LoongArch: testsuite:Fix problems with incorrect results in vector test cases.

Message ID 20240306085406.64265-1-chenxiaolong@loongson.cn
State New
Headers show
Series [v1] LoongArch: testsuite:Fix problems with incorrect results in vector test cases. | expand

Commit Message

chenxiaolong March 6, 2024, 8:54 a.m. UTC
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.
---
 .../loongarch/vector/lasx/lasx-xvfrint_s.c    | 58 +++++++++----------
 .../loongarch/vector/lasx/lasx-xvshuf_b.c     | 14 ++---
 .../loongarch/vector/lsx/lsx-vfrint_s.c       | 50 ++++++++--------
 .../loongarch/vector/lsx/lsx-vshuf.c          | 12 ++--
 .../loongarch/vector/simd_correctness_check.h |  2 +-
 5 files changed, 68 insertions(+), 68 deletions(-)

Comments

Lulu Cheng March 7, 2024, 8:36 a.m. UTC | #1
Pushed to r14-9352.

在 2024/3/6 下午4:54, chenxiaolong 写道:
> 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.
> ---
>   .../loongarch/vector/lasx/lasx-xvfrint_s.c    | 58 +++++++++----------
>   .../loongarch/vector/lasx/lasx-xvshuf_b.c     | 14 ++---
>   .../loongarch/vector/lsx/lsx-vfrint_s.c       | 50 ++++++++--------
>   .../loongarch/vector/lsx/lsx-vshuf.c          | 12 ++--
>   .../loongarch/vector/simd_correctness_check.h |  2 +-
>   5 files changed, 68 insertions(+), 68 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvfrint_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvfrint_s.c
> index fbfe300eac4..4538528a67f 100644
> --- a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvfrint_s.c
> +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvfrint_s.c
> @@ -184,7 +184,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrne_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0xffffffff;
>     *((int *)&__m256_op0[6]) = 0xffffffff;
> @@ -203,7 +203,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrne_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0xffffffff;
>     *((int *)&__m256_op0[6]) = 0xffffffff;
> @@ -222,7 +222,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0xffffffff;
>     *((int *)&__m256_result[0]) = 0xffffffff;
>     __m256_out = __lasx_xvfrintrne_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x01010101;
>     *((int *)&__m256_op0[6]) = 0x01010101;
> @@ -241,7 +241,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrne_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x00000000;
> @@ -260,7 +260,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrne_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0xffffffff;
>     *((int *)&__m256_op0[6]) = 0xffffffff;
> @@ -279,7 +279,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrne_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0xffffffff;
>     *((int *)&__m256_op0[6]) = 0xffffffff;
> @@ -298,7 +298,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0xffffffff;
>     *((int *)&__m256_result[0]) = 0xffffffff;
>     __m256_out = __lasx_xvfrintrne_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x01010101;
>     *((int *)&__m256_op0[6]) = 0x01010101;
> @@ -317,7 +317,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrne_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x55555555;
>     *((int *)&__m256_op0[6]) = 0x36aaaaac;
> @@ -336,7 +336,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x55555555;
>     *((int *)&__m256_result[0]) = 0x80000000;
>     __m256_out = __lasx_xvfrintrp_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x00000000;
> @@ -355,7 +355,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrp_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0xffffc741;
>     *((int *)&__m256_op0[6]) = 0x8a023680;
> @@ -374,7 +374,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrp_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0xffffffff;
> @@ -393,7 +393,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0xffffffff;
>     __m256_out = __lasx_xvfrintrp_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00200101;
>     *((int *)&__m256_op0[6]) = 0x01610000;
> @@ -412,7 +412,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x3f800000;
>     *((int *)&__m256_result[0]) = 0x3f800000;
>     __m256_out = __lasx_xvfrintrp_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x00000000;
> @@ -431,7 +431,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0xfefefefe;
>     *((int *)&__m256_result[0]) = 0x3f800000;
>     __m256_out = __lasx_xvfrintrp_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x1c1c1c1c;
>     *((int *)&__m256_op0[6]) = 0x1c1c1c1c;
> @@ -450,7 +450,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0xfffffffe;
>     *((int *)&__m256_result[0]) = 0xffffff00;
>     __m256_out = __lasx_xvfrintrp_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x00000000;
> @@ -469,7 +469,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrm_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x00000000;
> @@ -488,7 +488,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrm_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0xffffffff;
>     *((int *)&__m256_op0[6]) = 0xffffffff;
> @@ -507,7 +507,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0xffffffff;
>     __m256_out = __lasx_xvfrintrm_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x5d20a0a1;
>     *((int *)&__m256_op0[6]) = 0x5d20a0a1;
> @@ -526,7 +526,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrm_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x001d001d;
> @@ -545,7 +545,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrm_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x00000000;
> @@ -564,7 +564,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrm_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x00000000;
> @@ -583,7 +583,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrm_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x00000000;
> @@ -602,7 +602,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrz_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0xffffffff;
>     *((int *)&__m256_op0[6]) = 0xfffffffe;
> @@ -621,7 +621,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0xffffffff;
>     *((int *)&__m256_result[0]) = 0xfffffffe;
>     __m256_out = __lasx_xvfrintrz_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x00000000;
> @@ -640,7 +640,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0x00000000;
>     __m256_out = __lasx_xvfrintrz_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x00000000;
>     *((int *)&__m256_op0[6]) = 0x00000000;
> @@ -659,7 +659,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0x00000000;
>     *((int *)&__m256_result[0]) = 0xffffffff;
>     __m256_out = __lasx_xvfrintrz_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0x80000000;
>     *((int *)&__m256_op0[6]) = 0x80000000;
> @@ -678,7 +678,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0xffffffff;
>     *((int *)&__m256_result[0]) = 0xffffffff;
>     __m256_out = __lasx_xvfrintrz_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0xffffffff;
>     *((int *)&__m256_op0[6]) = 0xffffffff;
> @@ -697,7 +697,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0xffffffff;
>     *((int *)&__m256_result[0]) = 0xffffffff;
>     __m256_out = __lasx_xvfrintrz_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     *((int *)&__m256_op0[7]) = 0xf5fffc00;
>     *((int *)&__m256_op0[6]) = 0xfc000000;
> @@ -716,7 +716,7 @@ main ()
>     *((int *)&__m256_result[1]) = 0xf5fffc00;
>     *((int *)&__m256_result[0]) = 0xfc000000;
>     __m256_out = __lasx_xvfrintrz_s (__m256_op0);
> -  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
> +  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
>   
>     return 0;
>   }
> diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvshuf_b.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvshuf_b.c
> index b8ab387118a..910d2933996 100644
> --- a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvshuf_b.c
> +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvshuf_b.c
> @@ -99,9 +99,9 @@ main ()
>     *((unsigned long *)&__m256i_op1[2]) = 0x7ff0000000000000;
>     *((unsigned long *)&__m256i_op1[1]) = 0x7ff0000000000000;
>     *((unsigned long *)&__m256i_op1[0]) = 0x7ff0000000000000;
> -  *((unsigned long *)&__m256i_op2[3]) = 0x3ff0010000000000;
> +  *((unsigned long *)&__m256i_op2[3]) = 0x3f11010000000000;
>     *((unsigned long *)&__m256i_op2[2]) = 0x0000000000000000;
> -  *((unsigned long *)&__m256i_op2[1]) = 0x3ff0010000000000;
> +  *((unsigned long *)&__m256i_op2[1]) = 0x3f11010000000000;
>     *((unsigned long *)&__m256i_op2[0]) = 0x0000000000000000;
>     *((unsigned long *)&__m256i_result[3]) = 0x0000000000000000;
>     *((unsigned long *)&__m256i_result[2]) = 0x0000000000000000;
> @@ -200,7 +200,7 @@ main ()
>     *((unsigned long *)&__m256i_op2[0]) = 0x0000000000000000;
>     *((unsigned long *)&__m256i_result[3]) = 0x0000000000000000;
>     *((unsigned long *)&__m256i_result[2]) = 0x0000000000000000;
> -  *((unsigned long *)&__m256i_result[1]) = 0x0000000000000000;
> +  *((unsigned long *)&__m256i_result[1]) = 0xffffffff00000000;
>     *((unsigned long *)&__m256i_result[0]) = 0x0000000000000000;
>     __m256i_out = __lasx_xvshuf_h (__m256i_op0, __m256i_op1, __m256i_op2);
>     ASSERTEQ_64 (__LINE__, __m256i_result, __m256i_out);
> @@ -351,7 +351,7 @@ main ()
>     *((unsigned long *)&__m256i_op2[1]) = 0x0000000000000001;
>     *((unsigned long *)&__m256i_op2[0]) = 0x00000000012e2110;
>     *((unsigned long *)&__m256i_result[3]) = 0x0000000000000001;
> -  *((unsigned long *)&__m256i_result[2]) = 0x0000000200000000;
> +  *((unsigned long *)&__m256i_result[2]) = 0x0000000000000000;
>     *((unsigned long *)&__m256i_result[1]) = 0x00000000012e2110;
>     *((unsigned long *)&__m256i_result[0]) = 0x0000000000000000;
>     __m256i_out = __lasx_xvshuf_w (__m256i_op0, __m256i_op1, __m256i_op2);
> @@ -426,10 +426,10 @@ main ()
>     *((unsigned long *)&__m256i_op2[2]) = 0x8000000080000000;
>     *((unsigned long *)&__m256i_op2[1]) = 0xdfffffffdfffffff;
>     *((unsigned long *)&__m256i_op2[0]) = 0x8000000080000000;
> -  *((unsigned long *)&__m256i_result[3]) = 0x8000000080000000;
> +  *((unsigned long *)&__m256i_result[3]) = 0xdfffffff80000000;
>     *((unsigned long *)&__m256i_result[2]) = 0x7fc00000dfffffff;
> -  *((unsigned long *)&__m256i_result[1]) = 0x8000000080000000;
> -  *((unsigned long *)&__m256i_result[0]) = 0x8000000080000000;
> +  *((unsigned long *)&__m256i_result[1]) = 0x7fc0000000000000;
> +  *((unsigned long *)&__m256i_result[0]) = 0x8000000000000000;
>     __m256i_out = __lasx_xvshuf_w (__m256i_op0, __m256i_op1, __m256i_op2);
>     ASSERTEQ_64 (__LINE__, __m256i_result, __m256i_out);
>   
> diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c
> index 61f28325a6f..5ba91ee5199 100644
> --- a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c
> +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c
> @@ -79,7 +79,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrne_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00130013;
>     *((int *)&__m128_op0[2]) = 0x00130013;
> @@ -90,7 +90,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrne_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x20202020;
>     *((int *)&__m128_op0[2]) = 0x20202020;
> @@ -101,7 +101,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrne_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00000000;
>     *((int *)&__m128_op0[2]) = 0x00000000;
> @@ -112,7 +112,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrne_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0xffffffff;
>     *((int *)&__m128_op0[2]) = 0xffffffff;
> @@ -123,7 +123,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0xffffffff;
>     *((int *)&__m128_result[0]) = 0xffffffff;
>     __m128_out = __lsx_vfrintrne_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00000000;
>     *((int *)&__m128_op0[2]) = 0x00000001;
> @@ -134,7 +134,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrne_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00000000;
>     *((int *)&__m128_op0[2]) = 0x00000000;
> @@ -145,7 +145,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrne_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0xfffbfffb;
>     *((int *)&__m128_op0[2]) = 0xfffbfffb;
> @@ -156,7 +156,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0xfffbfffb;
>     *((int *)&__m128_result[0]) = 0xfffbfffb;
>     __m128_out = __lsx_vfrintrne_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x0ff780a1;
>     *((int *)&__m128_op0[2]) = 0x0efc01af;
> @@ -167,7 +167,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0xfe7f0000;
>     __m128_out = __lsx_vfrintrne_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00000000;
>     *((int *)&__m128_op0[2]) = 0x00000000;
> @@ -178,7 +178,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrp_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00000000;
>     *((int *)&__m128_op0[2]) = 0xefffffff;
> @@ -189,7 +189,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrp_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0xffffffff;
>     *((int *)&__m128_op0[2]) = 0xffffff00;
> @@ -200,7 +200,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0xffffffff;
>     *((int *)&__m128_result[0]) = 0xffffff00;
>     __m128_out = __lsx_vfrintrp_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0xffffb96b;
>     *((int *)&__m128_op0[2]) = 0xffff57c9;
> @@ -211,7 +211,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0xffff6080;
>     *((int *)&__m128_result[0]) = 0xffff4417;
>     __m128_out = __lsx_vfrintrp_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00ff00ff;
>     *((int *)&__m128_op0[2]) = 0x00ff00ff;
> @@ -222,7 +222,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x62cbf96e;
>     *((int *)&__m128_result[0]) = 0x4acfaf40;
>     __m128_out = __lsx_vfrintrp_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00000000;
>     *((int *)&__m128_op0[2]) = 0x00002000;
> @@ -233,7 +233,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x3f800000;
>     __m128_out = __lsx_vfrintrp_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0xffffffff;
>     *((int *)&__m128_op0[2]) = 0xffffffff;
> @@ -244,7 +244,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0xffffffff;
>     *((int *)&__m128_result[0]) = 0xffffffff;
>     __m128_out = __lsx_vfrintrp_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x63636363;
>     *((int *)&__m128_op0[2]) = 0x63abdf16;
> @@ -255,7 +255,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x42000000;
>     *((int *)&__m128_result[0]) = 0x3f800000;
>     __m128_out = __lsx_vfrintrp_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00000000;
>     *((int *)&__m128_op0[2]) = 0x00000000;
> @@ -266,7 +266,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrm_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0xa5c4c774;
>     *((int *)&__m128_op0[2]) = 0x856ba83b;
> @@ -277,7 +277,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0xbf800000;
>     *((int *)&__m128_result[0]) = 0x54691124;
>     __m128_out = __lsx_vfrintrm_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00000000;
>     *((int *)&__m128_op0[2]) = 0x00010002;
> @@ -288,7 +288,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0xffffffff;
>     *((int *)&__m128_result[0]) = 0xffd60015;
>     __m128_out = __lsx_vfrintrm_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0xffffffff;
>     *((int *)&__m128_op0[2]) = 0x3c992b2e;
> @@ -299,7 +299,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0xffffffff;
>     *((int *)&__m128_result[0]) = 0xffff730f;
>     __m128_out = __lsx_vfrintrz_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00000000;
>     *((int *)&__m128_op0[2]) = 0x00000001;
> @@ -310,7 +310,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrz_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x18171615;
>     *((int *)&__m128_op0[2]) = 0x17161514;
> @@ -321,7 +321,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrz_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x62cbf96e;
>     *((int *)&__m128_op0[2]) = 0x4acfaf40;
> @@ -332,7 +332,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0xf0bc9a52;
>     *((int *)&__m128_result[0]) = 0x78285a4a;
>     __m128_out = __lsx_vfrintrz_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     *((int *)&__m128_op0[3]) = 0x00000000;
>     *((int *)&__m128_op0[2]) = 0x00000000;
> @@ -343,7 +343,7 @@ main ()
>     *((int *)&__m128_result[1]) = 0x00000000;
>     *((int *)&__m128_result[0]) = 0x00000000;
>     __m128_out = __lsx_vfrintrz_s (__m128_op0);
> -  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
> +  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
>   
>     return 0;
>   }
> diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c
> index f3b800f8804..93a3078fa96 100644
> --- a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c
> +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c
> @@ -33,7 +33,7 @@ main ()
>     *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
>     *((unsigned long *)&__m128i_op2[0]) = 0x3f2f1f0f00000000;
>     *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
> -  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
> +  *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00000000;
>     __m128i_out = __lsx_vshuf_b (__m128i_op0, __m128i_op1, __m128i_op2);
>     ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
>   
> @@ -153,7 +153,7 @@ main ()
>     *((unsigned long *)&__m128i_op1[0]) = 0x000000002bfd9461;
>     *((unsigned long *)&__m128i_op2[1]) = 0x00007fff00007fff;
>     *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
> -  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
> +  *((unsigned long *)&__m128i_result[1]) = 0x00007fff00000000;
>     *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
>     __m128i_out = __lsx_vshuf_h (__m128i_op0, __m128i_op1, __m128i_op2);
>     ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
> @@ -198,7 +198,7 @@ main ()
>     *((unsigned long *)&__m128i_op2[1]) = 0x00000000000000c0;
>     *((unsigned long *)&__m128i_op2[0]) = 0x00000001ffffff29;
>     *((unsigned long *)&__m128i_result[1]) = 0xffffff29ffffff29;
> -  *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
> +  *((unsigned long *)&__m128i_result[0]) = 0xffffff2900000001;
>     __m128i_out = __lsx_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2);
>     ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
>   
> @@ -219,7 +219,7 @@ main ()
>     *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
>     *((unsigned long *)&__m128i_op2[1]) = 0x0000000020000020;
>     *((unsigned long *)&__m128i_op2[0]) = 0x0000000020000020;
> -  *((unsigned long *)&__m128i_result[1]) = 0x2000002000000000;
> +  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
>     *((unsigned long *)&__m128i_result[0]) = 0x2000002020000020;
>     __m128i_out = __lsx_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2);
>     ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
> @@ -241,7 +241,7 @@ main ()
>     *((unsigned long *)&__m128i_op1[0]) = 0x0000001000000010;
>     *((unsigned long *)&__m128i_op2[1]) = 0x8000000100000000;
>     *((unsigned long *)&__m128i_op2[0]) = 0x8000000000000103;
> -  *((unsigned long *)&__m128i_result[1]) = 0x0000010300000103;
> +  *((unsigned long *)&__m128i_result[1]) = 0x8000000000000103;
>     *((unsigned long *)&__m128i_result[0]) = 0x0000010380000001;
>     __m128i_out = __lsx_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2);
>     ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
> @@ -252,7 +252,7 @@ main ()
>     *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
>     *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
>     *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
> -  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
> +  *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000;
>     *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
>     __m128i_out = __lsx_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2);
>     ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
> 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 551340bd51f..c1adab586f3 100644
> --- a/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h
> +++ b/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h
> @@ -10,7 +10,7 @@
>           {                                                                     \
>             long long *temp_ref = (long long *)&ref[i],                         \
>   		*temp_res = (long long *)&res[i];			      \
> -          if (abs (*temp_ref - *temp_res) > 0)                                \
> +          if (llabs (*temp_ref - *temp_res) > 0)                                \
>               {                                                                 \
>                 printf (" error: %s at line %ld , expected " #ref               \
>                         "[%ld]:0x%016lx, got: 0x%016lx\n",                      \
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvfrint_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvfrint_s.c
index fbfe300eac4..4538528a67f 100644
--- a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvfrint_s.c
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvfrint_s.c
@@ -184,7 +184,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrne_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0xffffffff;
   *((int *)&__m256_op0[6]) = 0xffffffff;
@@ -203,7 +203,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrne_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0xffffffff;
   *((int *)&__m256_op0[6]) = 0xffffffff;
@@ -222,7 +222,7 @@  main ()
   *((int *)&__m256_result[1]) = 0xffffffff;
   *((int *)&__m256_result[0]) = 0xffffffff;
   __m256_out = __lasx_xvfrintrne_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x01010101;
   *((int *)&__m256_op0[6]) = 0x01010101;
@@ -241,7 +241,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrne_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x00000000;
@@ -260,7 +260,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrne_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0xffffffff;
   *((int *)&__m256_op0[6]) = 0xffffffff;
@@ -279,7 +279,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrne_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0xffffffff;
   *((int *)&__m256_op0[6]) = 0xffffffff;
@@ -298,7 +298,7 @@  main ()
   *((int *)&__m256_result[1]) = 0xffffffff;
   *((int *)&__m256_result[0]) = 0xffffffff;
   __m256_out = __lasx_xvfrintrne_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x01010101;
   *((int *)&__m256_op0[6]) = 0x01010101;
@@ -317,7 +317,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrne_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x55555555;
   *((int *)&__m256_op0[6]) = 0x36aaaaac;
@@ -336,7 +336,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x55555555;
   *((int *)&__m256_result[0]) = 0x80000000;
   __m256_out = __lasx_xvfrintrp_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x00000000;
@@ -355,7 +355,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrp_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0xffffc741;
   *((int *)&__m256_op0[6]) = 0x8a023680;
@@ -374,7 +374,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrp_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0xffffffff;
@@ -393,7 +393,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0xffffffff;
   __m256_out = __lasx_xvfrintrp_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00200101;
   *((int *)&__m256_op0[6]) = 0x01610000;
@@ -412,7 +412,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x3f800000;
   *((int *)&__m256_result[0]) = 0x3f800000;
   __m256_out = __lasx_xvfrintrp_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x00000000;
@@ -431,7 +431,7 @@  main ()
   *((int *)&__m256_result[1]) = 0xfefefefe;
   *((int *)&__m256_result[0]) = 0x3f800000;
   __m256_out = __lasx_xvfrintrp_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x1c1c1c1c;
   *((int *)&__m256_op0[6]) = 0x1c1c1c1c;
@@ -450,7 +450,7 @@  main ()
   *((int *)&__m256_result[1]) = 0xfffffffe;
   *((int *)&__m256_result[0]) = 0xffffff00;
   __m256_out = __lasx_xvfrintrp_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x00000000;
@@ -469,7 +469,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrm_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x00000000;
@@ -488,7 +488,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrm_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0xffffffff;
   *((int *)&__m256_op0[6]) = 0xffffffff;
@@ -507,7 +507,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0xffffffff;
   __m256_out = __lasx_xvfrintrm_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x5d20a0a1;
   *((int *)&__m256_op0[6]) = 0x5d20a0a1;
@@ -526,7 +526,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrm_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x001d001d;
@@ -545,7 +545,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrm_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x00000000;
@@ -564,7 +564,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrm_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x00000000;
@@ -583,7 +583,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrm_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x00000000;
@@ -602,7 +602,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrz_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0xffffffff;
   *((int *)&__m256_op0[6]) = 0xfffffffe;
@@ -621,7 +621,7 @@  main ()
   *((int *)&__m256_result[1]) = 0xffffffff;
   *((int *)&__m256_result[0]) = 0xfffffffe;
   __m256_out = __lasx_xvfrintrz_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x00000000;
@@ -640,7 +640,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0x00000000;
   __m256_out = __lasx_xvfrintrz_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x00000000;
   *((int *)&__m256_op0[6]) = 0x00000000;
@@ -659,7 +659,7 @@  main ()
   *((int *)&__m256_result[1]) = 0x00000000;
   *((int *)&__m256_result[0]) = 0xffffffff;
   __m256_out = __lasx_xvfrintrz_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0x80000000;
   *((int *)&__m256_op0[6]) = 0x80000000;
@@ -678,7 +678,7 @@  main ()
   *((int *)&__m256_result[1]) = 0xffffffff;
   *((int *)&__m256_result[0]) = 0xffffffff;
   __m256_out = __lasx_xvfrintrz_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0xffffffff;
   *((int *)&__m256_op0[6]) = 0xffffffff;
@@ -697,7 +697,7 @@  main ()
   *((int *)&__m256_result[1]) = 0xffffffff;
   *((int *)&__m256_result[0]) = 0xffffffff;
   __m256_out = __lasx_xvfrintrz_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   *((int *)&__m256_op0[7]) = 0xf5fffc00;
   *((int *)&__m256_op0[6]) = 0xfc000000;
@@ -716,7 +716,7 @@  main ()
   *((int *)&__m256_result[1]) = 0xf5fffc00;
   *((int *)&__m256_result[0]) = 0xfc000000;
   __m256_out = __lasx_xvfrintrz_s (__m256_op0);
-  ASSERTEQ_64 (__LINE__, __m256_result, __m256_out);
+  ASSERTEQ_32 (__LINE__, __m256_result, __m256_out);
 
   return 0;
 }
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvshuf_b.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvshuf_b.c
index b8ab387118a..910d2933996 100644
--- a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvshuf_b.c
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvshuf_b.c
@@ -99,9 +99,9 @@  main ()
   *((unsigned long *)&__m256i_op1[2]) = 0x7ff0000000000000;
   *((unsigned long *)&__m256i_op1[1]) = 0x7ff0000000000000;
   *((unsigned long *)&__m256i_op1[0]) = 0x7ff0000000000000;
-  *((unsigned long *)&__m256i_op2[3]) = 0x3ff0010000000000;
+  *((unsigned long *)&__m256i_op2[3]) = 0x3f11010000000000;
   *((unsigned long *)&__m256i_op2[2]) = 0x0000000000000000;
-  *((unsigned long *)&__m256i_op2[1]) = 0x3ff0010000000000;
+  *((unsigned long *)&__m256i_op2[1]) = 0x3f11010000000000;
   *((unsigned long *)&__m256i_op2[0]) = 0x0000000000000000;
   *((unsigned long *)&__m256i_result[3]) = 0x0000000000000000;
   *((unsigned long *)&__m256i_result[2]) = 0x0000000000000000;
@@ -200,7 +200,7 @@  main ()
   *((unsigned long *)&__m256i_op2[0]) = 0x0000000000000000;
   *((unsigned long *)&__m256i_result[3]) = 0x0000000000000000;
   *((unsigned long *)&__m256i_result[2]) = 0x0000000000000000;
-  *((unsigned long *)&__m256i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m256i_result[1]) = 0xffffffff00000000;
   *((unsigned long *)&__m256i_result[0]) = 0x0000000000000000;
   __m256i_out = __lasx_xvshuf_h (__m256i_op0, __m256i_op1, __m256i_op2);
   ASSERTEQ_64 (__LINE__, __m256i_result, __m256i_out);
@@ -351,7 +351,7 @@  main ()
   *((unsigned long *)&__m256i_op2[1]) = 0x0000000000000001;
   *((unsigned long *)&__m256i_op2[0]) = 0x00000000012e2110;
   *((unsigned long *)&__m256i_result[3]) = 0x0000000000000001;
-  *((unsigned long *)&__m256i_result[2]) = 0x0000000200000000;
+  *((unsigned long *)&__m256i_result[2]) = 0x0000000000000000;
   *((unsigned long *)&__m256i_result[1]) = 0x00000000012e2110;
   *((unsigned long *)&__m256i_result[0]) = 0x0000000000000000;
   __m256i_out = __lasx_xvshuf_w (__m256i_op0, __m256i_op1, __m256i_op2);
@@ -426,10 +426,10 @@  main ()
   *((unsigned long *)&__m256i_op2[2]) = 0x8000000080000000;
   *((unsigned long *)&__m256i_op2[1]) = 0xdfffffffdfffffff;
   *((unsigned long *)&__m256i_op2[0]) = 0x8000000080000000;
-  *((unsigned long *)&__m256i_result[3]) = 0x8000000080000000;
+  *((unsigned long *)&__m256i_result[3]) = 0xdfffffff80000000;
   *((unsigned long *)&__m256i_result[2]) = 0x7fc00000dfffffff;
-  *((unsigned long *)&__m256i_result[1]) = 0x8000000080000000;
-  *((unsigned long *)&__m256i_result[0]) = 0x8000000080000000;
+  *((unsigned long *)&__m256i_result[1]) = 0x7fc0000000000000;
+  *((unsigned long *)&__m256i_result[0]) = 0x8000000000000000;
   __m256i_out = __lasx_xvshuf_w (__m256i_op0, __m256i_op1, __m256i_op2);
   ASSERTEQ_64 (__LINE__, __m256i_result, __m256i_out);
 
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c
index 61f28325a6f..5ba91ee5199 100644
--- a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c
@@ -79,7 +79,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrne_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00130013;
   *((int *)&__m128_op0[2]) = 0x00130013;
@@ -90,7 +90,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrne_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x20202020;
   *((int *)&__m128_op0[2]) = 0x20202020;
@@ -101,7 +101,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrne_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00000000;
   *((int *)&__m128_op0[2]) = 0x00000000;
@@ -112,7 +112,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrne_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0xffffffff;
   *((int *)&__m128_op0[2]) = 0xffffffff;
@@ -123,7 +123,7 @@  main ()
   *((int *)&__m128_result[1]) = 0xffffffff;
   *((int *)&__m128_result[0]) = 0xffffffff;
   __m128_out = __lsx_vfrintrne_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00000000;
   *((int *)&__m128_op0[2]) = 0x00000001;
@@ -134,7 +134,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrne_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00000000;
   *((int *)&__m128_op0[2]) = 0x00000000;
@@ -145,7 +145,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrne_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0xfffbfffb;
   *((int *)&__m128_op0[2]) = 0xfffbfffb;
@@ -156,7 +156,7 @@  main ()
   *((int *)&__m128_result[1]) = 0xfffbfffb;
   *((int *)&__m128_result[0]) = 0xfffbfffb;
   __m128_out = __lsx_vfrintrne_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x0ff780a1;
   *((int *)&__m128_op0[2]) = 0x0efc01af;
@@ -167,7 +167,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0xfe7f0000;
   __m128_out = __lsx_vfrintrne_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00000000;
   *((int *)&__m128_op0[2]) = 0x00000000;
@@ -178,7 +178,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrp_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00000000;
   *((int *)&__m128_op0[2]) = 0xefffffff;
@@ -189,7 +189,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrp_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0xffffffff;
   *((int *)&__m128_op0[2]) = 0xffffff00;
@@ -200,7 +200,7 @@  main ()
   *((int *)&__m128_result[1]) = 0xffffffff;
   *((int *)&__m128_result[0]) = 0xffffff00;
   __m128_out = __lsx_vfrintrp_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0xffffb96b;
   *((int *)&__m128_op0[2]) = 0xffff57c9;
@@ -211,7 +211,7 @@  main ()
   *((int *)&__m128_result[1]) = 0xffff6080;
   *((int *)&__m128_result[0]) = 0xffff4417;
   __m128_out = __lsx_vfrintrp_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00ff00ff;
   *((int *)&__m128_op0[2]) = 0x00ff00ff;
@@ -222,7 +222,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x62cbf96e;
   *((int *)&__m128_result[0]) = 0x4acfaf40;
   __m128_out = __lsx_vfrintrp_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00000000;
   *((int *)&__m128_op0[2]) = 0x00002000;
@@ -233,7 +233,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x3f800000;
   __m128_out = __lsx_vfrintrp_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0xffffffff;
   *((int *)&__m128_op0[2]) = 0xffffffff;
@@ -244,7 +244,7 @@  main ()
   *((int *)&__m128_result[1]) = 0xffffffff;
   *((int *)&__m128_result[0]) = 0xffffffff;
   __m128_out = __lsx_vfrintrp_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x63636363;
   *((int *)&__m128_op0[2]) = 0x63abdf16;
@@ -255,7 +255,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x42000000;
   *((int *)&__m128_result[0]) = 0x3f800000;
   __m128_out = __lsx_vfrintrp_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00000000;
   *((int *)&__m128_op0[2]) = 0x00000000;
@@ -266,7 +266,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrm_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0xa5c4c774;
   *((int *)&__m128_op0[2]) = 0x856ba83b;
@@ -277,7 +277,7 @@  main ()
   *((int *)&__m128_result[1]) = 0xbf800000;
   *((int *)&__m128_result[0]) = 0x54691124;
   __m128_out = __lsx_vfrintrm_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00000000;
   *((int *)&__m128_op0[2]) = 0x00010002;
@@ -288,7 +288,7 @@  main ()
   *((int *)&__m128_result[1]) = 0xffffffff;
   *((int *)&__m128_result[0]) = 0xffd60015;
   __m128_out = __lsx_vfrintrm_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0xffffffff;
   *((int *)&__m128_op0[2]) = 0x3c992b2e;
@@ -299,7 +299,7 @@  main ()
   *((int *)&__m128_result[1]) = 0xffffffff;
   *((int *)&__m128_result[0]) = 0xffff730f;
   __m128_out = __lsx_vfrintrz_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00000000;
   *((int *)&__m128_op0[2]) = 0x00000001;
@@ -310,7 +310,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrz_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x18171615;
   *((int *)&__m128_op0[2]) = 0x17161514;
@@ -321,7 +321,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrz_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x62cbf96e;
   *((int *)&__m128_op0[2]) = 0x4acfaf40;
@@ -332,7 +332,7 @@  main ()
   *((int *)&__m128_result[1]) = 0xf0bc9a52;
   *((int *)&__m128_result[0]) = 0x78285a4a;
   __m128_out = __lsx_vfrintrz_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   *((int *)&__m128_op0[3]) = 0x00000000;
   *((int *)&__m128_op0[2]) = 0x00000000;
@@ -343,7 +343,7 @@  main ()
   *((int *)&__m128_result[1]) = 0x00000000;
   *((int *)&__m128_result[0]) = 0x00000000;
   __m128_out = __lsx_vfrintrz_s (__m128_op0);
-  ASSERTEQ_64 (__LINE__, __m128_result, __m128_out);
+  ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
 
   return 0;
 }
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c
index f3b800f8804..93a3078fa96 100644
--- a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c
@@ -33,7 +33,7 @@  main ()
   *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
   *((unsigned long *)&__m128i_op2[0]) = 0x3f2f1f0f00000000;
   *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
-  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00000000;
   __m128i_out = __lsx_vshuf_b (__m128i_op0, __m128i_op1, __m128i_op2);
   ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
 
@@ -153,7 +153,7 @@  main ()
   *((unsigned long *)&__m128i_op1[0]) = 0x000000002bfd9461;
   *((unsigned long *)&__m128i_op2[1]) = 0x00007fff00007fff;
   *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
-  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00007fff00000000;
   *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
   __m128i_out = __lsx_vshuf_h (__m128i_op0, __m128i_op1, __m128i_op2);
   ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
@@ -198,7 +198,7 @@  main ()
   *((unsigned long *)&__m128i_op2[1]) = 0x00000000000000c0;
   *((unsigned long *)&__m128i_op2[0]) = 0x00000001ffffff29;
   *((unsigned long *)&__m128i_result[1]) = 0xffffff29ffffff29;
-  *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffff2900000001;
   __m128i_out = __lsx_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2);
   ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
 
@@ -219,7 +219,7 @@  main ()
   *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
   *((unsigned long *)&__m128i_op2[1]) = 0x0000000020000020;
   *((unsigned long *)&__m128i_op2[0]) = 0x0000000020000020;
-  *((unsigned long *)&__m128i_result[1]) = 0x2000002000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
   *((unsigned long *)&__m128i_result[0]) = 0x2000002020000020;
   __m128i_out = __lsx_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2);
   ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
@@ -241,7 +241,7 @@  main ()
   *((unsigned long *)&__m128i_op1[0]) = 0x0000001000000010;
   *((unsigned long *)&__m128i_op2[1]) = 0x8000000100000000;
   *((unsigned long *)&__m128i_op2[0]) = 0x8000000000000103;
-  *((unsigned long *)&__m128i_result[1]) = 0x0000010300000103;
+  *((unsigned long *)&__m128i_result[1]) = 0x8000000000000103;
   *((unsigned long *)&__m128i_result[0]) = 0x0000010380000001;
   __m128i_out = __lsx_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2);
   ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
@@ -252,7 +252,7 @@  main ()
   *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
   *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
   *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
-  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000;
   *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
   __m128i_out = __lsx_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2);
   ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
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 551340bd51f..c1adab586f3 100644
--- a/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h
+++ b/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h
@@ -10,7 +10,7 @@ 
         {                                                                     \
           long long *temp_ref = (long long *)&ref[i],                         \
 		*temp_res = (long long *)&res[i];			      \
-          if (abs (*temp_ref - *temp_res) > 0)                                \
+          if (llabs (*temp_ref - *temp_res) > 0)                                \
             {                                                                 \
               printf (" error: %s at line %ld , expected " #ref               \
                       "[%ld]:0x%016lx, got: 0x%016lx\n",                      \