1 Star 0 Fork 128

花花世界/gcc

forked from src-openEuler/gcc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
LoongArch-Add-tests-for-SX-vector-vdiv-vmod-instruct.patch 57.07 KB
一键复制 编辑 原始数据 按行查看 历史
ticat_fp 提交于 2024-03-26 09:26 . LoongArch: update from gcc upstream
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114
From 1a3f6886143b0fd334d1d7530bce0a746b106b27 Mon Sep 17 00:00:00 2001
From: Xiaolong Chen <chenxiaolong@loongson.cn>
Date: Mon, 11 Sep 2023 18:51:44 +0800
Subject: [PATCH 088/124] LoongArch: Add tests for SX vector vdiv/vmod
instructions.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vmod-1.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vmod-2.c: New test.
Signed-off-by: Peng Fan <fanpeng@loongson.cn>
Signed-off-by: ticat_fp <fanpeng@loongson.cn>
---
.../loongarch/vector/lsx/lsx-vdiv-1.c | 299 ++++++++++++++++++
.../loongarch/vector/lsx/lsx-vdiv-2.c | 254 +++++++++++++++
.../loongarch/vector/lsx/lsx-vmod-1.c | 254 +++++++++++++++
.../loongarch/vector/lsx/lsx-vmod-2.c | 254 +++++++++++++++
4 files changed, 1061 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-1.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-2.c
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c
new file mode 100644
index 000000000..cb4be0475
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c
@@ -0,0 +1,299 @@
+/* { 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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x40f3fa0000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffb4ff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffb4ff;
+ *((unsigned long *)&__m128i_result[1]) = 0xc110000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0xc00d060000000000;
+ __m128i_out = __lsx_vdiv_b (__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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000020000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0101000101010001;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000fe0000;
+ *((unsigned long *)&__m128i_result[0]) = 0xffff00ffffff00ff;
+ __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010100000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010100000000;
+ __m128i_out = __lsx_vdiv_b (__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]) = 0xd3259a2984048c23;
+ *((unsigned long *)&__m128i_op1[0]) = 0xf9796558e39953fd;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffff9727ffff9727;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffffe79ffffba5f;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x010169d9010169d9;
+ *((unsigned long *)&__m128i_result[0]) = 0x01010287010146a1;
+ __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000897957687;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000408;
+ *((unsigned long *)&__m128i_op1[1]) = 0x80010001b57fc565;
+ *((unsigned long *)&__m128i_op1[0]) = 0x8001000184000be0;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000080001fffe;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_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]) = 0xffffffff9cf0d77b;
+ *((unsigned long *)&__m128i_op1[0]) = 0xc1000082b0fb585b;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000000ff000000ff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000ff000000ff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x33f5c2d7d975d7fe;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000ff010000ff01;
+ __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000feff23560000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000fd1654860000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x6363636363abdf16;
+ *((unsigned long *)&__m128i_op1[0]) = 0x41f8e08016161198;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000030000;
+ __m128i_out = __lsx_vdiv_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]) = 0x4f4f4f4f4f4f4f4f;
+ *((unsigned long *)&__m128i_op1[0]) = 0x4f4f4f4f4f4f4f4f;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00003ff000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000fffc00000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00001ff800000001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x7ffe800e80000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000200000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x195f307a5d04acbb;
+ *((unsigned long *)&__m128i_op0[0]) = 0x6a1a3fbb3c90260e;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xe6a0cf86a2fb5345;
+ *((unsigned long *)&__m128i_result[0]) = 0x95e5c045c36fd9f2;
+ __m128i_out = __lsx_vdiv_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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000;
+ __m128i_out = __lsx_vdiv_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]) = 0x4f804f804f804f80;
+ *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_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]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_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]) = 0x000fffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0010000000000001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_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]) = 0x370bdfecffecffec;
+ *((unsigned long *)&__m128i_op1[0]) = 0x370bdfecffecffec;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xa2e3a36363636363;
+ *((unsigned long *)&__m128i_op0[0]) = 0xa2e3a36463636363;
+ *((unsigned long *)&__m128i_op1[1]) = 0x7f80000000000007;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000700000007;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000000e32c50e;
+ *((unsigned long *)&__m128i_result[0]) = 0xf2b2ce330e32c50e;
+ __m128i_out = __lsx_vdiv_w (__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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000001;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000001;
+ __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x52527d7d52527d7d;
+ *((unsigned long *)&__m128i_op0[0]) = 0x52527d7d52527d7d;
+ *((unsigned long *)&__m128i_op1[1]) = 0x52527d7d52527d7d;
+ *((unsigned long *)&__m128i_op1[0]) = 0x52527d7d52527d7d;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vdiv_d (__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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x8000000080000000;
+ __m128i_out = __lsx_vdiv_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]) = 0xe93d0bd19ff0c170;
+ *((unsigned long *)&__m128i_op1[0]) = 0x5237c1bac9eadf55;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x003fffff00000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x003fffff00000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00000000003dffc2;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000000003dffc2;
+ *((unsigned long *)&__m128i_result[1]) = 0x00000001084314a6;
+ *((unsigned long *)&__m128i_result[0]) = 0x00000001084314a6;
+ __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000ffef0010000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000010000010101;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0101000001000100;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x4280000042800000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0xbd7fffffbd800000;
+ __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000ff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x30eb022002101b20;
+ *((unsigned long *)&__m128i_op1[0]) = 0x020310edc003023d;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000002000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00000000000004ff;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000000667ae56;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000020;
+ __m128i_out = __lsx_vdiv_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-vdiv-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c
new file mode 100644
index 000000000..f2bc7df27
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c
@@ -0,0 +1,254 @@
+/* { 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_op1[1]) = 0xffffffefffffffef;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffefffffffef;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xe3e3e3e3e3e3e3e3;
+ *((unsigned long *)&__m128i_op1[1]) = 0xe3e3e3e3e3e3e3e3;
+ *((unsigned long *)&__m128i_op1[0]) = 0xe3e3e3e3e3e3e3e3;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vdiv_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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0006000000040000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0002000000000007;
+ *((unsigned long *)&__m128i_op1[1]) = 0x31b1777777777776;
+ *((unsigned long *)&__m128i_op1[0]) = 0x6eee282828282829;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000010100000101;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000010100000101;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0effeffefdffa1e0;
+ *((unsigned long *)&__m128i_op0[0]) = 0xe6004c5f64284224;
+ *((unsigned long *)&__m128i_op1[1]) = 0xfeffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfeffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000000010000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_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]) = 0x10f917d72d3d01e4;
+ *((unsigned long *)&__m128i_op1[0]) = 0x203e16d116de012b;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000073;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000000000002a;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00ffffff00ff00ff;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000003f200001e01;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000014bf000019da;
+ *((unsigned long *)&__m128i_op1[1]) = 0x9c9c99aed5b88fcf;
+ *((unsigned long *)&__m128i_op1[0]) = 0x7c3650c5f79a61a3;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0002000200020002;
+ *((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]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_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]) = 0x8080808080808080;
+ *((unsigned long *)&__m128i_op1[0]) = 0x8080808080800008;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffd700;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffff00;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffff00;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000;
+ __m128i_out = __lsx_vdiv_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]) = 0x0000ffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffffdfffdf;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ff00;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffbfff8;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0080008000800080;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0080006b0000000b;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x000001ff1745745c;
+ __m128i_out = __lsx_vdiv_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]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffff14eb54ab;
+ *((unsigned long *)&__m128i_op0[0]) = 0x14ea6a002a406a00;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffff80008a7555aa;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0a7535006af05cf9;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000;
+ __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0141010101410101;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0141010101410101;
+ *((unsigned long *)&__m128i_op1[1]) = 0xfebffefffebffeff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfebffefffebffeff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x6363797c63996399;
+ *((unsigned long *)&__m128i_op0[0]) = 0x171f0a1f6376441f;
+ *((unsigned long *)&__m128i_op1[1]) = 0x6363797c63996399;
+ *((unsigned long *)&__m128i_op1[0]) = 0x171f0a1f6376441f;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000036de0000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000003be14000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x000000000000006f;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000001f0a;
+ *((unsigned long *)&__m128i_result[1]) = 0x00000000007e8a60;
+ *((unsigned long *)&__m128i_result[0]) = 0x000000000001edde;
+ __m128i_out = __lsx_vdiv_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]) = 0x0000000015d926c7;
+ *((unsigned long *)&__m128i_op1[0]) = 0x000000000000e41b;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x77c0404a4000403a;
+ *((unsigned long *)&__m128i_op0[0]) = 0x77c03fd640003fc6;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0042003e0042002f;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0001fffc0001fffc;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0042003e0042002f;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0001fffc0001fffc;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000feff2356;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000fd165486;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000007;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000007;
+ *((unsigned long *)&__m128i_result[1]) = 0x00000000246d9755;
+ *((unsigned long *)&__m128i_result[0]) = 0x000000002427c2ee;
+ __m128i_out = __lsx_vdiv_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-vmod-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-1.c
new file mode 100644
index 000000000..5470d40dd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-1.c
@@ -0,0 +1,254 @@
+/* { 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]) = 0x82c539ffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xc72df14afbfafdf9;
+ *((unsigned long *)&__m128i_op1[1]) = 0x82c539ffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xc72df14afbfafdf9;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0xffffffff994cb09c;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffc3639d96;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0003c853c843c844;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0003c853c843c844;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x6363636363636363;
+ *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0001808281820102;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0001808201018081;
+ *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080;
+ *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001008281820102;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001008201010081;
+ __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0101010240010202;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_b (__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]) = 0xff00ff00ff00ff00;
+ *((unsigned long *)&__m128i_op1[0]) = 0xff00ff00ff00ff00;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0001000104000800;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0101080408040804;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0804080407040804;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000104000800;
+ __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1000100010001000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x1000100010001000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x1202120212021202;
+ *((unsigned long *)&__m128i_op1[0]) = 0x1202120212021202;
+ *((unsigned long *)&__m128i_result[1]) = 0x1000100010001000;
+ *((unsigned long *)&__m128i_result[0]) = 0x1000100010001000;
+ __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff00ff00ff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff;
+ *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffa;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000003;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003;
+ __m128i_out = __lsx_vmod_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]) = 0xfffffffffffffffc;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffc;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_h (__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]) = 0xf6548a1747e59090;
+ *((unsigned long *)&__m128i_op1[0]) = 0x27b169bbb8145f50;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec;
+ *((unsigned long *)&__m128i_op0[0]) = 0x370bdfeca2eb9931;
+ *((unsigned long *)&__m128i_op1[1]) = 0x370bdfecffecffec;
+ *((unsigned long *)&__m128i_op1[0]) = 0x370bdfeca2eb9931;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x805ffffe01001fe0;
+ *((unsigned long *)&__m128i_op0[0]) = 0x9a49e11102834d70;
+ *((unsigned long *)&__m128i_op1[1]) = 0x8144ffff01c820a4;
+ *((unsigned long *)&__m128i_op1[0]) = 0x9b2ee1a4034b4e34;
+ *((unsigned long *)&__m128i_result[1]) = 0xff1affff01001fe0;
+ *((unsigned long *)&__m128i_result[0]) = 0xff1aff6d02834d70;
+ __m128i_out = __lsx_vmod_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x001d001d001d001d;
+ *((unsigned long *)&__m128i_op0[0]) = 0x001d001d001d0000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x001d001d001d001d;
+ *((unsigned long *)&__m128i_op1[0]) = 0x001d001d001d0000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x000a000a000a000a;
+ *((unsigned long *)&__m128i_op1[0]) = 0x000a000a000a000a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x4f8000004f800000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x4f8000004f800000;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00ffff0000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00ffff000000ff00;
+ *((unsigned long *)&__m128i_op1[1]) = 0x03c0000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x03c0038000000380;
+ *((unsigned long *)&__m128i_result[1]) = 0x00ffff0000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x00ffff000000ff00;
+ __m128i_out = __lsx_vmod_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]) = 0x0000006f00001f0a;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000958affff995d;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x80000000307d0771;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0d8e36706ac02b9b;
+ *((unsigned long *)&__m128i_op1[1]) = 0x80000000307d0771;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0d8e36706ac02b9b;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000800000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000800000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x413e276583869d79;
+ *((unsigned long *)&__m128i_op1[0]) = 0x7f7f017f9d8726d3;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x000000000011ffee;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000000000dfff2;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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-vmod-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-2.c
new file mode 100644
index 000000000..8deb04427
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-2.c
@@ -0,0 +1,254 @@
+/* { 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]) = 0x16161616a16316b0;
+ *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363;
+ *((unsigned long *)&__m128i_op1[1]) = 0x16161616a16316b0;
+ *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_bu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000001fffffffe;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000001fffffffe;
+ *((unsigned long *)&__m128i_op1[1]) = 0x5a5a5a5a5b5a5b5a;
+ *((unsigned long *)&__m128i_op1[0]) = 0x5a5a5a5a5b5a5b5a;
+ *((unsigned long *)&__m128i_result[1]) = 0x00000001494b494a;
+ *((unsigned long *)&__m128i_result[0]) = 0x00000001494b494a;
+ __m128i_out = __lsx_vmod_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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0xd70b30c96ea9f4e8;
+ *((unsigned long *)&__m128i_op1[0]) = 0xa352bfac9269e0aa;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0xffffffffffffffeb;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffeb;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x7f801fa06451ef11;
+ *((unsigned long *)&__m128i_op1[0]) = 0x68bcf93435ed25ed;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000022666621;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffdd9999da;
+ *((unsigned long *)&__m128i_op1[1]) = 0x7f7f7f7f00107f04;
+ *((unsigned long *)&__m128i_op1[0]) = 0x7f0000fd7f0000fd;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000066621;
+ *((unsigned long *)&__m128i_result[0]) = 0x01ff00085e9900ab;
+ __m128i_out = __lsx_vmod_hu (__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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xefffdffff0009d3d;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000000000bd3d;
+ *((unsigned long *)&__m128i_result[0]) = 0x000000007fff0000;
+ __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000004870ba0;
+ *((unsigned long *)&__m128i_op1[1]) = 0x478b478b38031779;
+ *((unsigned long *)&__m128i_op1[0]) = 0x6b769e690fa1e119;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000004870ba0;
+ __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x2006454690d3de87;
+ *((unsigned long *)&__m128i_op0[0]) = 0x2006454690d3de87;
+ *((unsigned long *)&__m128i_op1[1]) = 0x2006454690d3de87;
+ *((unsigned long *)&__m128i_op1[0]) = 0x2006454690d3de87;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0002000200020002;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0002000200020002;
+ *((unsigned long *)&__m128i_op1[1]) = 0x02b010f881a281a2;
+ *((unsigned long *)&__m128i_op1[0]) = 0x27b169bbb8145f50;
+ *((unsigned long *)&__m128i_result[1]) = 0x0002000200020002;
+ *((unsigned long *)&__m128i_result[0]) = 0x0002000200020002;
+ __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffff100000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x000f000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_wu (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000fffe0000fffe;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffff00ffffff00;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffff00ffffff00;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000fffe0000fffe;
+ __m128i_out = __lsx_vmod_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]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x00ff00ff00ff00ff;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00ff00ff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_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]) = 0x0000000000000200;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000200;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_du (__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]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_du (__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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0001000101fd01fe;
+ *((unsigned long *)&__m128i_op1[1]) = 0xff80ff80ff80ff80;
+ *((unsigned long *)&__m128i_op1[0]) = 0xff80ff8080008000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000101fd01fe;
+ __m128i_out = __lsx_vmod_du (__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]) = 0xff2cfed4fea8ff44;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfffeffff0035ff8f;
+ *((unsigned long *)&__m128i_result[1]) = 0x00d3012acc56f9bb;
+ *((unsigned long *)&__m128i_result[0]) = 0x00000000000000a0;
+ __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x37c0001000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x37c0001000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0004000400040004;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0004000400040004;
+ *((unsigned long *)&__m128i_result[1]) = 0x0003c853c843c844;
+ *((unsigned long *)&__m128i_result[0]) = 0x0003c853c843c844;
+ __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000003ddc5dac;
+ *((unsigned long *)&__m128i_op1[1]) = 0xfcfcfcdcfcfcfcdc;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfcfcfcdcfcfcfcdc;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x000000003ddc5dac;
+ __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffffffefffff784;
+ *((unsigned long *)&__m128i_op1[1]) = 0x10f8000100000001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000001000010f8;
+ *((unsigned long *)&__m128i_result[1]) = 0x0177fff0fffffff0;
+ *((unsigned long *)&__m128i_result[0]) = 0x00000000011ff8bc;
+ __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/suwei1202/gcc.git
git@gitee.com:suwei1202/gcc.git
suwei1202
gcc
gcc
master

搜索帮助