1 Star 0 Fork 128

花花世界/gcc

forked from src-openEuler/gcc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
LoongArch-Add-tests-for-SX-vector-vand-vandi-vandn-v.patch 54.30 KB
一键复制 编辑 原始数据 按行查看 历史
ticat_fp 提交于 2024-03-26 09:26 . LoongArch: update from gcc upstream
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209
From ea0d56b6569735448905780fe8468c9b3c6aad14 Mon Sep 17 00:00:00 2001
From: Xiaolong Chen <chenxiaolong@loongson.cn>
Date: Mon, 11 Sep 2023 18:58:17 +0800
Subject: [PATCH 097/124] LoongArch: Add tests for SX vector
vand/vandi/vandn/vor/vori/vnor/ vnori/vxor/vxori instructions.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/vector/lsx/lsx-vand.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vandi.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vandn.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vnor.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vnori.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vor.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vori.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vorn.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vxor.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vxori.c: New test.
Signed-off-by: Peng Fan <fanpeng@loongson.cn>
Signed-off-by: ticat_fp <fanpeng@loongson.cn>
---
.../loongarch/vector/lsx/lsx-vand.c | 159 ++++++++++++++++
.../loongarch/vector/lsx/lsx-vandi.c | 67 +++++++
.../loongarch/vector/lsx/lsx-vandn.c | 129 +++++++++++++
.../loongarch/vector/lsx/lsx-vnor.c | 109 +++++++++++
.../loongarch/vector/lsx/lsx-vnori.c | 91 ++++++++++
.../gcc.target/loongarch/vector/lsx/lsx-vor.c | 169 ++++++++++++++++++
.../loongarch/vector/lsx/lsx-vori.c | 123 +++++++++++++
.../loongarch/vector/lsx/lsx-vorn.c | 109 +++++++++++
.../loongarch/vector/lsx/lsx-vxor.c | 79 ++++++++
.../loongarch/vector/lsx/lsx-vxori.c | 67 +++++++
10 files changed, 1102 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c
new file mode 100644
index 000000000..1597749b5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c
@@ -0,0 +1,159 @@
+/* { 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_vand_v(__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]) = 0x03574e3a62407e03;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000000001010000;
+ *((unsigned long*)& __m128i_result[1]) = 0x03574e3a62407e03;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vand_v(__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]) = 0x001fffff001fffff;
+ *((unsigned long*)& __m128i_op1[0]) = 0x001fffff001fffff;
+ *((unsigned long*)& __m128i_result[1]) = 0x001fffff001fffff;
+ *((unsigned long*)& __m128i_result[0]) = 0x001fffff001fffff;
+ __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x00000000003dffc2;
+ *((unsigned long*)& __m128i_op0[0]) = 0x00000000003dffc2;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0008000000000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vand_v(__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_vand_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x00000000ffff53d9;
+ *((unsigned long*)& __m128i_op0[0]) = 0xffff0001ffff9515;
+ *((unsigned long*)& __m128i_op1[1]) = 0x00000000ffff53d9;
+ *((unsigned long*)& __m128i_op1[0]) = 0xffff0001ffff9515;
+ *((unsigned long*)& __m128i_result[1]) = 0x00000000ffff53d9;
+ *((unsigned long*)& __m128i_result[0]) = 0xffff0001ffff9515;
+ __m128i_out = __lsx_vand_v(__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_vand_v(__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]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vand_v(__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_vand_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x67eb85af0000b000;
+ *((unsigned long*)& __m128i_op0[0]) = 0xc8847ef6ed3f2000;
+ *((unsigned long*)& __m128i_op1[1]) = 0x67eb85af0000b000;
+ *((unsigned long*)& __m128i_op1[0]) = 0xc8847ef6ed3f2000;
+ *((unsigned long*)& __m128i_result[1]) = 0x67eb85af0000b000;
+ *((unsigned long*)& __m128i_result[0]) = 0xc8847ef6ed3f2000;
+ __m128i_out = __lsx_vand_v(__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_vand_v(__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]) = 0x0313100003131000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0313100003131000;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000200000002;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0007000000050000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0003000100010001;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x00007a8000000480;
+ *((unsigned long*)& __m128i_op0[0]) = 0x00000485000004cc;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0a0000000a000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0a0000000a000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c
new file mode 100644
index 000000000..906da69ca
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c
@@ -0,0 +1,67 @@
+/* { 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_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vandi_b(__m128i_op0,0x36);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000800;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000800;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vandi_b(__m128i_op0,0x39);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vandi_b(__m128i_op0,0x27);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vandi_b(__m128i_op0,0x25);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vandi_b(__m128i_op0,0xbd);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000a95afc60a5c5;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000b6e414157f84;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000204264602444;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000266404046604;
+ __m128i_out = __lsx_vandi_b(__m128i_op0,0x66);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c
new file mode 100644
index 000000000..3ae2d7694
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c
@@ -0,0 +1,129 @@
+/* { 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]) = 0x000000017fff9000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000000210011084;
+ *((unsigned long*)& __m128i_result[1]) = 0x000000017fff9000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000210011084;
+ __m128i_out = __lsx_vandn_v(__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_vandn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000100000000;
+ *((unsigned long*)& __m128i_op1[1]) = 0x00000049000000c0;
+ *((unsigned long*)& __m128i_op1[0]) = 0x00000001ffffff29;
+ *((unsigned long*)& __m128i_result[1]) = 0x00000049000000c0;
+ *((unsigned long*)& __m128i_result[0]) = 0x00000000ffffff29;
+ __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x010f00000111fffc;
+ *((unsigned long*)& __m128i_op0[0]) = 0x016700dc0176003a;
+ *((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_vandn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0003000000010000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0002000000010000;
+ *((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_vandn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x8000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0xfffffffffffff000;
+ *((unsigned long*)& __m128i_op1[1]) = 0x8000000000000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0xfffffffffffff000;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vandn_v(__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]) = 0x62cbf96e4acfaf40;
+ *((unsigned long*)& __m128i_op1[0]) = 0xf0bc9a5278285a4a;
+ *((unsigned long*)& __m128i_result[1]) = 0x62cbf96e4acfaf40;
+ *((unsigned long*)& __m128i_result[0]) = 0xf0bc9a5278285a4a;
+ __m128i_out = __lsx_vandn_v(__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_vandn_v(__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_vandn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0xfffe0004fffe0004;
+ *((unsigned long*)& __m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x9c7c266e71768fa4;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x9c7c266e71768fa4;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c
new file mode 100644
index 000000000..a7a3acce9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c
@@ -0,0 +1,109 @@
+/* { 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]) = 0x00000000fff8fff8;
+ *((unsigned long*)& __m128i_op1[0]) = 0x00000000fff80000;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffff00070007;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffff0007ffff;
+ __m128i_out = __lsx_vnor_v(__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_vnor_v(__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_vnor_v(__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]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0xce23d33e43d9736c;
+ *((unsigned long*)& __m128i_op0[0]) = 0x63b2ac27aa076aeb;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x31dc2cc1bc268c93;
+ *((unsigned long*)& __m128i_result[0]) = 0x9c4d53d855f89514;
+ __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x000000000000000c;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xfffffffffffffff3;
+ __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000400080003fff;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000bc2000007e04;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0000400080003fff;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000bc2000007e04;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffbfff7fffc000;
+ *((unsigned long*)& __m128i_result[0]) = 0xffff43dfffff81fb;
+ __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x021b7d24c9678a35;
+ *((unsigned long*)& __m128i_op0[0]) = 0x030298a6a1030a49;
+ *((unsigned long*)& __m128i_op1[1]) = 0x5252525252525252;
+ *((unsigned long*)& __m128i_op1[0]) = 0x5252525252525252;
+ *((unsigned long*)& __m128i_result[1]) = 0xada4808924882588;
+ *((unsigned long*)& __m128i_result[0]) = 0xacad25090caca5a4;
+ __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0xfffefffe0000ff18;
+ *((unsigned long*)& __m128i_op1[1]) = 0xffff000000000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x00000000ffffffff;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000ffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0x0001000100000000;
+ __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c
new file mode 100644
index 000000000..a07a02ab2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c
@@ -0,0 +1,91 @@
+/* { 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]) = 0x00000000ffff0000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x00000000ffff0000;
+ *((unsigned long*)& __m128i_result[1]) = 0xcccccccc0000cccc;
+ *((unsigned long*)& __m128i_result[0]) = 0xcccccccc0000cccc;
+ __m128i_out = __lsx_vnori_b(__m128i_op0,0x33);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vnori_b(__m128i_op0,0xa6);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x3e035e51522f0799;
+ *((unsigned long*)& __m128i_result[1]) = 0x9292929292929292;
+ *((unsigned long*)& __m128i_result[0]) = 0x8090808280909002;
+ __m128i_out = __lsx_vnori_b(__m128i_op0,0x6d);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x00000000000ffc2f;
+ *((unsigned long*)& __m128i_op0[0]) = 0x00201df000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x3838383838300010;
+ *((unsigned long*)& __m128i_result[0]) = 0x3818200838383838;
+ __m128i_out = __lsx_vnori_b(__m128i_op0,0xc7);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x2020202020202020;
+ *((unsigned long*)& __m128i_op0[0]) = 0x2020202020207f7f;
+ *((unsigned long*)& __m128i_result[1]) = 0x5d5d5d5d5d5d5d5d;
+ *((unsigned long*)& __m128i_result[0]) = 0x5d5d5d5d5d5d0000;
+ __m128i_out = __lsx_vnori_b(__m128i_op0,0xa2);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x8080808080808080;
+ *((unsigned long*)& __m128i_result[0]) = 0x8080808080808080;
+ __m128i_out = __lsx_vnori_b(__m128i_op0,0x7f);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x8080808080808080;
+ *((unsigned long*)& __m128i_op0[0]) = 0x8080808080808080;
+ *((unsigned long*)& __m128i_result[1]) = 0x1313131313131313;
+ *((unsigned long*)& __m128i_result[0]) = 0x1313131313131313;
+ __m128i_out = __lsx_vnori_b(__m128i_op0,0xec);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x9d9d9d9d9d9d9d9d;
+ *((unsigned long*)& __m128i_result[0]) = 0x9d9d9d9d9d9d9d9d;
+ __m128i_out = __lsx_vnori_b(__m128i_op0,0x62);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x00f525682ffd27f2;
+ *((unsigned long*)& __m128i_op0[0]) = 0x00365c60317ff930;
+ *((unsigned long*)& __m128i_result[1]) = 0xe500c085c000c005;
+ *((unsigned long*)& __m128i_result[0]) = 0xe5c1a185c48004c5;
+ __m128i_out = __lsx_vnori_b(__m128i_op0,0x1a);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c
new file mode 100644
index 000000000..537a1bb3b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c
@@ -0,0 +1,169 @@
+/* { 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]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_op1[1]) = 0x7e44bde9b842ff23;
+ *((unsigned long*)& __m128i_op1[0]) = 0x00011e80007edff8;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vor_v(__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_vor_v(__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]) = 0x0000000000000001;
+ *((unsigned long*)& __m128i_op1[0]) = 0xfffc001fffffffff;
+ *((unsigned long*)& __m128i_result[1]) = 0x00000000ffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xfffc001fffffffff;
+ __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000200010;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000000000200010;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000200010;
+ __m128i_out = __lsx_vor_v(__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_vor_v(__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]) = 0x4f804f804f804f80;
+ *((unsigned long*)& __m128i_op1[0]) = 0x4f804f804f804f80;
+ *((unsigned long*)& __m128i_result[1]) = 0x4f804f804f804f80;
+ *((unsigned long*)& __m128i_result[0]) = 0x4f804f804f804f80;
+ __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x3e035e51522f0799;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x3e035e51522f0799;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x3e035e51522f0799;
+ __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0xffff0000ffff0000;
+ *((unsigned long*)& __m128i_op0[0]) = 0xffff000000000000;
+ *((unsigned long*)& __m128i_op1[1]) = 0xffff0000ffff0000;
+ *((unsigned long*)& __m128i_op1[0]) = 0xffff000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0xffff0000ffff0000;
+ *((unsigned long*)& __m128i_result[0]) = 0xffff000000000000;
+ __m128i_out = __lsx_vor_v(__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]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffff00000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0xfffb00fdfdf7ffff;
+ *((unsigned long*)& __m128i_op0[0]) = 0xfff8000000000000;
+ *((unsigned long*)& __m128i_op1[1]) = 0xfffb00fdfdf7ffff;
+ *((unsigned long*)& __m128i_op1[0]) = 0xfff8000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0xfffb00fdfdf7ffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xfff8000000000000;
+ __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0xffffffff80005613;
+ *((unsigned long*)& __m128i_op0[0]) = 0x81000080806b000b;
+ *((unsigned long*)& __m128i_op1[1]) = 0xffff00011cf0c569;
+ *((unsigned long*)& __m128i_op1[0]) = 0xc0000002b0995850;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffff9cf0d77b;
+ *((unsigned long*)& __m128i_result[0]) = 0xc1000082b0fb585b;
+ __m128i_out = __lsx_vor_v(__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]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x80808080806b000b;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0xfffffffffffbfffb;
+ __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0001000101010001;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0001000100010001;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0000ffff0000ffff;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000ffff0000ffff;
+ *((unsigned long*)& __m128i_result[1]) = 0x0001ffff0101ffff;
+ *((unsigned long*)& __m128i_result[0]) = 0x0001ffff0001ffff;
+ __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0xffffffffc105d1aa;
+ *((unsigned long*)& __m128i_op0[0]) = 0xffffffffbc19ecca;
+ *((unsigned long*)& __m128i_op1[1]) = 0xc0b4d1a5f8babad3;
+ *((unsigned long*)& __m128i_op1[0]) = 0xbbc8ecc5f3ced5f3;
+ *((unsigned long*)& __m128i_result[1]) = 0xfffffffff9bffbfb;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffffffdffdfb;
+ __m128i_out = __lsx_vor_v(__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_vor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c
new file mode 100644
index 000000000..8a6e035c9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c
@@ -0,0 +1,123 @@
+/* { 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_result[1]) = 0x8282828282828282;
+ *((unsigned long*)& __m128i_result[0]) = 0x8282828282828282;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x82);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x7505853d654185f5;
+ *((unsigned long*)& __m128i_op0[0]) = 0x01010000fefe0101;
+ *((unsigned long*)& __m128i_result[1]) = 0x7545c57d6541c5f5;
+ *((unsigned long*)& __m128i_result[0]) = 0x41414040fefe4141;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x40);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000c2f90000bafa;
+ *((unsigned long*)& __m128i_op0[0]) = 0x8000c2fa8000c2fa;
+ *((unsigned long*)& __m128i_result[1]) = 0x7474f6fd7474fefe;
+ *((unsigned long*)& __m128i_result[0]) = 0xf474f6fef474f6fe;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x74);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x3d3d3d3d3d3d3d3d;
+ *((unsigned long*)& __m128i_result[0]) = 0x3d3d3d3d3d3d3d3d;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x3d);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0xfffffacdb6dbecac;
+ *((unsigned long*)& __m128i_op0[0]) = 0x1f5533a694f902c0;
+ *((unsigned long*)& __m128i_result[1]) = 0xfffffadffedbfefe;
+ *((unsigned long*)& __m128i_result[0]) = 0x5f5f7bfedefb5ada;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x5a);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x38);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0d1202e19235e2bc;
+ *((unsigned long*)& __m128i_op0[0]) = 0xea38e0f75f6e56d1;
+ *((unsigned long*)& __m128i_result[1]) = 0x2f3626e7b637e6be;
+ *((unsigned long*)& __m128i_result[0]) = 0xee3ee6f77f6e76f7;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x26);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0003c853c843c87e;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0003c853c843c87e;
+ *((unsigned long*)& __m128i_result[1]) = 0xd6d7ded7ded7defe;
+ *((unsigned long*)& __m128i_result[0]) = 0xd6d7ded7ded7defe;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0xd6);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0xfffe0000fffe0000;
+ *((unsigned long*)& __m128i_result[1]) = 0x7777777777777777;
+ *((unsigned long*)& __m128i_result[0]) = 0xffff7777ffff7777;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x77);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x55);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x8000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x8000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0xd454545454545454;
+ *((unsigned long*)& __m128i_result[0]) = 0xd454545454545454;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x54);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x4f4f4f4f4f4f4f4f;
+ *((unsigned long*)& __m128i_result[0]) = 0x4f4f4f4f4f4f4f4f;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x4f);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x8a8a8a8a8a8a8a8a;
+ *((unsigned long*)& __m128i_result[0]) = 0x8a8a8a8a8a8a8a8a;
+ __m128i_out = __lsx_vori_b(__m128i_op0,0x8a);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c
new file mode 100644
index 000000000..bb59bc312
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c
@@ -0,0 +1,109 @@
+/* { 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]) = 0x0001000100010001;
+ *((unsigned long*)& __m128i_op0[0]) = 0x000100010001fffe;
+ *((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_vorn_v(__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]) = 0x00d3012b015700bb;
+ *((unsigned long*)& __m128i_op1[0]) = 0x00010000ffca0070;
+ *((unsigned long*)& __m128i_result[1]) = 0xff2cfed4fea8ff44;
+ *((unsigned long*)& __m128i_result[0]) = 0xfffeffff0035ff8f;
+ __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x00fe00fe00fe00fe;
+ *((unsigned long*)& __m128i_op0[0]) = 0x00fe00fe00fe0045;
+ *((unsigned long*)& __m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[1]) = 0x00fe00fe00fe00fe;
+ *((unsigned long*)& __m128i_result[0]) = 0x00fe00fe00fe0045;
+ __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000010000010101;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0101000001000100;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0000010000010101;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0101000001000100;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vorn_v(__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]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000002;
+ *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000002;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x33f5c2d7d975d7fe;
+ *((unsigned long*)& __m128i_op0[0]) = 0xe4423f7b769f8ffe;
+ *((unsigned long*)& __m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x33f5c2d7d975d7fe;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x00050eb00000fffa;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000f8a50000f310;
+ *((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_vorn_v(__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]) = 0x0001000100010012;
+ *((unsigned long*)& __m128i_op1[0]) = 0x00000000ffe1ffc0;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_result[0]) = 0xffffffff009ff83f;
+ __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c
new file mode 100644
index 000000000..72fa97174
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c
@@ -0,0 +1,79 @@
+/* { 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]) = 0x00000000f4012ceb;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x00000000f4012ceb;
+ __m128i_out = __lsx_vxor_v(__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_vxor_v(__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_vxor_v(__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]) = 0x0000000000000001;
+ *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x3ff0000000000001;
+ *((unsigned long*)& __m128i_result[0]) = 0x40f3fa0000000000;
+ __m128i_out = __lsx_vxor_v(__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]) = 0x0000000080000068;
+ *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[0]) = 0x0000000080000068;
+ __m128i_out = __lsx_vxor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x00000000ffff53d9;
+ *((unsigned long*)& __m128i_op0[0]) = 0xff000001ffff9515;
+ *((unsigned long*)& __m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long*)& __m128i_op1[0]) = 0xffff0001ffff9514;
+ *((unsigned long*)& __m128i_result[1]) = 0xffffffff0000ac26;
+ *((unsigned long*)& __m128i_result[0]) = 0x00ff000000000001;
+ __m128i_out = __lsx_vxor_v(__m128i_op0,__m128i_op1);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c
new file mode 100644
index 000000000..cc823d4ba
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c
@@ -0,0 +1,67 @@
+/* { 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_result[1]) = 0x0404040404040404;
+ *((unsigned long*)& __m128i_result[0]) = 0x0404040404040404;
+ __m128i_out = __lsx_vxori_b(__m128i_op0,0x4);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000001000100;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000001000100;
+ *((unsigned long*)& __m128i_result[1]) = 0x5a5a5a5a5b5a5b5a;
+ *((unsigned long*)& __m128i_result[0]) = 0x5a5a5a5a5b5a5b5a;
+ __m128i_out = __lsx_vxori_b(__m128i_op0,0x5a);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0xe3e3e3e3e3e3e3e3;
+ *((unsigned long*)& __m128i_result[0]) = 0xe3e3e3e3e3e3e3e3;
+ __m128i_out = __lsx_vxori_b(__m128i_op0,0xe3);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0020002000200020;
+ *((unsigned long*)& __m128i_result[1]) = 0x9a9a9a9a9a9a9a9a;
+ *((unsigned long*)& __m128i_result[0]) = 0x9aba9aba9aba9aba;
+ __m128i_out = __lsx_vxori_b(__m128i_op0,0x9a);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long*)& __m128i_result[1]) = 0x9090909090909090;
+ *((unsigned long*)& __m128i_result[0]) = 0x9090909090909090;
+ __m128i_out = __lsx_vxori_b(__m128i_op0,0x90);
+ ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out);
+
+
+ *((unsigned long*)& __m128i_op0[1]) = 0x00000000b81c8382;
+ *((unsigned long*)& __m128i_op0[0]) = 0x0000000077af9450;
+ *((unsigned long*)& __m128i_result[1]) = 0xf1f1f1f149ed7273;
+ *((unsigned long*)& __m128i_result[0]) = 0xf1f1f1f1865e65a1;
+ __m128i_out = __lsx_vxori_b(__m128i_op0,0xf1);
+ 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

搜索帮助