diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadd.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadd.c
new file mode 100644
index 00000000000..7cfb989e4e6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadd.c
@@ -0,0 +1,416 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000b0000000b;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000201000000000b;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000fc0000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000b0000000b;
+  *((unsigned long *)&__m128i_result[0]) = 0x0002010000fc000b;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000017fda829;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000017fda829;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffff0000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000001fffe;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7f7f7f7f00107f04;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7f0000fd7f0000fd;
+  *((unsigned long *)&__m128i_result[1]) = 0x7e7e7e7eff0f7f04;
+  *((unsigned long *)&__m128i_result[0]) = 0x7f0000fd7f01fffb;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0080000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xf4b6f3f52f4ef4a8;
+  *((unsigned long *)&__m128i_op1[1]) = 0x195f307a5d04acbb;
+  *((unsigned long *)&__m128i_op1[0]) = 0x6a1a3fbb3c90260e;
+  *((unsigned long *)&__m128i_result[1]) = 0x19df307a5d04acbb;
+  *((unsigned long *)&__m128i_result[0]) = 0x5ed032b06bde1ab6;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x5555001400005111;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffabbeab55110140;
+  *((unsigned long *)&__m128i_op1[1]) = 0x5555001400005111;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffabbeab55110140;
+  *((unsigned long *)&__m128i_result[1]) = 0xaaaa00280000a222;
+  *((unsigned long *)&__m128i_result[0]) = 0xfe567c56aa220280;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xf51cf8dad6040188;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0982e2daf234ed87;
+  *((unsigned long *)&__m128i_result[1]) = 0xf51cf8dad6040188;
+  *((unsigned long *)&__m128i_result[0]) = 0x0982e2daf234ed87;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000490000004d;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000001ffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000073;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000000000002a;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000049000000c0;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000001ffffff29;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000000000bd3d;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000007fff0000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000000000bd30;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000d7fff0000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000007a6d;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000dfefe0000;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfffd000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffd000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xfefa000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xfefefefefefefefe;
+  *((unsigned long *)&__m128i_result[0]) = 0xfefefefefefefefe;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0038000000051fff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x003c000000022021;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7fff0101ffffe000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7fffffffa0204000;
+  *((unsigned long *)&__m128i_result[1]) = 0x7f370101ff04ffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x7f3bffffa0226021;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x1baf8eabd26bc629;
+  *((unsigned long *)&__m128i_op0[0]) = 0x1c2640b9a8e9fb49;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0002dab8746acf8e;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00036dd1c5c15856;
+  *((unsigned long *)&__m128i_result[1]) = 0x1bb1686346d595b7;
+  *((unsigned long *)&__m128i_result[0]) = 0x1c29ad8a6daa539f;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000003;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfeffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfeffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xfeffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xfeffffffffff0002;
+  __m128i_out = __lsx_vadd_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0001ffff00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xff800000ff800000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xff800000c3080000;
+  *((unsigned long *)&__m128i_result[1]) = 0xff800000ff800000;
+  *((unsigned long *)&__m128i_result[0]) = 0xff81ffffc3080000;
+  __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x004200a000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x004200a000200001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x004200a000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x004200a000200001;
+  __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000001f0000001f;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000001f0000001f;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000001f0000001f;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000001f0000001f;
+  __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00ff00ff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff;
+  __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0029aeaca57d74e6;
+  *((unsigned long *)&__m128i_op0[0]) = 0xdbe332365392c686;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000056f64adb9464;
+  *((unsigned long *)&__m128i_op1[0]) = 0x29ca096f235819c2;
+  *((unsigned long *)&__m128i_result[1]) = 0x002a05a2f059094a;
+  *((unsigned long *)&__m128i_result[0]) = 0x05ad3ba576eae048;
+  __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000010;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010;
+  __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000400;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000000000040d;
+  __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000001300000013;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000001300000013;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000001300000013;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000001300000013;
+  __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000100;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000100;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000100000100;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000001000000ff;
+  __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000300000001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000100010001;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000002fffffffb;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000010000fffb;
+  __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000060000000e;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000001201fe01e9;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000060000000e;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000001201fe01e9;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000c0000001c;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000002403fc03d2;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfff0000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfff0000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xfff1000100010001;
+  *((unsigned long *)&__m128i_result[0]) = 0xfff1000100010001;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xd70b30c96ea9f4e8;
+  *((unsigned long *)&__m128i_op1[0]) = 0xa352bfac9269e0aa;
+  *((unsigned long *)&__m128i_result[1]) = 0xd70b30c96ea9f4e8;
+  *((unsigned long *)&__m128i_result[0]) = 0xa352bfac9269e0aa;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffa;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0001001100110068;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0001001100110067;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x379674c000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x3789f68000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x379674c000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x3789f68000000000;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000555889;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000002580f01;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00060fbf02040fbf;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00020fbf02000fbf;
+  *((unsigned long *)&__m128i_result[1]) = 0x00060fbf02596848;
+  *((unsigned long *)&__m128i_result[0]) = 0x00020fbf04581ec0;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0001388928513889;
+  *((unsigned long *)&__m128i_op0[0]) = 0x006938094a013889;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0001388928513889;
+  *((unsigned long *)&__m128i_op1[0]) = 0x006938094a013889;
+  *((unsigned long *)&__m128i_result[1]) = 0x0002711250a27112;
+  *((unsigned long *)&__m128i_result[0]) = 0x00d2701294027112;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x001effae001effae;
+  *((unsigned long *)&__m128i_op0[0]) = 0x001effae001effae;
+  *((unsigned long *)&__m128i_op1[1]) = 0x2006454690d3de87;
+  *((unsigned long *)&__m128i_op1[0]) = 0x2006454690d3de87;
+  *((unsigned long *)&__m128i_result[1]) = 0x202544f490f2de35;
+  *((unsigned long *)&__m128i_result[0]) = 0x202544f490f2de35;
+  __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadda.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadda.c
new file mode 100644
index 00000000000..4bb699eab4a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadda.c
@@ -0,0 +1,344 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x52527d7d52527d7d;
+  *((unsigned long *)&__m128i_op1[0]) = 0x52527d7d52527d7d;
+  *((unsigned long *)&__m128i_result[1]) = 0x52527d7d52527d7d;
+  *((unsigned long *)&__m128i_result[0]) = 0x52527d7d52527d7d;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000001fffc001f;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0101010202050120;
+  *((unsigned long *)&__m128i_result[0]) = 0x0101010102020202;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0003000300030003;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0003000700020005;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0003000300030003;
+  *((unsigned long *)&__m128i_result[0]) = 0x0003000700020005;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+  *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x4f8000004f800000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x4f8000004f800000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x4f8000004f800000;
+  *((unsigned long *)&__m128i_result[0]) = 0x4f8000004f800000;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffcfffcfffcfffc;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffcfffcfffcfffc;
+  *((unsigned long *)&__m128i_result[1]) = 0x0003000300030004;
+  *((unsigned long *)&__m128i_result[0]) = 0x0003000300030004;
+  __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x5c9c9c9ce3636363;
+  *((unsigned long *)&__m128i_op0[0]) = 0x63635c9e63692363;
+  *((unsigned long *)&__m128i_op1[1]) = 0xf0fd800080000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000a00028004000;
+  *((unsigned long *)&__m128i_result[1]) = 0x6b9fe3649c9d6363;
+  *((unsigned long *)&__m128i_result[0]) = 0x6363bc9e8b696363;
+  __m128i_out = __lsx_vadda_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x1111111111111111;
+  *((unsigned long *)&__m128i_op0[0]) = 0x1111111111111111;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000020;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000020;
+  *((unsigned long *)&__m128i_result[1]) = 0x1111113111111131;
+  *((unsigned long *)&__m128i_result[0]) = 0x1111113111111131;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000000006a9a5c;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000092444;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000006a9a5c;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000092444;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000d4ccb8;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000124888;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x76f424887fffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfff082f000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x003f000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000f7d1000000001;
+  *((unsigned long *)&__m128i_result[0]) = 0x773324887fffffff;
+  __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfffffacdb6dbecac;
+  *((unsigned long *)&__m128i_op0[0]) = 0x1f5533a694f902c0;
+  *((unsigned long *)&__m128i_op1[1]) = 0x5a6f5c53ebed3faa;
+  *((unsigned long *)&__m128i_op1[0]) = 0xa36aca4435b8b8e1;
+  *((unsigned long *)&__m128i_result[1]) = 0x5a6f61865d36d3aa;
+  *((unsigned long *)&__m128i_result[0]) = 0x7bea6962a0bfb621;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000008140c80;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000008140c80;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000fffe0000ff45;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff000000b9;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffd5002affffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x343d8dc6b0ed5a08;
+  *((unsigned long *)&__m128i_result[1]) = 0x012b012c01010246;
+  *((unsigned long *)&__m128i_result[0]) = 0x353e743b50135a4f;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0003c853c843c87e;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0003c853c843c87e;
+  *((unsigned long *)&__m128i_result[1]) = 0x0003c853c843c87e;
+  *((unsigned long *)&__m128i_result[0]) = 0x0003c853c843c87e;
+  __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000200000002000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffe000ffdf;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000200000002001;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000001fff0021;
+  __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000008;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0101010101010109;
+  *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000005452505;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000004442403e4;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffe0;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000005452505;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000044525043c;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x5d7f5d807fea807f;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x5d7f5d807fea807f;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xbafebb00ffd500fe;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000208000002080;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000208000002080;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000208000002080;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000208000002080;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x8000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7fff00007fff0000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7fff00007fff0000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x003f0000003f0000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x003f0000003f0000;
+  *((unsigned long *)&__m128i_result[1]) = 0x803e0000803e0000;
+  *((unsigned long *)&__m128i_result[0]) = 0x803e0000803e0000;
+  __m128i_out = __lsx_vadda_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000800000008000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000800000008000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000800000008000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000800000008000;
+  __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000001400000014;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000001400000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfff9000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffc000400000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0007001400000014;
+  *((unsigned long *)&__m128i_result[0]) = 0x0004001000000000;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_result[1]) = 0xfefeff00fefeff00;
+  *((unsigned long *)&__m128i_result[0]) = 0xfefeff00fefeff00;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vadda_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000000084d12ce;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000024170000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000020300000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000084d12ce;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000044470000;
+  __m128i_out = __lsx_vadda_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op1[1]) = 0xff01ff01ac025c87;
+  *((unsigned long *)&__m128i_op1[0]) = 0xff01ff01ac465ca1;
+  *((unsigned long *)&__m128i_result[1]) = 0x64616462b76106dc;
+  *((unsigned long *)&__m128i_result[0]) = 0x64616462b71d06c2;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffaeffaeffaeffae;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffaeffaeffaeffae;
+  *((unsigned long *)&__m128i_result[1]) = 0x0051005200510052;
+  *((unsigned long *)&__m128i_result[0]) = 0x0051005200510052;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x3a8000003a800000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x3bc000003a800000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0a0000000a000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0a0000000a000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x4480000044800000;
+  *((unsigned long *)&__m128i_result[0]) = 0x45c0000044800000;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_result[0]) = 0x6363636463636363;
+  __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddi.c
new file mode 100644
index 00000000000..77afabe92fa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddi.c
@@ -0,0 +1,251 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x1414141414141415;
+  *((unsigned long *)&__m128i_result[0]) = 0x1414141414141415;
+  __m128i_out = __lsx_vaddi_bu (__m128i_op0, 0x14);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0505050505050505;
+  *((unsigned long *)&__m128i_result[0]) = 0x0505050504040404;
+  __m128i_out = __lsx_vaddi_bu (__m128i_op0, 0x5);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000008140c80;
+  *((unsigned long *)&__m128i_result[1]) = 0x1f1f1f1f1f1f1f1f;
+  *((unsigned long *)&__m128i_result[0]) = 0x1f1f1f1f27332b9f;
+  __m128i_out = __lsx_vaddi_bu (__m128i_op0, 0x1f);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0303030303030303;
+  *((unsigned long *)&__m128i_result[0]) = 0x0303030303030304;
+  __m128i_out = __lsx_vaddi_bu (__m128i_op0, 0x3);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_result[1]) = 0x8f8f8f8f8f8f8f8f;
+  *((unsigned long *)&__m128i_result[0]) = 0x8f8f8f8f8f8f8f8f;
+  __m128i_out = __lsx_vaddi_bu (__m128i_op0, 0xf);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0018001800180018;
+  *((unsigned long *)&__m128i_result[0]) = 0x0018001800180018;
+  __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0x18);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000080000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000080000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0019081900190019;
+  *((unsigned long *)&__m128i_result[0]) = 0x0019081900190019;
+  __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0x19);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000a000a000a000a;
+  *((unsigned long *)&__m128i_result[0]) = 0x000a000a000a000a;
+  __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0xa);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffc1000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000ff0000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffcc000b000b000b;
+  *((unsigned long *)&__m128i_result[0]) = 0x000b000b010a000b;
+  __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0xb);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x001f001f001f001f;
+  *((unsigned long *)&__m128i_result[0]) = 0x001f001f001f001f;
+  __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0x1f);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x001c001c001c001c;
+  *((unsigned long *)&__m128i_result[0]) = 0x001c001c001c001c;
+  __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0x1c);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000;
+  *((unsigned long *)&__m128i_result[1]) = 0x680485c8b304b019;
+  *((unsigned long *)&__m128i_result[0]) = 0xc89d7f0fed582019;
+  __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0x19);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000a0000000a;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000a0000000a;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0xa);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000001000001;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffe000ffff1fff;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000090100000a;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffe009ffff2008;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x9);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000300000003;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x3);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfc01fcfefc02fdf7;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfe00fcfffe01fd01;
+  *((unsigned long *)&__m128i_result[1]) = 0xfc01fd13fc02fe0c;
+  *((unsigned long *)&__m128i_result[0]) = 0xfe00fd14fe01fd16;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x15);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000001300000013;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000001300000013;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x13);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000000000bd3d;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000007fff0000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000c0000bd49;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000c7fff000c;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0xc);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffe0001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000500000005;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000005fffe0006;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x5);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000000fffffeff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000009ffffff08;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000900000009;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x9);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x55aa55aa55aa55ab;
+  *((unsigned long *)&__m128i_op0[0]) = 0xaa55555655aaaaa8;
+  *((unsigned long *)&__m128i_result[1]) = 0x55aa55c355aa55c4;
+  *((unsigned long *)&__m128i_result[0]) = 0xaa55556f55aaaac1;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x19);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000020;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000e0000002e;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000e0000004e;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0xe);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000400000004;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000400000004;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x4);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x003f0000ffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x003f0000ffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x003f000400000003;
+  *((unsigned long *)&__m128i_result[0]) = 0x003f000400000003;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x4);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xff8000010f800000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000900000009;
+  *((unsigned long *)&__m128i_result[0]) = 0xff80000a0f800009;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x9);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x30eb020302101b03;
+  *((unsigned long *)&__m128i_op0[0]) = 0x020310d0c0030220;
+  *((unsigned long *)&__m128i_result[1]) = 0x30eb022002101b20;
+  *((unsigned long *)&__m128i_result[0]) = 0x020310edc003023d;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x1d);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x59f7fd7059f7fd70;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000001700000017;
+  *((unsigned long *)&__m128i_result[0]) = 0x59f7fd8759f7fd87;
+  __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x17);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x6420e0208400c4c4;
+  *((unsigned long *)&__m128i_op0[0]) = 0x20c4e0c4e0da647a;
+  *((unsigned long *)&__m128i_result[1]) = 0x6420e0208400c4e3;
+  *((unsigned long *)&__m128i_result[0]) = 0x20c4e0c4e0da6499;
+  __m128i_out = __lsx_vaddi_du (__m128i_op0, 0x1f);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e1d001b1a;
+  *((unsigned long *)&__m128i_op0[0]) = 0x1918171615141312;
+  *((unsigned long *)&__m128i_result[1]) = 0x21201f1e1d001b25;
+  *((unsigned long *)&__m128i_result[0]) = 0x191817161514131d;
+  __m128i_out = __lsx_vaddi_du (__m128i_op0, 0xb);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000014;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014;
+  __m128i_out = __lsx_vaddi_du (__m128i_op0, 0x14);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000004000000040;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00007770ffff9411;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000400000004c;
+  *((unsigned long *)&__m128i_result[0]) = 0x00007770ffff941d;
+  __m128i_out = __lsx_vaddi_du (__m128i_op0, 0xc);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000016;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000016;
+  __m128i_out = __lsx_vaddi_du (__m128i_op0, 0x16);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000800000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000080000000b;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000000000000b;
+  __m128i_out = __lsx_vaddi_du (__m128i_op0, 0xb);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-1.c
new file mode 100644
index 00000000000..b7b16a325bf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-1.c
@@ -0,0 +1,335 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000000000007b;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000100010001007c;
+  *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001;
+  __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x3fffffff80000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00003ffd000a4000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffd000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffcffff00000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000fffd000a0000;
+  __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0800080008000800;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0800080008000800;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7fff00007fff0000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7fff00007fff0000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000;
+  __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000490000004d;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000001ffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xff000000ff00ff00;
+  *((unsigned long *)&__m128i_op1[0]) = 0xff00ff0000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000049ffffff4d;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffff01ffffffff;
+  __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x003fffff00000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x003fffff00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000;
+  __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000005e695e95;
+  *((unsigned long *)&__m128i_op0[0]) = 0x5e695e96c396b402;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000005e94;
+  *((unsigned long *)&__m128i_result[0]) = 0x00005e96ffffb402;
+  __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0101010101010101;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffb;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffb;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000100000000fc;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000100000000fc;
+  __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000158;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000158;
+  __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000005d5d;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000005d5d;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x5c9c9c9ce3636363;
+  *((unsigned long *)&__m128i_op0[0]) = 0x63635c9e63692363;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffe3636363;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000063692363;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0202020202020203;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0202020202020203;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000002020202;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000002020202;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x1817161517161514;
+  *((unsigned long *)&__m128i_op0[0]) = 0x1615141315141312;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x76f424887fffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000017161515;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000095141311;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffff00000000ffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000000000fffe;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfdfef9ff0efff900;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffcfd000000fb00;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0001fe00f8000700;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000000000fb01;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000007000000;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000080806362;
+  *((unsigned long *)&__m128i_op1[0]) = 0x807f808000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffff80806362;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000ff00ff;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000010002;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ff960015;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000010002;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffff960015;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xf6548a1747e59090;
+  *((unsigned long *)&__m128i_op0[0]) = 0x27b169bbb8145f50;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000047e59090;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffb8145f50;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00bbfff7fffffff7;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff008ff820;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00bbfff7fffffff7;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffff008ff820;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffee;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000011ff040;
+  __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000100010001fffe;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000100010001fffd;
+  __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000010;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffc2ffe700000007;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000ffc100010001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ffc100010001;
+  __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffff80df00000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000dfa6e0c6;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000d46cdc13;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000d46cdc13;
+  __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfe813f00fe813f00;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfe813f00fe813f00;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xfe813f00fe813f00;
+  __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffe;
+  __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-2.c
new file mode 100644
index 00000000000..a407cadfbaa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-2.c
@@ -0,0 +1,344 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000ff000000ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0400040004000400;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0400040004000400;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x061006100613030c;
+  *((unsigned long *)&__m128i_op1[0]) = 0x4d6814ef9c77ce46;
+  *((unsigned long *)&__m128i_result[1]) = 0x010f010f0112010b;
+  *((unsigned long *)&__m128i_result[0]) = 0x016701ee01760145;
+  __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x1000100010001000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000ffac0a000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000ac00000000;
+  __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xf589caff5605f2fa;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000014eb54ab;
+  *((unsigned long *)&__m128i_op1[0]) = 0x14eb6a002a406a00;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000eb00ab;
+  *((unsigned long *)&__m128i_result[0]) = 0x017400ff004500fa;
+  __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000ff000000ff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000ff000000ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x10f917d72d3d01e4;
+  *((unsigned long *)&__m128i_op0[0]) = 0x203e16d116de012b;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000017d7000001e4;
+  *((unsigned long *)&__m128i_result[0]) = 0x000016d10000012b;
+  __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000ff000000ff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff3fbfffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff7fffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x000100fe000100fe;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff;
+  __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0003c853c843c87e;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0003c853c843c87e;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffff000000ff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0001c8520000c97d;
+  *((unsigned long *)&__m128i_result[0]) = 0x0001c8520001c87d;
+  __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff;
+  __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000ffac0a000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000085af0000b000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00017ea200002000;
+  __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff;
+  __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000024;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000024;
+  __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00307028003f80b0;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0040007fff800000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000003f80b0;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ff800000;
+  __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+  __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000000000001f;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000001f;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000000000001f;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000000000001f;
+  __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffff80ffffff80ff;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000018080807f;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000001ffff80fe;
+  __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7fff000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffff8000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffff8000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffff8000000000;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x1000000010000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000180100100000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x8000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000b5207f80;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00001801b5307f80;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000001300000013;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000001300000013;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000001300000013;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffe218ffffea10;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffff208fffffa02;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffff208fffffa02;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000003fbf3fbf;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7ff8;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000000000000f;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff7fff8007;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff00000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0002000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000014;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7f8000007f800000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x7f8000007f800000;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffd27db010d20fbf;
+  *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffd27db010d20fbf;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[0]) = 0xffa4fb6021a41f7e;
+  __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-3.c
new file mode 100644
index 00000000000..4d5c6099844
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-3.c
@@ -0,0 +1,425 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0403cfcf01c1595e;
+  *((unsigned long *)&__m128i_op0[0]) = 0x837cd5db43fc55d4;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0404038383838404;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0404038383838404;
+  *((unsigned long *)&__m128i_result[1]) = 0x0007005200440062;
+  *((unsigned long *)&__m128i_result[0]) = 0x0080005e007f00d8;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffcafff8ff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000a0;
+  *((unsigned long *)&__m128i_op1[1]) = 0xe6d4572c8a5835bc;
+  *((unsigned long *)&__m128i_op1[0]) = 0xe5017c2ac9ca9fd0;
+  *((unsigned long *)&__m128i_result[1]) = 0x00d3012b015700bb;
+  *((unsigned long *)&__m128i_result[0]) = 0x0001002affca0070;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000fea0000fffe;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x6363771163631745;
+  *((unsigned long *)&__m128i_op1[0]) = 0x636363ec6363636c;
+  *((unsigned long *)&__m128i_result[1]) = 0x006300fb00630143;
+  *((unsigned long *)&__m128i_result[0]) = 0x0063ffec0063006c;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000000000ffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000000000ffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x9c9c9c9c9c9c9c9d;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0000;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x8080ffffffff8080;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00008080ffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xff80ffffffffff80;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ff80ffffffff;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00197f26cb658837;
+  *((unsigned long *)&__m128i_op0[0]) = 0x01009aa4a301084b;
+  *((unsigned long *)&__m128i_op1[1]) = 0x001effae001effae;
+  *((unsigned long *)&__m128i_op1[0]) = 0x001effae001effae;
+  *((unsigned long *)&__m128i_result[1]) = 0x0037ffd40083ffe5;
+  *((unsigned long *)&__m128i_result[0]) = 0x001e0052001ffff9;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffff00ffffff00ff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000f50000000900;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000090900000998;
+  *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x00ff000900ffff98;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x10f881a20ffd02b0;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ff800000;
+  *((unsigned long *)&__m128i_result[1]) = 0xfff8ffa2fffdffb0;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ff800000;
+  __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00007fff00007fff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000000000007b;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000000000007b;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x1e0200001e020000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffcfffcfffcfffd;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffcfffdfffcfffd;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffffffcfffffffd;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffffffdfffffffd;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xff00ff00ff00ff00;
+  *((unsigned long *)&__m128i_op0[0]) = 0xff00ff00ff00ff00;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ff000000ff00;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ff000000ff00;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0101010101010101;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000010100000101;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000010100000101;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000400000004;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000400000004;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000400000004;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000400000004;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x8000000080000008;
+  *((unsigned long *)&__m128i_op1[0]) = 0xa2f54a1ea2f54a1e;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008;
+  *((unsigned long *)&__m128i_result[0]) = 0x00004a1e00004a1e;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000868686868686;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000ff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000868600008785;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x63636b6afe486741;
+  *((unsigned long *)&__m128i_op0[0]) = 0x41f8e880ffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xe363636363abdf16;
+  *((unsigned long *)&__m128i_op1[0]) = 0x41f8e08016161198;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000cecd00004657;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000c90000011197;
+  __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000001000f000e;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000fff1000ffffe;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000000f000e;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000000ffffe;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0c07e181ffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x3430af9effffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000fe00ff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000fe00ff;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00060012000e002b;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000049ffffffaa;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000000e002b;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffaa;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000006f00001f0a;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000958affff995d;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000bfffffffe0f6;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000001f0a;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff7a53;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffff7f80ffff7f80;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffff7f80ffff7f80;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffff7f80ffff7f80;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffff7f80ffff7f80;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000fffeff00;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000fffeff00;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0008000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000003dffc2;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000003dffc2;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000003dffc2;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000003dffc2;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0080008000800080;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0080006b0000000b;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000800080;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000000000000b;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00ff00ff00ff00ff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00ff00ff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000ff00ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000ff00ff;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000455555555;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000055555555;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xff7f810100001000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000400530050ffa6;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffff007fff810001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000400530050ffa6;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffff811001;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000a1ff4c;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000020;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000001f0000001f;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff7fffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000000000001f;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000008000001e;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xd3259a2984048c23;
+  *((unsigned long *)&__m128i_op0[0]) = 0xf9796558e39953fd;
+  *((unsigned long *)&__m128i_op1[1]) = 0x86dd8341b164f12b;
+  *((unsigned long *)&__m128i_op1[0]) = 0x9611c3985b3159f5;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000035697d4e;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000013ecaadf2;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ef00ff010f;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff010f;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op1[0]) = 0xc1f03e1042208410;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000001000110;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000431f851f;
+  __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000030000003f;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000030000003f;
+  __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffbfffffffbf;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffbfffffffbf;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffbfffffffbe;
+  __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x06b1213ef1efa299;
+  *((unsigned long *)&__m128i_op0[0]) = 0x8312f5424ca4a07f;
+  *((unsigned long *)&__m128i_op1[1]) = 0x1f1f1f1f1f1f1f00;
+  *((unsigned long *)&__m128i_op1[0]) = 0x1f1f1f27332b9f00;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xa23214697fd03f7f;
+  __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x80000000ffffd860;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff80000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x7fffffff80000000;
+  __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-1.c
new file mode 100644
index 00000000000..0ebe8c8a9fb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-1.c
@@ -0,0 +1,408 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000ca354688;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0404038383838404;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0404038383838404;
+  *((unsigned long *)&__m128i_result[1]) = 0x00040003ff83ff84;
+  *((unsigned long *)&__m128i_result[0]) = 0x00040003ff4dffca;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000000000040d;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00001f5400000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000014;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000014;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000001f00000000;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000f80007;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0xb);
+  *((unsigned long *)&__m128i_op0[1]) = 0x003fffff00000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x003fffff00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ffff00000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ffff00000000;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffff0100ff;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffefffefffefffe;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffefffefffeffff;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x478b478b38031779;
+  *((unsigned long *)&__m128i_op0[0]) = 0x6b769e690fa1e119;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000001030103;
+  *((unsigned long *)&__m128i_result[1]) = 0x0047004700380017;
+  *((unsigned long *)&__m128i_result[0]) = 0x006bff9e0010ffe2;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xc0b4d1a5f8babad3;
+  *((unsigned long *)&__m128i_op0[0]) = 0xbbc8ecc5f3ced5f3;
+  *((unsigned long *)&__m128i_op1[1]) = 0xc0b4d1a5f8babad3;
+  *((unsigned long *)&__m128i_op1[0]) = 0xbbc8ecc5f3ced5f3;
+  *((unsigned long *)&__m128i_result[1]) = 0xff80ffa2fff0ff74;
+  *((unsigned long *)&__m128i_result[0]) = 0xff76ffd8ffe6ffaa;
+  __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000800;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000800000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x1f54e0ab00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00001f5400000000;
+  __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000000000000f;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000208000002080;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000208000002080;
+  *((unsigned long *)&__m128i_op1[1]) = 0xd70b30c96ea9f4e8;
+  *((unsigned long *)&__m128i_op1[0]) = 0xa352bfac9269e0aa;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffd70b00006ea9;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffa352ffff9269;
+  __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000208000002080;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000208000002080;
+  *((unsigned long *)&__m128i_op1[1]) = 0xd70b30c96ea9f4e8;
+  *((unsigned long *)&__m128i_op1[0]) = 0xa352bfac9269e0aa;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffd70b00006ea9;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffa352ffff9269;
+  __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xff800000ff800000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xe593c8c4e593c8c4;
+  *((unsigned long *)&__m128i_op1[1]) = 0x8144ffff01c820a4;
+  *((unsigned long *)&__m128i_op1[0]) = 0x9b2ee1a4034b4e34;
+  *((unsigned long *)&__m128i_result[1]) = 0xffff80c400000148;
+  *((unsigned long *)&__m128i_result[0]) = 0xffff80c1ffffe8de;
+  __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffffffefffffffe;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffffffefffffffe;
+  __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xa486c90f6537b8d7;
+  *((unsigned long *)&__m128i_op0[0]) = 0x58bcc2013ea1cc1e;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffa486c90f;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000058bcc201;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00001802041b0013;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00001802041b0014;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000003004;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff02000200;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffe000ffffe000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffe000ffffe000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffdfff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffdfff;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000fbf83468;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000fbf83468;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7fffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffff82bb9784;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffc6bb97ac;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000007ffffffe;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x4f804f804f804f80;
+  *((unsigned long *)&__m128i_op0[0]) = 0x4f804f804f804f80;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000001000fbff9;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000002ff9afef;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000004f804f81;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000004f804f80;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000010;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000001000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000001000000010;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000001000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000020;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000020;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000010;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000001000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000000000fff0;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000010;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffe00029f9f6061;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x64e464e464e464e4;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffeffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000064e264e6;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0305030203020502;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0301030203020502;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000003050302;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000003010302;
+  __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000ff0000ff0000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x01fc020000fe0100;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ff0000ff0000;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xff84fff4ff84fff4;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00a6ffceffb60052;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xff84fff4ff84fff4;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000000fefefe6a;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000c2bac2c2;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000fefefe6a;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000020;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000002000000020;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0032000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffff0000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0000;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x5a57bacbd7e39680;
+  *((unsigned long *)&__m128i_op0[0]) = 0x6bae051ffed76001;
+  *((unsigned long *)&__m128i_op1[1]) = 0xf3e6586b60d7b152;
+  *((unsigned long *)&__m128i_op1[0]) = 0xf7077b934ac0e000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x4e3e133738bb47d2;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000117d00007f7b;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000093d0000187f;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7d7f027f7c7f7c79;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7e7f7e7f027f032f;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x7d7f13fc7c7ffbf4;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-2.c
new file mode 100644
index 00000000000..379517f39c6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-2.c
@@ -0,0 +1,344 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x08fdc221bfdb1927;
+  *((unsigned long *)&__m128i_op0[0]) = 0x4303c67e9b7fb213;
+  *((unsigned long *)&__m128i_op1[1]) = 0x08fdc221bfdb1927;
+  *((unsigned long *)&__m128i_op1[0]) = 0x4303c67e9b7fb213;
+  *((unsigned long *)&__m128i_result[1]) = 0x00100184017e0032;
+  *((unsigned long *)&__m128i_result[0]) = 0x0086018c01360164;
+  __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xff77777807777775;
+  *((unsigned long *)&__m128i_op0[0]) = 0xe6eeef00eeeeeebf;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000000000f00f;
+  *((unsigned long *)&__m128i_result[1]) = 0x00ff007700070077;
+  *((unsigned long *)&__m128i_result[0]) = 0x00e600ef00ee01de;
+  __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff;
+  __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff;
+  __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ffff00000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000030000003f;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x4429146a7b4c88b2;
+  *((unsigned long *)&__m128i_op1[0]) = 0xe22b3595efa4aa0c;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000442900007b4c;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000e22b0000efa4;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0006000000040000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0002000000000007;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000600000004;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000636500006363;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000a6;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000080800000808;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000080800000808;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000800000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000800000000000;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0001fffe0001fefc;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0001fffe0001fefc;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000fff80000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xff8000010f800000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ff8000010f78;
+  __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffff7;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffc01;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffff7;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffc01;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000001fffffffe;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000001fffffffe;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec;
+  *((unsigned long *)&__m128i_op0[0]) = 0x370bdfecffecffec;
+  *((unsigned long *)&__m128i_op1[1]) = 0x370bdfecffecffec;
+  *((unsigned long *)&__m128i_op1[0]) = 0x370bdfecffecffec;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000006e17bfd8;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000006e17bfd8;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000158;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x003f000400000003;
+  *((unsigned long *)&__m128i_op0[0]) = 0x003f000400000003;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0001000000010000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000400004;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000003f0004;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7f8000017f800001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7f8000017f800001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000007f800001;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000007f800001;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000;
+  __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x379674c000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x3789f68000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x379674c000000000;
+  __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000001000000010;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-3.c
new file mode 100644
index 00000000000..30dc8351839
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-3.c
@@ -0,0 +1,237 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000a16316b0;
+  *((unsigned long *)&__m128i_op1[0]) = 0x16161616a16316b0;
+  *((unsigned long *)&__m128i_result[1]) = 0x00ff00ffffa10016;
+  *((unsigned long *)&__m128i_result[0]) = 0x01150115ffa10016;
+  __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7f7f7f7f7f7f7f7f;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x007e007e007e007e;
+  *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff;
+  __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000120002000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000200020;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000000000003f;
+  __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000007fffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000007fffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff7fffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000fe00fe;
+  *((unsigned long *)&__m128i_result[0]) = 0x00fe00fe00fe00fe;
+  __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000000011ffee;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000000dfff2;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000000000ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000000000ff;
+  __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00e0000000e00000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000e0000000e0;
+  __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffff7100fffc;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00ff00ffffa10016;
+  *((unsigned long *)&__m128i_op1[0]) = 0x01150115ffa10016;
+  *((unsigned long *)&__m128i_result[1]) = 0x000100fe000070a1;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000115ffffffa1;
+  __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000fffe0000fffe;
+  __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffe218ffffea10;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffff208fffffa02;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff;
+  __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000001000f00fe00;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000017fff00fe7f;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000f00;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffff00;
+  __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x5);
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x04faf60009f5f092;
+  *((unsigned long *)&__m128i_op0[0]) = 0x04fafa9200000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfff9fffefff9ffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x000004fa000009f5;
+  *((unsigned long *)&__m128i_result[0]) = 0x000004f3fffffff9;
+  __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000c2f90000bafa;
+  *((unsigned long *)&__m128i_op0[0]) = 0x8000c2fa8000c2fa;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000c2f90000bafa;
+  __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00001fff00001fff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000003fffffffc;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00001fff00001fff;
+  __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000;
+  __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000807bf0a1f80;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000800ecedee68;
+  *((unsigned long *)&__m128i_op1[1]) = 0x5847b72626ce61ef;
+  *((unsigned long *)&__m128i_op1[0]) = 0x110053f401e7cced;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x5847bf2de5d8816f;
+  __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffff000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000155;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000;
+  __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-1.c
new file mode 100644
index 00000000000..af75f8e4ee0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-1.c
@@ -0,0 +1,488 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x4ee85545068f3133;
+  *((unsigned long *)&__m128i_op0[0]) = 0x870968c1f56bb3cd;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x004e005500060031;
+  *((unsigned long *)&__m128i_result[0]) = 0xff870068fff5ffb3;
+  __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfff082f000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x003f000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xc04d600d3aded151;
+  *((unsigned long *)&__m128i_op1[0]) = 0xc000000000000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x004cff8fffde0051;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+  __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x3ff0000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x800000007fffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x800000007fffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x003f0000ffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x003f0000ffffffff;
+  __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0042003e0042002f;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0001fffc0001fffc;
+  *((unsigned long *)&__m128i_result[1]) = 0x0042003e0042002f;
+  *((unsigned long *)&__m128i_result[0]) = 0x0001fffc0001fffc;
+  __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7505443065413aed;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0100d6effefd0498;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000750500006541;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000100fffffefd;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffff00ff00;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00ffff00;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffff7;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffff00;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffffffe000000f6;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000001fffffffe;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000001fffffffe;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000001fffffffe;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000001fffffffe;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x4050000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000f80007;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000000000f8;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xff80ffffffffff80;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000ff80ffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffff7ffffffffe;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000fffffffe;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xce9035c49ffff570;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000004;
+  *((unsigned long *)&__m128i_op1[0]) = 0xce9035c49ffff574;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000004;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000454ffff9573;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x80007fc000003f00;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7d187e427c993f80;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7500000075000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7500000075000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffff800000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00007d1800007c99;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x5555000054100000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x5555000154100155;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000100000155;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000200;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000200;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000200;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffffffebe6ed565;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffebe6ed565;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffbe6ed563;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x78c00000ff000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000078c00000;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7d3ac60000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000007d3ac600;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7fffffff82bb9784;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7fffffffc6bb97ac;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffff82bb9784;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffc6bb97ac;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x003f0000ffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x003f0000ffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x003f0000ffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x003f0000ffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000003effff;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000003effff;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xf359f359f359f359;
+  *((unsigned long *)&__m128i_op1[0]) = 0xf359f359f359f359;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffffffff359f358;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffffffff359f358;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7f8000007f800000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000e2e36363;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000063636363;
+  __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffe000ffffe000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffe000ffffe000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffff02000200;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffe00001ffe200;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000383;
+  *((unsigned long *)&__m128i_op0[0]) = 0xe400000003ffc001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000001000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffe000ffff1fff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffe000ffff2382;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x03574e39e496cbc9;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000001010000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x03574e38e496cbc9;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xabff54e911f71b07;
+  *((unsigned long *)&__m128i_op0[0]) = 0xa9ec4882f216ea11;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfc01fcfefc02fdf7;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfe00fcfffe01fd01;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xaa0051e90ff91808;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffffffe00000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000030000003f;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000030000003f;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffffff000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffff53d9;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffff0001ffff9515;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffff0001ffff9514;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x9c9c9c9c9c9c9c9c;
+  *((unsigned long *)&__m128i_op0[0]) = 0x9c9c9c9c9c9c9c9c;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x9c9c9c9c9c9c9c9c;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0002000200000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000200000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0002000200000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0002000400000001;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xff80ff807e017f01;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7f3b7f3f7f3b7f21;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0a0000001e000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0a000000f6000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0980ff8174017f01;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x3a8000003a800000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000ef0000000003b;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000ef0000000003b;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000011ff040;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000011ff040;
+  __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-2.c
new file mode 100644
index 00000000000..37c769a2dc2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-2.c
@@ -0,0 +1,452 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000000fff8fff8;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000fff80000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000ff00ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000ff0000;
+  __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xff80000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xff80000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0080000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0080000000000000;
+  __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x5252525252525252;
+  *((unsigned long *)&__m128i_op0[0]) = 0x5252525252525252;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0052005200520052;
+  *((unsigned long *)&__m128i_result[0]) = 0x0052005200520052;
+  __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000fffd;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff000000ff;
+  __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00060012000e002b;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000049ffffffaa;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000060000000e;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000127fffffea;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000060000000e;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000001201fe01e9;
+  __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x5d7f5d807fea807f;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x007f008000ea007f;
+  *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff;
+  __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x4f804f804f804f80;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00009f0000009f00;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000bd3d00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000bd3d00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000bd3d00000000;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000000000001f;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000001f;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffff007f00000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffff007f00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000007f00000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000007f00000000;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7ef400ad21fc7081;
+  *((unsigned long *)&__m128i_op1[0]) = 0x28bf0351ec69b5f2;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000ad00007081;
+  *((unsigned long *)&__m128i_result[0]) = 0x000003510000b5f2;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x5252adadadadadad;
+  *((unsigned long *)&__m128i_op1[0]) = 0xadad52525252adad;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000adad0000adad;
+  *((unsigned long *)&__m128i_result[0]) = 0x000052520000adad;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000ff8000010f78;
+  *((unsigned long *)&__m128i_op1[1]) = 0x002a001a001a000b;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000001a0000000b;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7500000075007500;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00feff8000ff80ff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffff800000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00007d1800007c99;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000f50000007500;
+  *((unsigned long *)&__m128i_result[0]) = 0x00007e1600007d98;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffff760386bdae46;
+  *((unsigned long *)&__m128i_op0[0]) = 0xc1fc7941bc7e00ff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0802080408060803;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ffff000086bd;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ca000000c481;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000007fff9;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffff2356fe165486;
+  *((unsigned long *)&__m128i_op1[0]) = 0x5efeb3165bd7653d;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000235600005486;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000b31600006544;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x9c83e21a22001818;
+  *((unsigned long *)&__m128i_op0[0]) = 0xdd3b8b02563b2d7b;
+  *((unsigned long *)&__m128i_op1[1]) = 0x4f4f4f4f4f4f4f4f;
+  *((unsigned long *)&__m128i_op1[0]) = 0x4f4f4f4f4f4f4f4f;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ebd20000714f;
+  *((unsigned long *)&__m128i_result[0]) = 0x00012c8a0000a58a;
+  __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000003;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xa8beed87bc3f2be1;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0024d8f6a494006a;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfeffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfeffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000001a8beed86;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000010024d8f5;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000078c00000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x6a57a30ff0000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000f0000000;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000040d;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000001fffffffe;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000001fffffffe;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x80000000b57ec564;
+  *((unsigned long *)&__m128i_op1[0]) = 0x8000000083ff0be0;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000001b57ec563;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000183ff0bdf;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x8000e2e3ffffd1d3;
+  *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000008000e2e3;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000200010002;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000200000002;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000200010002;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000002;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000010004;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000001fffffffe;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000001000000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000001000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x4ee85545ffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x870968c1f56bb3cd;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x870968c1f56bb3cd;
+  __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000013d;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0010001000030000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0006000200000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0006000200000000;
+  __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffff01ff01;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffe;
+  __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000000000001b;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000001b;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000001b0000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000001b0000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000001b001b;
+  __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000004870ba0;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000004870ba0;
+  __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000010000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000010000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xff800000ff800000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xff800000ff800000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xff8000010f800000;
+  __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00007fff7fff8000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000000003e2;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmadd.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmadd.c
new file mode 100644
index 00000000000..3fade5157cc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmadd.c
@@ -0,0 +1,450 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffffa486c90f;
+  *((unsigned long *)&__m128i_op2[0]) = 0x1f52d710bf295626;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x7ff0000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x7ff0000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000ffff00000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000200000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000200000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff7f01ff01;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x78c00000ff000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffff7f01ff01;
+  __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfa31dfa21672e711;
+  *((unsigned long *)&__m128i_op1[0]) = 0x1304db85e468073a;
+  *((unsigned long *)&__m128i_op2[1]) = 0x887c8beb969e00f2;
+  *((unsigned long *)&__m128i_op2[0]) = 0x101f8b680b6f8095;
+  *((unsigned long *)&__m128i_result[1]) = 0x7582ed22cb1c6e12;
+  *((unsigned long *)&__m128i_result[0]) = 0x35aaa61c944f34c2;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x5252525252525252;
+  *((unsigned long *)&__m128i_op0[0]) = 0x5252525252525252;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x5252525252525252;
+  *((unsigned long *)&__m128i_result[0]) = 0x5252525252525252;
+  __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  int_out = __lsx_vpickve2gr_b (__m128i_op0, 0xc);
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_op2[1]) = 0xbfffbfffbfffbffe;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x4000400040004002;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfe01fe01fe01fe01;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfe01fe01fe01fe01;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfe01fe01fe01fe01;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfe01fe01fe01fe01;
+  *((unsigned long *)&__m128i_op2[1]) = 0xff00ff00ff00ff00;
+  *((unsigned long *)&__m128i_op2[0]) = 0xff00ff00ff00ff00;
+  *((unsigned long *)&__m128i_result[1]) = 0xf10cf508f904fd01;
+  *((unsigned long *)&__m128i_result[0]) = 0xf10cf508f904fd01;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffb080ffffb080;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffb080ffffb080;
+  *((unsigned long *)&__m128i_op2[1]) = 0x004fcfcfd01f9f9f;
+  *((unsigned long *)&__m128i_op2[0]) = 0x9f4fcfcfcf800000;
+  *((unsigned long *)&__m128i_result[1]) = 0x3504b5fd2dee1f80;
+  *((unsigned long *)&__m128i_result[0]) = 0x4676f70fc0000000;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xf7f7f7ff8e8c6d7e;
+  *((unsigned long *)&__m128i_op0[0]) = 0xf7f7f7f7f7f7fbff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xf7f7f7ff8e8c6d7e;
+  *((unsigned long *)&__m128i_result[0]) = 0xf7f7f7f7f7f7fbff;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0808080808080808;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000020;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000002000000020;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0fbc1df53c1ae3f9;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ff820f81;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xf144e32bc4e61d27;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000020017ef19f;
+  __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000004b01;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00d3012acc56f9bb;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000a0;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000004b01;
+  __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000001000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000ffff0000ff00;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffefffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000001010001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffff0000ffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0fff0fff0fff0fff;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0fff0fff0fff0fff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xf001f0010101f002;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000fffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0010000000000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000007f41;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000fffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0010000000000001;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x01ff020000ff03ff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x01346b8d00b04c5a;
+  *((unsigned long *)&__m128i_op1[1]) = 0x002affd600000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0xcbc2723a4f12a5f8;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x01ff020000ff03ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x01346b8d00b04c5a;
+  __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000080808000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000080808000;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x4040404040404040;
+  *((unsigned long *)&__m128i_op1[0]) = 0x4040404040404040;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00ff000000ff0000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00ff000000ff0000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000455555555;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000455555555;
+  __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x007f00ff00ff00fe;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x7ffffffe00000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x7ffffffe00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x007f00ff00ff00fe;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xdcec560380000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x08ec7f7f80000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7fff010181010102;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff81010102;
+  *((unsigned long *)&__m128i_op2[1]) = 0x32d8f0a905b6c59b;
+  *((unsigned long *)&__m128i_op2[0]) = 0x322a52fc2ba83b96;
+  *((unsigned long *)&__m128i_result[1]) = 0xaa14efac3bb62636;
+  *((unsigned long *)&__m128i_result[0]) = 0xd6c22c8353a80d2c;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_op2[0]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00009c7c00007176;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xff000000001f1f00;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00009c7c00007176;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00060fbf00040fbf;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00020fbf00000fbf;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x9727b8499727b849;
+  *((unsigned long *)&__m128i_op2[0]) = 0x12755900b653f081;
+  *((unsigned long *)&__m128i_result[1]) = 0x00060fbf00040fbf;
+  *((unsigned long *)&__m128i_result[0]) = 0x00020fbf00000fbf;
+  __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000021100000211;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfb141d31fb141d31;
+  *((unsigned long *)&__m128i_op1[1]) = 0x001effae001effae;
+  *((unsigned long *)&__m128i_op1[0]) = 0x001effae001effae;
+  *((unsigned long *)&__m128i_op2[1]) = 0x2006454690d3de87;
+  *((unsigned long *)&__m128i_op2[0]) = 0x2006454690d3de87;
+  *((unsigned long *)&__m128i_result[1]) = 0xc0b4d1a5f8babad3;
+  *((unsigned long *)&__m128i_result[0]) = 0xbbc8ecc5f3ced5f3;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0674c886fcba4e98;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfdce8003090b0906;
+  *((unsigned long *)&__m128i_op1[1]) = 0x003fffc0ffc0003f;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffc0ffc0003f003f;
+  *((unsigned long *)&__m128i_op2[1]) = 0x002a05a2f059094a;
+  *((unsigned long *)&__m128i_op2[0]) = 0x05ad3ba576eae048;
+  *((unsigned long *)&__m128i_result[1]) = 0xd4a6cc27d02397ce;
+  *((unsigned long *)&__m128i_result[0]) = 0x24b85f887e903abe;
+  __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0700f8ff0700f8ff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000007020701;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000007010701;
+  *((unsigned long *)&__m128i_result[1]) = 0x7f8000007f800000;
+  *((unsigned long *)&__m128i_result[0]) = 0x7f8000008680f1ff;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x6363636463abdf17;
+  *((unsigned long *)&__m128i_op0[0]) = 0x41f8e08016161198;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x6363636463abdf17;
+  *((unsigned long *)&__m128i_result[0]) = 0x41f8e08016161198;
+  __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffff00ff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000ff800000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x17c64aaef639f093;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xf6548a1747e59090;
+  *((unsigned long *)&__m128i_op2[0]) = 0x27b169bbb8145f50;
+  *((unsigned long *)&__m128i_result[1]) = 0x10f881a20ffd02b0;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ff800000;
+  __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-1.c
new file mode 100644
index 00000000000..d3fd83da757
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-1.c
@@ -0,0 +1,472 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000036de0000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000003be14000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000001f0a;
+  *((unsigned long *)&__m128i_op2[0]) = 0x00000000ffff7a53;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000001f0000;
+  __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000000000006f;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001f0a;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000000000006f;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000001f0a;
+  __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000cdc1;
+  *((unsigned long *)&__m128i_op1[1]) = 0xe93d0bd19ff0c170;
+  *((unsigned long *)&__m128i_op1[0]) = 0x5237c1bac9eadf55;
+  *((unsigned long *)&__m128i_op2[1]) = 0x05d0ae6002e8748e;
+  *((unsigned long *)&__m128i_op2[0]) = 0xcd1de80217374041;
+  *((unsigned long *)&__m128i_result[1]) = 0xf490ee600180ce20;
+  *((unsigned long *)&__m128i_result[0]) = 0x063bff74fb46e356;
+  __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x4040404040404040;
+  *((unsigned long *)&__m128i_op1[0]) = 0x4040404040404040;
+  *((unsigned long *)&__m128i_op2[1]) = 0x4040404040404040;
+  *((unsigned long *)&__m128i_op2[0]) = 0x4040404040404040;
+  *((unsigned long *)&__m128i_result[1]) = 0x0fff0fff0fff0fff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0fff0fff0fff0fff;
+  __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x6363636363636363;
+  *((unsigned long *)&__m128i_result[0]) = 0x6363636363636363;
+  __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffe00029f9f6061;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x3f5ec0a0feefa0b0;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x000000007fff7fff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffe00029fb060b1;
+  __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x3);
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff8;
+  *((unsigned long *)&__m128i_op1[1]) = 0x8d78336c83652b86;
+  *((unsigned long *)&__m128i_op1[0]) = 0x39c51f389c0d6112;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffff0001ffff0000;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000ff9b0082;
+  *((unsigned long *)&__m128i_result[0]) = 0x003a0037fff2fff8;
+  __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000ff0000857a;
+  *((unsigned long *)&__m128i_op0[0]) = 0x05fafe0101fe000e;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000ff0000857a;
+  *((unsigned long *)&__m128i_op1[0]) = 0x05fafe0101fe000e;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000ff0000857a;
+  *((unsigned long *)&__m128i_result[0]) = 0x05fafe0101fe000e;
+  __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffff82bb9784;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffc6bb97ac;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x7fffffff82bb9784;
+  *((unsigned long *)&__m128i_op2[0]) = 0x7fffffffc6bb97ac;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffff82bb9784;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffc6bb97ac;
+  __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x05d0ba0002e8802e;
+  *((unsigned long *)&__m128i_op0[0]) = 0xd005e802174023d6;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xc000c000c000ff81;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0ba00ba00ba00ba0;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0ba00ba00ba011eb;
+  *((unsigned long *)&__m128i_result[1]) = 0x05d0ae6002e8748e;
+  *((unsigned long *)&__m128i_result[0]) = 0xcd1de80217374041;
+  __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000010000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00fe00ff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x00000fff00000e36;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000fef01000e27ca;
+  __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7fff00007fff0000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7fff00007fff0000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x7fff00007fff0000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x7fff00007fff0000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000040;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040;
+  __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x680485c8b304b019;
+  *((unsigned long *)&__m128i_op0[0]) = 0xc89d7f0fed582019;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000003ddc5dac;
+  *((unsigned long *)&__m128i_op2[1]) = 0x67157b5100005000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x387c7e0a133f2000;
+  *((unsigned long *)&__m128i_result[1]) = 0x680485c8b304b019;
+  *((unsigned long *)&__m128i_result[0]) = 0xc89d7f0ff90da019;
+  __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000ff0000ff0000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x01fc020000fe0100;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff;
+  __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000100fe000100fe;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000100fe000100fe;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff;
+  __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xa23214697fd03f7f;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000010000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7c7c9c0000007176;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x00000000f3040705;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x7c7c9c0000007176;
+  __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x022002101b200203;
+  *((unsigned long *)&__m128i_op0[0]) = 0x022002101b200203;
+  *((unsigned long *)&__m128i_op1[1]) = 0x022002101b200203;
+  *((unsigned long *)&__m128i_op1[0]) = 0x022002101b200203;
+  *((unsigned long *)&__m128i_op2[1]) = 0x000000080c43b700;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x036caeeca7592703;
+  *((unsigned long *)&__m128i_result[0]) = 0x022002101b200203;
+  __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x9c83e21a22001818;
+  *((unsigned long *)&__m128i_op1[0]) = 0xdd3b8b02563b2d7b;
+  *((unsigned long *)&__m128i_op2[1]) = 0x000000009c83e21a;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000022001818;
+  *((unsigned long *)&__m128i_result[1]) = 0xf2c97aaa7d8fa270;
+  *((unsigned long *)&__m128i_result[0]) = 0x0b73e427f7cfcb88;
+  __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0010001000030000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0006000200000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7505445465593af1;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0100d6effefd0498;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0010001000030000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0006000200000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000800;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000800;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000800;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0007000000040000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0003000000010000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000780000007800;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0007000000040000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0003000000010000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xf047ef0000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffff80800001;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff80800001;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffffffff7fff7ef;
+  *((unsigned long *)&__m128i_op1[0]) = 0x80808080ffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000080800000808;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000080800000808;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffffbff8888080a;
+  *((unsigned long *)&__m128i_result[0]) = 0x080803ff807ff7f9;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x3fc03fc000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7f801fe000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x3fc03fc000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x7f801fe000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x01fe01fd01fd01fd;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x5d7f5d007f6a007f;
+  *((unsigned long *)&__m128i_op2[0]) = 0x7fff7fff7fff7f00;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000060000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000500000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000060000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xf8f8f8f8f8f8f8f8;
+  *((unsigned long *)&__m128i_op2[0]) = 0xf8f8f8f8f8f8f8f8;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((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[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-2.c
new file mode 100644
index 00000000000..83928568584
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-2.c
@@ -0,0 +1,383 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff00000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x7fffffff00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x7e00fe0000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffffffbffffff85;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffc0000fdfc;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808;
+  *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+  __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x3941248880000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x3941248880000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x3ff0000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x40f3fa0000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x76f4248880000000;
+  __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000e36400005253;
+  *((unsigned long *)&__m128i_op2[0]) = 0x000035ed0000e000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0080008000800080;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x400000003fffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x4000000040000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000007fffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x400000003fffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x4000000040000000;
+  __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xf1f1f1f149ed7273;
+  *((unsigned long *)&__m128i_op0[0]) = 0x78508ad4ec2ffcde;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffdfdc0d;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x00000000ffdfdc0d;
+  *((unsigned long *)&__m128i_result[1]) = 0xf1f1f1f149ed7273;
+  *((unsigned long *)&__m128i_result[0]) = 0x78508ad4ae70fd87;
+  __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000440efffff000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000003b;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000ffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x440ef000440ef000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x4400000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000440efffff000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000000000003b;
+  __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000000000ffc2f;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00201df000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffc2ffe700000007;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000ffc100010001;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00010020fffeffde;
+  *((unsigned long *)&__m128i_op2[0]) = 0x011f57c100201a46;
+  *((unsigned long *)&__m128i_result[1]) = 0x001ffce00016fb41;
+  *((unsigned long *)&__m128i_result[0]) = 0x57cb857100001a46;
+  __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7ff0000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x8000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000800000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000800000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7c7c9c0000007176;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00ff000000001f1f;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x7c7c9c0000007176;
+  __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xbfd10d0d7b6b6b73;
+  *((unsigned long *)&__m128i_op0[0]) = 0xc5c53492f25acbf2;
+  *((unsigned long *)&__m128i_op1[1]) = 0xff000000001f1f00;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xbfd10d0d7b6b6b73;
+  *((unsigned long *)&__m128i_result[0]) = 0xc5c53492f25acbf2;
+  __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x34947b4b11684f92;
+  *((unsigned long *)&__m128i_op0[0]) = 0xd73691661e5b68b4;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000016f303dff6d2;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000016f303dff6d2;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x7fffffff00000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x34947b4b11684f92;
+  *((unsigned long *)&__m128i_result[0]) = 0xee297a731e5c5f86;
+  __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000ffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0177fff0fffffff0;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000011ff8bc;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00bbfff7fffffff7;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffff008ff820;
+  *((unsigned long *)&__m128i_result[1]) = 0xffe8008fffe7008f;
+  *((unsigned long *)&__m128i_result[0]) = 0x00010001f1153780;
+  __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000021;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010002;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010002;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op2[1]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_op2[0]) = 0x8080808080808080;
+  *((unsigned long *)&__m128i_result[1]) = 0x0001808281820102;
+  *((unsigned long *)&__m128i_result[0]) = 0x0001808201018081;
+  __m128i_out = __lsx_vmaddwev_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000010100fe0101;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffff0200ffff01ff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000017fda829;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00ffff0000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x00ffff0000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x007f7f80807f7f80;
+  *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000020302030;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000020302030;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x3fffffffc0000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000006e17bfd8;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000006e17bfd8;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffff0100000001;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffff0100000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000006e17bfd8;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000006e17bfd8;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0001000100000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_op2[1]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_op2[0]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_result[1]) = 0x00010000fffffffc;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000008000e2e3;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000080000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000008000e2e3;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x00ff00ff00ff00ff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000080806362;
+  *((unsigned long *)&__m128i_result[0]) = 0x807f808000000000;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffa;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x8101010181010101;
+  *((unsigned long *)&__m128i_op1[0]) = 0x8101010181010101;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0001000101010001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000014;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000014;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0001000101010015;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ffed00010001;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-3.c
new file mode 100644
index 00000000000..bab2c6cf385
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-3.c
@@ -0,0 +1,383 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xc0c00000c0c00000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xc0c00c01c2cd0009;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7f78787f00f7f700;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000f7f700f7f700;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000400;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000400;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000400;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000400;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x000000000000040d;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000080003f80ffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000020;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000020;
+  *((unsigned long *)&__m128i_op2[1]) = 0x3ff0010000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x3ff0010000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000080003f80ffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000000000007b;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xff81ff82ff810081;
+  *((unsigned long *)&__m128i_op2[0]) = 0xff82ff810081ff81;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808;
+  *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffff8000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffff8000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000800000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000800000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff8000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x841f000fc28f801f;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x841f000fc28f801f;
+  *((unsigned long *)&__m128i_op2[1]) = 0xff800000ff800000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xe593c8c4e593c8c4;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x76ecfc8b85ac78db;
+  __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000fff3;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x000000000000040d;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000010400;
+  __m128i_out = __lsx_vmaddwev_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000001ca02f854;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00000001ca02f854;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000100013fa0;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000001ca02f854;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000100013fa0;
+  __m128i_out = __lsx_vmaddwev_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000002b0995850;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffff80005613;
+  *((unsigned long *)&__m128i_op1[0]) = 0x007f800000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffff80005613;
+  *((unsigned long *)&__m128i_op2[0]) = 0x007f800000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffff00011cf0c569;
+  *((unsigned long *)&__m128i_result[0]) = 0xc0000002b0995850;
+  __m128i_out = __lsx_vmaddwev_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000ffffff81fe;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffff00ffff7e01;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x000000fffe01fd02;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00fe00fffe86f901;
+  __m128i_out = __lsx_vmaddwev_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000004000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfff8004000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xbfffbfffbfffbffe;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xbfffbfffbfffbffe;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xbfffbfffbfffbffe;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffd3000000130000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffd3000000130000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffd3000000130000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffd3000000130000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffd3000000130000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffd3000000130000;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00000000003dffc2;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000003dffc2;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00000000003dffc2;
+  *((unsigned long *)&__m128i_op2[0]) = 0x00000000003dffc2;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000f02e1f80f04;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000f02e1f80f04;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfffefffe00000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffefffe00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x98147a504d145000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x377b810912c0e000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x5a57bacbd7e39680;
+  *((unsigned long *)&__m128i_op2[0]) = 0x6bae051ffed76001;
+  *((unsigned long *)&__m128i_result[1]) = 0xf3eb458161080000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffe9454286c0e000;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0051005200510052;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0051005200510052;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffaeffaeffaeffae;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffaeffaeffaeffae;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffe65ecc1be5bc;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffe65ecc1be5bc;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xf1f1f1f149ed7273;
+  *((unsigned long *)&__m128i_op0[0]) = 0xf1f1f1f1865e65a1;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff941d;
+  *((unsigned long *)&__m128i_op2[1]) = 0xf1f1f1f149ed7273;
+  *((unsigned long *)&__m128i_op2[0]) = 0xf1f1f1f1865e65a1;
+  *((unsigned long *)&__m128i_result[1]) = 0xf1f1f1f149ed7273;
+  *((unsigned long *)&__m128i_result[0]) = 0x78508ad4ec2ffcde;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000ffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000ffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000ffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x000000120000000d;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000e0000000e;
+  *((unsigned long *)&__m128i_result[1]) = 0x0001000cfffffff2;
+  *((unsigned long *)&__m128i_result[0]) = 0x0001000dfffffff1;
+  __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000001ff000001ff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000001ff000001ff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000001ff000001ff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000001ff000001ff;
+  *((unsigned long *)&__m128i_op2[1]) = 0xff80ffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0x7ffffffeffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x000002fe800000ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x7ffffe0100000000;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xff00000000000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7fffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xff80000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xfe80000000000001;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000080;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000080;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-1.c
new file mode 100644
index 00000000000..5875aa5978d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-1.c
@@ -0,0 +1,372 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000010000000002;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000008000000080;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000c7fff000c;
+  *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xfffff000f0008d3c;
+  *((unsigned long *)&__m128i_op2[0]) = 0xfffff0016fff8d3d;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000100f8100002;
+  *((unsigned long *)&__m128i_result[0]) = 0xfff0ff8006f0f950;
+  __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x007ffd0001400840;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x007ffd0001400840;
+  __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000002000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000002000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffff0000ffff0000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x000000ff000000ff;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000002000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000002000;
+  __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010058;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0001000100010058;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000ffac0a000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000200000001b;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ffac0a000000;
+  __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000017fda829;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000017fda829;
+  __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xff8000000000ffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000800000000ffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x697eba2bedfa9c82;
+  *((unsigned long *)&__m128i_op2[0]) = 0xd705c77a7025c899;
+  *((unsigned long *)&__m128i_result[1]) = 0xffcb410000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffeb827ffffffff;
+  __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffffc00;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000200010;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000fffffc00;
+  __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000f;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000c5ac01015b;
+  *((unsigned long *)&__m128i_op1[0]) = 0xaaacac88a3a9a96a;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000000000000f;
+  __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7ef4002d21fc7001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x28bf02d1ec6a35b2;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffb96bffff57c9;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffff6080ffff4417;
+  *((unsigned long *)&__m128i_op2[1]) = 0xff800000ff800000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xff8000007fc00000;
+  *((unsigned long *)&__m128i_result[1]) = 0x7ef400ad21fc7081;
+  *((unsigned long *)&__m128i_result[0]) = 0x28bf0351ec69b5f2;
+  __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0001200100012001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0xbf8000000000ffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xcf00000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xbf80000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xcf00000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x1040400000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0961000100000001;
+  __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x03574e3a62407e03;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000001010000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7da9b23a624082fd;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x03574e39e496cbc9;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000001010000;
+  __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0400040004000400;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xfffffffff8f8dada;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffff01018888;
+  *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000030000003f;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x3f77aab500000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000ffc100010001;
+  *((unsigned long *)&__m128i_op2[1]) = 0x3f77aab500000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000ffc100010001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0fbc1df53c1ae3f9;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ff820f81;
+  __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000020000020;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000020000020;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00000000ff801c9e;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000810000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000700000004e000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0003000000012020;
+  *((unsigned long *)&__m128i_op1[1]) = 0x003f0000ffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x003f0000ffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00000000e00a18f5;
+  *((unsigned long *)&__m128i_op2[0]) = 0x000000002023dcdc;
+  *((unsigned long *)&__m128i_result[1]) = 0x000700000004e000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0003000000012020;
+  __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000120000000d;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000e0000000e;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000ffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000ffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000000011ffee;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000000dfff2;
+  __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x7ff8000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffff7fffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffff8000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffff7fffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffff8000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000003fff;
+  *((unsigned long *)&__m128i_result[0]) = 0x7ff8010000000001;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000ff000000ff00;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000ff000000ff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000ff000000ff00;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000ff0000ff0000;
+  *((unsigned long *)&__m128i_result[0]) = 0x01fc020000fe0100;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x78c00000ff000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x78c00000ff000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x78c00000ff000000;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((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[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfefefefefefefefe;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfefefefefefefefe;
+  *((unsigned long *)&__m128i_op1[1]) = 0x1000100010001000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x1000100012030e02;
+  *((unsigned long *)&__m128i_result[1]) = 0xfefefefefefefefe;
+  *((unsigned long *)&__m128i_result[0]) = 0xfefefefefefefefe;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000080800000808;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000080800000808;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x010105017878f8f6;
+  *((unsigned long *)&__m128i_op2[0]) = 0xf8f8fd0180810907;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000080800000808;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000080800000808;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000158;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010058;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000158;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x328e1080889415a0;
+  *((unsigned long *)&__m128i_op0[0]) = 0x3960b1a401811060;
+  *((unsigned long *)&__m128i_op1[1]) = 0x328e1080889415a0;
+  *((unsigned long *)&__m128i_op1[0]) = 0x3960b1a401811060;
+  *((unsigned long *)&__m128i_op2[1]) = 0x020310edc003023d;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x32f3c7a38f9f4b8b;
+  *((unsigned long *)&__m128i_result[0]) = 0x2c9e5069f5d57780;
+  __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-2.c
new file mode 100644
index 00000000000..4be7fce8269
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-2.c
@@ -0,0 +1,438 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xd8248069ffe78077;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0d0d0d0d0d0d0d0d;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xd8248069ffe78077;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xe31c86e90cda86f7;
+  __m128i_out = __lsx_vmaddwod_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00010020fffeffde;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0100400100200e68;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00010020fffeffde;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0100400100200e68;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x1ff85ffe2ae5d973;
+  *((unsigned long *)&__m128i_result[1]) = 0x00010020fffeffde;
+  *((unsigned long *)&__m128i_result[0]) = 0x011f57c100201a46;
+  __m128i_out = __lsx_vmaddwod_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xbafebb00ffd500fe;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0c0b0a090b0a0908;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0a09080709080706;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vmaddwod_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffc0800000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffc0800000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffc0800000;
+  __m128i_out = __lsx_vmaddwod_h_bu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000003a24;
+  *((unsigned long *)&__m128i_op0[0]) = 0x003dbe88077c78c1;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000008;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0020002000200020;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000008;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0020002000200020;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000003a24;
+  *((unsigned long *)&__m128i_result[0]) = 0x003dc288077c7cc1;
+  __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffc0000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffc0000000000004;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000455555555;
+  *((unsigned long *)&__m128i_result[1]) = 0xffc0000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xffc0000000000004;
+  __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000000000053a;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000020;
+  *((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[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000036280001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x42a0000042a02001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000005555555554;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000005555555554;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000036280001;
+  *((unsigned long *)&__m128i_result[0]) = 0x42a0000042a02001;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000fe00ff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000ff00fe;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000fe00ff;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffff946c;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffff946b;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffff3c992b2e;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffff730f;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00000000ffff946c;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffff946b;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000ffff946c;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffffffdffff946c;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000080000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000080000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000401000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000080000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000080000000000;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffff800;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00ff000000ff0000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffff800;
+  *((unsigned long *)&__m128i_result[0]) = 0x00ff000000ff0000;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0006ffff0004ffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0002ffff0000ffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffff7f800000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0002fffefffd0001;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7ff8000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7ff8000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffe000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000c6fde000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xe000e0006080b040;
+  *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffe000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000c6fde000;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((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[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x021b7d24c9678a35;
+  *((unsigned long *)&__m128i_op1[0]) = 0x030298a6a1030a49;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000000a752a55;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0a753500950fa306;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x000000000a752a55;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0a753500950fa306;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000000a752a55;
+  *((unsigned long *)&__m128i_result[0]) = 0x0a753500a9fa0d06;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x4f4f4f4f4f4f4f4f;
+  *((unsigned long *)&__m128i_op0[0]) = 0x4f4f4f4f4f4f4f4f;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x4f4f4f4f4f4f4f4f;
+  *((unsigned long *)&__m128i_result[0]) = 0x4f4f4f4f4f4f4f4f;
+  __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000017fda829;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001;
+  *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00ffff0000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x00ffff0000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x007f7f80807f7f80;
+  *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000020302030;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000020302030;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x3fffffffc0000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000006e17bfd8;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000000006e17bfd8;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffff0100000001;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffff0100000001;
+  *((unsigned long *)&__m128i_result[1]) = 0x000000006e17bfd8;
+  *((unsigned long *)&__m128i_result[0]) = 0x000000006e17bfd8;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0001000100000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_op2[1]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_op2[0]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_result[1]) = 0x00010000fffffffc;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000000008000e2e3;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000080000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000008000e2e3;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x00ff00ff00ff00ff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000080806362;
+  *((unsigned long *)&__m128i_result[0]) = 0x807f808000000000;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffa;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffa;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x8101010181010101;
+  *((unsigned long *)&__m128i_op1[0]) = 0x8101010181010101;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0001000101010001;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000014;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000014;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0001000101010015;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000ffed00010001;
+  __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-3.c
new file mode 100644
index 00000000000..8a4c39502f5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-3.c
@@ -0,0 +1,460 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+  __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+  __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+  __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+  int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+  long int long_op0, long_op1, long_op2, lont_out, lont_result;
+  long int long_int_out, long_int_result;
+  unsigned int unsigned_int_out, unsigned_int_result;
+  unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00003fe00ffe3fe0;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000b5207f80;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000b5207f80;
+  __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffe218ffffea10;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfffff208fffffa02;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000004;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xfffff208fffffa02;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffe218ffffea10;
+  *((unsigned long *)&__m128i_result[0]) = 0xfffff208fffffa02;
+  __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000bd3d00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000bd3d00000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000bd3d00000000;
+  __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffff0000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0032000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x2020202020202020;
+  *((unsigned long *)&__m128i_op2[0]) = 0x2020202020207f7f;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff0000;
+  __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00d3012acc56f9bb;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000a0;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000100013fa0;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000120002000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000100013fa0;
+  *((unsigned long *)&__m128i_result[1]) = 0x00d3012acc56f9bb;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000001021;
+  __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0002000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000014;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0002000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000ffff00000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0002000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014;
+  __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000800000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000800000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op2[1]) = 0x4399d3221a29d3f2;
+  *((unsigned long *)&__m128i_op2[0]) = 0xc3818bffe7b7a7b8;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000467fe000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000003ff8;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000003ff8;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x00000000467fef81;
+  __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x7fc0000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x1e801ffc00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000000000000ffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000ff020000fff4;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x7fc0000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x1e801ffc00000000;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x3c600000ff800000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xfe80000000000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xfe80000000000001;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00007f7f00007f7f;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00ffffff03ffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00013fff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000088500000f6a0;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0001fffd00000407;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000442900007b4c;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000e22b0000efa4;
+  *((unsigned long *)&__m128i_result[1]) = 0x00ffffff03ffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffff00013fff;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x14ccc6320176a4d2;
+  *((unsigned long *)&__m128i_op0[0]) = 0x685670d37e80682a;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000007fffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x14ccc6320176a4d2;
+  *((unsigned long *)&__m128i_result[0]) = 0x685670d37e80682a;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xc0411fe800000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x7fff7fff7fff7fff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0x601fbfbeffffffff;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffc105d1aa;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffbc19ecca;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff3efa;
+  *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff43e6;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffa7;
+  *((unsigned long *)&__m128i_op1[1]) = 0x00c2758000bccf42;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00a975be00accf03;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00c2758000bccf42;
+  *((unsigned long *)&__m128i_op2[0]) = 0x00a975be00accf03;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000930400008a10;
+  *((unsigned long *)&__m128i_result[0]) = 0x00006f9100007337;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000ffff00000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0010001000100010;
+  *((unsigned long *)&__m128i_op2[0]) = 0x001000100010c410;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xff02ff1bff02ff23;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000ffffff02fff4;
+  *((unsigned long *)&__m128i_op1[1]) = 0xff02ff1bff02ff23;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffff02fff4;
+  *((unsigned long *)&__m128i_op2[1]) = 0x7fc000007fc00000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x1e801ffc7fc00000;
+  *((unsigned long *)&__m128i_result[1]) = 0x7e44bde9b842ff23;
+  *((unsigned long *)&__m128i_result[0]) = 0x00011e80007edff8;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xfffffffeffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xe0d56a9774f3ea31;
+  *((unsigned long *)&__m128i_op0[0]) = 0xe0dd268932a5edf9;
+  *((unsigned long *)&__m128i_op1[1]) = 0xe0d56a9774f3ea31;
+  *((unsigned long *)&__m128i_op1[0]) = 0xe0dd268932a5edf9;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xd8248069ffe78077;
+  *((unsigned long *)&__m128i_result[1]) = 0xe0d56a9774f3ea31;
+  *((unsigned long *)&__m128i_result[0]) = 0xbddaa86803e33c2a;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0028280000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0028280000282800;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x7505853d654185f5;
+  *((unsigned long *)&__m128i_op2[0]) = 0x01010000fefe0101;
+  *((unsigned long *)&__m128i_result[1]) = 0x0028280000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x012927ffff272800;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x00ffff7f00ff00ff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x00ff007f0101017f;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000020000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000183fffffe5;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000073;
+  *((unsigned long *)&__m128i_op2[0]) = 0x000000000000002a;
+  *((unsigned long *)&__m128i_result[1]) = 0x00ffff7f00ff00ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x00ff007f0101017f;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x3f8000003f800000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x3f8000003f800000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000000002bfd9461;
+  *((unsigned long *)&__m128i_op2[1]) = 0x3f8000003f800001;
+  *((unsigned long *)&__m128i_op2[0]) = 0x3f8000003f800001;
+  *((unsigned long *)&__m128i_result[1]) = 0x3f8000003f800000;
+  *((unsigned long *)&__m128i_result[0]) = 0x3f8000003f800000;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000095896a760000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x006f0efe258ca851;
+  *((unsigned long *)&__m128i_op2[1]) = 0xffff7fc8ffff8000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xffff200000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x000015516a768038;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffff9ed2e1c000;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000120002000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0;
+  *((unsigned long *)&__m128i_op1[1]) = 0x2000200000013fa0;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000013fa0;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000120002000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000100013fa0;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0080008000800080;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0080006b00000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x001b19b1c9c6da5a;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x001b19b1c9c6da5a;
+  *((unsigned long *)&__m128i_result[1]) = 0x0080008000800080;
+  *((unsigned long *)&__m128i_result[0]) = 0x008003496dea0c61;
+  __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+  *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x000001ff000001ff;
+  *((unsigned long *)&__m128i_op0[0]) = 0x000001ff000001ff;
+  *((unsigned long *)&__m128i_op1[1]) = 0x000001ff000001ff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x000001ff000001ff;
+  *((unsigned long *)&__m128i_op2[1]) = 0xff80ffffffffffff;
+  *((unsigned long *)&__m128i_op2[0]) = 0x7ffffffeffffffff;
+  *((unsigned long *)&__m128i_result[1]) = 0x000002fe800000ff;
+  *((unsigned long *)&__m128i_result[0]) = 0x7ffffe0100000000;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0xff00000000000001;
+  *((unsigned long *)&__m128i_op1[1]) = 0x7fffffffffffffff;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0xff80000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0xfe80000000000001;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000080;
+  *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+  *((unsigned long *)&__m128i_op2[1]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_op2[0]) = 0x0001000100010001;
+  *((unsigned long *)&__m128i_result[1]) = 0x0000000000000080;
+  *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+  __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2);
+  ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+  return 0;
+}
