1 Star 0 Fork 139

luofeng14/gcc

forked from src-openEuler/gcc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
LoongArch-Add-tests-for-SX-vector-vfmadd-vfnmadd-vld.patch 64.70 KB
一键复制 编辑 原始数据 按行查看 历史
ticat_fp 提交于 2024-03-26 09:26 . LoongArch: update from gcc upstream
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412
From 5cc6bce7753e1029149839d58ed81f046087ad31 Mon Sep 17 00:00:00 2001
From: Xiaolong Chen <chenxiaolong@loongson.cn>
Date: Tue, 12 Sep 2023 15:05:09 +0800
Subject: [PATCH 098/124] LoongArch: Add tests for SX vector
vfmadd/vfnmadd/vld/vst instructions.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/vector/lsx/lsx-vfmadd_d.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfmadd_s.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfnmadd_d.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfnmadd_s.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vld.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vst.c: New test.
Signed-off-by: Peng Fan <fanpeng@loongson.cn>
Signed-off-by: ticat_fp <fanpeng@loongson.cn>
---
.../loongarch/vector/lsx/lsx-vfmadd_d.c | 251 ++++++++++++
.../loongarch/vector/lsx/lsx-vfmadd_s.c | 381 ++++++++++++++++++
.../loongarch/vector/lsx/lsx-vfnmadd_d.c | 196 +++++++++
.../loongarch/vector/lsx/lsx-vfnmadd_s.c | 381 ++++++++++++++++++
.../gcc.target/loongarch/vector/lsx/lsx-vld.c | 62 +++
.../gcc.target/loongarch/vector/lsx/lsx-vst.c | 70 ++++
6 files changed, 1341 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_d.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_s.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_d.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_s.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vld.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vst.c
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_d.c
new file mode 100644
index 000000000..c5de1ac7a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_d.c
@@ -0,0 +1,251 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x8a228acac14e440a;
+ *((unsigned long *)&__m128d_op1[0]) = 0xc77c47cdc0f16549;
+ *((unsigned long *)&__m128d_op2[1]) = 0xffffffffd24271c4;
+ *((unsigned long *)&__m128d_op2[0]) = 0x2711bad1e8e309ed;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffd24271c4;
+ *((unsigned long *)&__m128d_result[0]) = 0x2711bad1e8e309ed;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op2[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op2[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000040400000383;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffe000ffff1fff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000040400000383;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffffe000ffff1fff;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000001000001;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0001000100000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000001000001;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffe000ffff1fff;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x00000000003f80b0;
+ *((unsigned long *)&__m128d_op1[0]) = 0x00000000ff800000;
+ *((unsigned long *)&__m128d_op2[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op2[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0080200000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000401000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000080000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000080000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000080000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000080000000000;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x000000000000001e;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0x7fff7fff7fff7fff;
+ *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[0]) = 0x3fff3fff3fff3fff;
+ *((unsigned long *)&__m128d_op2[1]) = 0xfffb00fdfdf7ffff;
+ *((unsigned long *)&__m128d_op2[0]) = 0xfff8000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xfffb00fdfdf7ffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xfff8000000000000;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000009000900;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000009000900;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000009000900;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000009000900;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000200000002;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000200000002;
+ *((unsigned long *)&__m128d_op2[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op2[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x9c83e21a22001818;
+ *((unsigned long *)&__m128d_op0[0]) = 0xdd3b8b02563b2d7b;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x7f7f7f007f7f7f00;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x7f7f7f007f7f7f00;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xff00e400ff00e400;
+ *((unsigned long *)&__m128d_op0[0]) = 0xff01e41ffff0ffff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x5555000054100000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x5555000154100155;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000;
+ __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000010;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000010;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x8000000000000010;
+ __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xfc01fcfefc02fdf7;
+ *((unsigned long *)&__m128d_op0[0]) = 0xfe00fcfffe01fd01;
+ *((unsigned long *)&__m128d_op1[1]) = 0xfc01fd1300000001;
+ *((unsigned long *)&__m128d_op1[0]) = 0xfe00fd1400010000;
+ *((unsigned long *)&__m128d_op2[1]) = 0xfc01fcfefc02fdf7;
+ *((unsigned long *)&__m128d_op2[0]) = 0xfe00fcfffe01fd01;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000;
+ __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000bd3d00000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0038d800ff000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x00fffe00fffffe00;
+ *((unsigned long *)&__m128d_op2[1]) = 0x8000008000008080;
+ *((unsigned long *)&__m128d_op2[0]) = 0x8080800000800080;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000008000008080;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x00ff80ff00ff80ff;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000900000009;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x000000007ff000ff;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffff7ffffffffe;
+ *((unsigned long *)&__m128d_op0[0]) = 0x00000000fffffffe;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffff7ffffffffe;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x67eb85afb2ebb000;
+ *((unsigned long *)&__m128d_op1[0]) = 0xc8847ef6ed3f2000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000100000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000103;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000100000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x8000000000000103;
+ __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_s.c
new file mode 100644
index 000000000..6b85e87bd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_s.c
@@ -0,0 +1,381 @@
+/* { 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;
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000002;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000002;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x0028e0a1;
+ *((int *)&__m128_op0[2]) = 0xa000a041;
+ *((int *)&__m128_op0[1]) = 0x01000041;
+ *((int *)&__m128_op0[0]) = 0x00010001;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x01000001;
+ *((int *)&__m128_op1[1]) = 0x00010001;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x01000001;
+ *((int *)&__m128_op2[1]) = 0xffffe000;
+ *((int *)&__m128_op2[0]) = 0xffff1fff;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x01000001;
+ *((int *)&__m128_result[1]) = 0xffffe000;
+ *((int *)&__m128_result[0]) = 0xffff1fff;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x7f800000;
+ *((int *)&__m128_op0[2]) = 0x7f800000;
+ *((int *)&__m128_op0[1]) = 0x7f800000;
+ *((int *)&__m128_op0[0]) = 0x7f800000;
+ *((int *)&__m128_op1[3]) = 0x00000002;
+ *((int *)&__m128_op1[2]) = 0x00000002;
+ *((int *)&__m128_op1[1]) = 0x00000003;
+ *((int *)&__m128_op1[0]) = 0x00000003;
+ *((int *)&__m128_op2[3]) = 0x3fc00000;
+ *((int *)&__m128_op2[2]) = 0x3fc00000;
+ *((int *)&__m128_op2[1]) = 0x3fc00000;
+ *((int *)&__m128_op2[0]) = 0x3fc00000;
+ *((int *)&__m128_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xc1bdceee;
+ *((int *)&__m128_op0[2]) = 0x242070db;
+ *((int *)&__m128_op0[1]) = 0xe8c7b756;
+ *((int *)&__m128_op0[0]) = 0xd76aa478;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x7f400000;
+ *((int *)&__m128_op0[2]) = 0x7f040000;
+ *((int *)&__m128_op0[1]) = 0x7f020000;
+ *((int *)&__m128_op0[0]) = 0x7f020000;
+ *((int *)&__m128_op1[3]) = 0xffffffff;
+ *((int *)&__m128_op1[2]) = 0x0014002c;
+ *((int *)&__m128_op1[1]) = 0xfffefffe;
+ *((int *)&__m128_op1[0]) = 0x003b0013;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0x3ea5016b;
+ *((int *)&__m128_result[1]) = 0xfffefffe;
+ *((int *)&__m128_result[0]) = 0x3f6fb04d;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x004f0080;
+ *((int *)&__m128_op0[2]) = 0x004f0080;
+ *((int *)&__m128_op0[1]) = 0x004f0080;
+ *((int *)&__m128_op0[0]) = 0x004f0080;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x7fff7fff;
+ *((int *)&__m128_op2[2]) = 0x7fff7fff;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x7fff7fff;
+ *((int *)&__m128_result[2]) = 0x7fff7fff;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x3d3d3d3d;
+ *((int *)&__m128_op0[2]) = 0x3d3d3d3d;
+ *((int *)&__m128_op0[1]) = 0x3d3d3d3d;
+ *((int *)&__m128_op0[0]) = 0x3d3d3d3d;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00100000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x0000bd3d;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00050005;
+ *((int *)&__m128_op1[2]) = 0x00050005;
+ *((int *)&__m128_op1[1]) = 0x00050005;
+ *((int *)&__m128_op1[0]) = 0x00050005;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xe500c085;
+ *((int *)&__m128_op0[2]) = 0xc000c005;
+ *((int *)&__m128_op0[1]) = 0xe5c1a185;
+ *((int *)&__m128_op0[0]) = 0xc48004c5;
+ *((int *)&__m128_op1[3]) = 0xffffffff;
+ *((int *)&__m128_op1[2]) = 0xffffffff;
+ *((int *)&__m128_op1[1]) = 0xffffc000;
+ *((int *)&__m128_op1[0]) = 0xffffc005;
+ *((int *)&__m128_op2[3]) = 0xff550025;
+ *((int *)&__m128_op2[2]) = 0x002a004b;
+ *((int *)&__m128_op2[1]) = 0x00590013;
+ *((int *)&__m128_op2[0]) = 0x005cffca;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0xffffc000;
+ *((int *)&__m128_result[0]) = 0xffffc005;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00fe0001;
+ *((int *)&__m128_op1[2]) = 0x00cf005f;
+ *((int *)&__m128_op1[1]) = 0x7fff7fff;
+ *((int *)&__m128_op1[0]) = 0x7fff7f00;
+ *((int *)&__m128_op2[3]) = 0x5d7f5d00;
+ *((int *)&__m128_op2[2]) = 0x7f6a007f;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x5d7f5d00;
+ *((int *)&__m128_result[2]) = 0x7f6a007f;
+ *((int *)&__m128_result[1]) = 0x7fff7fff;
+ *((int *)&__m128_result[0]) = 0x7fff7f00;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00680486;
+ *((int *)&__m128_op0[2]) = 0xffffffda;
+ *((int *)&__m128_op0[1]) = 0xffff913b;
+ *((int *)&__m128_op0[0]) = 0xb9951901;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x01030103;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00200060;
+ *((int *)&__m128_op2[0]) = 0x00200060;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0xffffffda;
+ *((int *)&__m128_result[1]) = 0xffff913b;
+ *((int *)&__m128_result[0]) = 0x001fed4d;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x001a001a;
+ *((int *)&__m128_op0[2]) = 0x001a0008;
+ *((int *)&__m128_op0[1]) = 0x001a001a;
+ *((int *)&__m128_op0[0]) = 0x001a000b;
+ *((int *)&__m128_op1[3]) = 0xffffffff;
+ *((int *)&__m128_op1[2]) = 0xffffffff;
+ *((int *)&__m128_op1[1]) = 0xff800001;
+ *((int *)&__m128_op1[0]) = 0x0f800000;
+ *((int *)&__m128_op2[3]) = 0xff800000;
+ *((int *)&__m128_op2[2]) = 0xff800000;
+ *((int *)&__m128_op2[1]) = 0xff800000;
+ *((int *)&__m128_op2[0]) = 0xff800000;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0xffc00001;
+ *((int *)&__m128_result[0]) = 0xff800000;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xfe3bfb01;
+ *((int *)&__m128_op0[2]) = 0xfe3bfe01;
+ *((int *)&__m128_op0[1]) = 0xfe03fe3f;
+ *((int *)&__m128_op0[0]) = 0xfe01fa21;
+ *((int *)&__m128_op1[3]) = 0xfe3bfb01;
+ *((int *)&__m128_op1[2]) = 0xfe3bfe01;
+ *((int *)&__m128_op1[1]) = 0xfe03fe3f;
+ *((int *)&__m128_op1[0]) = 0xfe01fa21;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xffffe001;
+ *((int *)&__m128_op0[2]) = 0xffffe001;
+ *((int *)&__m128_op0[1]) = 0xffffe001;
+ *((int *)&__m128_op0[0]) = 0xffffe001;
+ *((int *)&__m128_op1[3]) = 0xffffffff;
+ *((int *)&__m128_op1[2]) = 0xffffffff;
+ *((int *)&__m128_op1[1]) = 0xffffe000;
+ *((int *)&__m128_op1[0]) = 0x01ffe200;
+ *((int *)&__m128_op2[3]) = 0x04040383;
+ *((int *)&__m128_op2[2]) = 0x83838404;
+ *((int *)&__m128_op2[1]) = 0x04040383;
+ *((int *)&__m128_op2[0]) = 0x83838404;
+ *((int *)&__m128_result[3]) = 0xffffe001;
+ *((int *)&__m128_result[2]) = 0xffffe001;
+ *((int *)&__m128_result[1]) = 0xffffe001;
+ *((int *)&__m128_result[0]) = 0xffffe001;
+ __m128_out = __lsx_vfmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x18171615;
+ *((int *)&__m128_op0[2]) = 0x17161514;
+ *((int *)&__m128_op0[1]) = 0x16151413;
+ *((int *)&__m128_op0[0]) = 0x151d3756;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x39412488;
+ *((int *)&__m128_op1[0]) = 0x80000000;
+ *((int *)&__m128_op2[3]) = 0x3ff00000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x40f3fa00;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0xbff00000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0xc0f3fa00;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000005;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x3ddc5dac;
+ *((int *)&__m128_op1[3]) = 0xffffffff;
+ *((int *)&__m128_op1[2]) = 0xffffffff;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x63636b6a;
+ *((int *)&__m128_op0[2]) = 0xfe486741;
+ *((int *)&__m128_op0[1]) = 0x41f8e880;
+ *((int *)&__m128_op0[0]) = 0xffffffff;
+ *((int *)&__m128_op1[3]) = 0xe3636363;
+ *((int *)&__m128_op1[2]) = 0x63abdf16;
+ *((int *)&__m128_op1[1]) = 0x41f8e080;
+ *((int *)&__m128_op1[0]) = 0x16161198;
+ *((int *)&__m128_op2[3]) = 0x00c27580;
+ *((int *)&__m128_op2[2]) = 0x00bccf42;
+ *((int *)&__m128_op2[1]) = 0x00a975be;
+ *((int *)&__m128_op2[0]) = 0x00accf03;
+ *((int *)&__m128_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0x4471fb84;
+ *((int *)&__m128_result[0]) = 0xffffffff;
+ __m128_out = __lsx_vfmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_d.c
new file mode 100644
index 000000000..96b14aad6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_d.c
@@ -0,0 +1,196 @@
+/* { 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 *)&__m128d_op0[1]) = 0xef0179a47c793879;
+ *((unsigned long *)&__m128d_op0[0]) = 0x9f9e7e3e9ea3ff41;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x7fc000007fc00000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x1e801ffc7fc00000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffc000007fc00000;
+ *((unsigned long *)&__m128d_result[0]) = 0x9e801ffc7fc00000;
+ __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x3f8000003f800000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000ffff00000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000ffff00000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000ffff00000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x8000ffff00000000;
+ __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffbfffffffbf;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffbfffffffbf;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000008800022;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffffffff00000001;
+ *((unsigned long *)&__m128d_op2[1]) = 0xb8ec43befe38e64b;
+ *((unsigned long *)&__m128d_op2[0]) = 0x6477d042343cce24;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffbfffffffbf;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffbfffffffbf;
+ __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0xfffffffffffff000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000060000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfffffffffffff000;
+ __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xfffffffafffffffa;
+ *((unsigned long *)&__m128d_op0[0]) = 0xfffffffafffffffa;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op2[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0xf8f8f8f8f8f8f8f8;
+ *((unsigned long *)&__m128d_op1[0]) = 0xf8f8f8f8f8f8f8f8;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000;
+ __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000;
+ __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000008000000080;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000008000000080;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000;
+ __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xff80ffa2fff0ff74;
+ *((unsigned long *)&__m128d_op0[0]) = 0xff76ffd8ffe6ffaa;
+ *((unsigned long *)&__m128d_op1[1]) = 0xff80ffa2fff0ff74;
+ *((unsigned long *)&__m128d_op1[0]) = 0xff76ffd8ffe6ffaa;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0303030303030303;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0303030303030303;
+ *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000;
+ __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000;
+ __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000ffff0000ffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0001ffff00000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0001ffff0001ffff;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000;
+ __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128d_op0[0]) = 0xfffffffffffffffe;
+ *((unsigned long *)&__m128d_op1[1]) = 0xff800000ff800000;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x3c600000ff800000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfffffffffffffffe;
+ __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x000000000000000d;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x000000000000000d;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x00000000b5207f80;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x00000000b5207f80;
+ __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000009000900;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000009000900;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000;
+ __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x00c2758000bccf42;
+ *((unsigned long *)&__m128d_op0[0]) = 0x00a975be00accf03;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op2[0]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x00000000ffffffff;
+ __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_s.c
new file mode 100644
index 000000000..bf8414b49
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_s.c
@@ -0,0 +1,381 @@
+/* { 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;
+
+ *((int *)&__m128_op0[3]) = 0xffffffff;
+ *((int *)&__m128_op0[2]) = 0xffffffff;
+ *((int *)&__m128_op0[1]) = 0xfffffffe;
+ *((int *)&__m128_op0[0]) = 0xbe6ed565;
+ *((int *)&__m128_op1[3]) = 0x195f307a;
+ *((int *)&__m128_op1[2]) = 0x5d04acbb;
+ *((int *)&__m128_op1[1]) = 0x6a1a3fbb;
+ *((int *)&__m128_op1[0]) = 0x3c90260e;
+ *((int *)&__m128_op2[3]) = 0xffffffff;
+ *((int *)&__m128_op2[2]) = 0xffffffff;
+ *((int *)&__m128_op2[1]) = 0xfffffffe;
+ *((int *)&__m128_op2[0]) = 0xbe6ed565;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0xfffffffe;
+ *((int *)&__m128_result[0]) = 0x3e730941;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xffffffff;
+ *((int *)&__m128_op0[2]) = 0xffffffff;
+ *((int *)&__m128_op0[1]) = 0xffffffff;
+ *((int *)&__m128_op0[0]) = 0xff01ff01;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0xffffffff;
+ *((int *)&__m128_op2[2]) = 0xffffffff;
+ *((int *)&__m128_op2[1]) = 0xffffffff;
+ *((int *)&__m128_op2[0]) = 0xff01ff01;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0xffffffff;
+ *((int *)&__m128_result[0]) = 0x7f01ff01;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0xffffffff;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0xffffffff;
+ *((int *)&__m128_op2[3]) = 0x00307028;
+ *((int *)&__m128_op2[2]) = 0x003f80b0;
+ *((int *)&__m128_op2[1]) = 0x0040007f;
+ *((int *)&__m128_op2[0]) = 0xff800000;
+ *((int *)&__m128_result[3]) = 0x80307028;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0x8040007f;
+ *((int *)&__m128_result[0]) = 0xffffffff;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000049;
+ *((int *)&__m128_op0[2]) = 0x0000004d;
+ *((int *)&__m128_op0[1]) = 0x00000001;
+ *((int *)&__m128_op0[0]) = 0xffffffff;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000001;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000001;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x80000000;
+ *((int *)&__m128_result[2]) = 0x80000000;
+ *((int *)&__m128_result[1]) = 0x80000001;
+ *((int *)&__m128_result[0]) = 0xffffffff;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xffffffff;
+ *((int *)&__m128_op0[2]) = 0xffff0000;
+ *((int *)&__m128_op0[1]) = 0x00ff0000;
+ *((int *)&__m128_op0[0]) = 0x00ff0000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000800;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0xffffffff;
+ *((int *)&__m128_op2[2]) = 0xfffff800;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xfffff800;
+ *((int *)&__m128_result[1]) = 0x80000000;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x80000000;
+ *((int *)&__m128_result[2]) = 0x80000000;
+ *((int *)&__m128_result[1]) = 0x80000000;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00030000;
+ *((int *)&__m128_op0[2]) = 0x00010000;
+ *((int *)&__m128_op0[1]) = 0x00020000;
+ *((int *)&__m128_op0[0]) = 0x00010000;
+ *((int *)&__m128_op1[3]) = 0x3f800000;
+ *((int *)&__m128_op1[2]) = 0x3f800000;
+ *((int *)&__m128_op1[1]) = 0x3f800000;
+ *((int *)&__m128_op1[0]) = 0x3f800000;
+ *((int *)&__m128_op2[3]) = 0x00030000;
+ *((int *)&__m128_op2[2]) = 0x00010000;
+ *((int *)&__m128_op2[1]) = 0x00020000;
+ *((int *)&__m128_op2[0]) = 0x00010000;
+ *((int *)&__m128_result[3]) = 0x80060000;
+ *((int *)&__m128_result[2]) = 0x80020000;
+ *((int *)&__m128_result[1]) = 0x80040000;
+ *((int *)&__m128_result[0]) = 0x80020000;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000008;
+ *((int *)&__m128_op0[2]) = 0x97957687;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000408;
+ *((int *)&__m128_op1[3]) = 0x00000008;
+ *((int *)&__m128_op1[2]) = 0x97957687;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000408;
+ *((int *)&__m128_op2[3]) = 0x00010001;
+ *((int *)&__m128_op2[2]) = 0x00010001;
+ *((int *)&__m128_op2[1]) = 0x00010001;
+ *((int *)&__m128_op2[0]) = 0x04000800;
+ *((int *)&__m128_result[3]) = 0x80010001;
+ *((int *)&__m128_result[2]) = 0x80010001;
+ *((int *)&__m128_result[1]) = 0x80010001;
+ *((int *)&__m128_result[0]) = 0x84000800;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xffc2ffe7;
+ *((int *)&__m128_op0[2]) = 0x00000007;
+ *((int *)&__m128_op0[1]) = 0x0000ffc1;
+ *((int *)&__m128_op0[0]) = 0x00010001;
+ *((int *)&__m128_op1[3]) = 0xffc2ffe7;
+ *((int *)&__m128_op1[2]) = 0x00000007;
+ *((int *)&__m128_op1[1]) = 0x0000ffc1;
+ *((int *)&__m128_op1[0]) = 0x00010001;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x000ffc2f;
+ *((int *)&__m128_op2[1]) = 0x00201df0;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0xffc2ffe7;
+ *((int *)&__m128_result[2]) = 0x800ffc2f;
+ *((int *)&__m128_result[1]) = 0x80201df0;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x80000000;
+ *((int *)&__m128_result[2]) = 0x80000000;
+ *((int *)&__m128_result[1]) = 0x80000000;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000005;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x80000000;
+ *((int *)&__m128_result[2]) = 0x80000000;
+ *((int *)&__m128_result[1]) = 0x80000000;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x80808080;
+ *((int *)&__m128_op0[2]) = 0x80808080;
+ *((int *)&__m128_op0[1]) = 0x80808080;
+ *((int *)&__m128_op0[0]) = 0x80800008;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x80000000;
+ *((int *)&__m128_result[2]) = 0x80000000;
+ *((int *)&__m128_result[1]) = 0x80000000;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x31313131;
+ *((int *)&__m128_op0[0]) = 0x31313131;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x31313131;
+ *((int *)&__m128_op1[0]) = 0x31313131;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000008;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x80000000;
+ *((int *)&__m128_result[2]) = 0x80000008;
+ *((int *)&__m128_result[1]) = 0xa2f54a1e;
+ *((int *)&__m128_result[0]) = 0xa2f54a1e;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x80000000;
+ *((int *)&__m128_result[2]) = 0x80000000;
+ *((int *)&__m128_result[1]) = 0x80000000;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xa486c90f;
+ *((int *)&__m128_op0[2]) = 0x157ca12e;
+ *((int *)&__m128_op0[1]) = 0x58bcc201;
+ *((int *)&__m128_op0[0]) = 0x2e635d65;
+ *((int *)&__m128_op1[3]) = 0x6d564875;
+ *((int *)&__m128_op1[2]) = 0xf8760005;
+ *((int *)&__m128_op1[1]) = 0x8dc5a4d1;
+ *((int *)&__m128_op1[0]) = 0x79ffa22f;
+ *((int *)&__m128_op2[3]) = 0xffffffff;
+ *((int *)&__m128_op2[2]) = 0xd2436487;
+ *((int *)&__m128_op2[1]) = 0x0fa96b88;
+ *((int *)&__m128_op2[0]) = 0x5f94ab13;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xd24271c4;
+ *((int *)&__m128_result[1]) = 0x2711bad1;
+ *((int *)&__m128_result[0]) = 0xe8e309ed;
+ __m128_out = __lsx_vfnmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x00000000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x80000000;
+ *((int *)&__m128_result[2]) = 0x80000000;
+ *((int *)&__m128_result[1]) = 0x80000000;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfnmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x007ffd00;
+ *((int *)&__m128_op2[0]) = 0x01400840;
+ *((int *)&__m128_result[3]) = 0x80000000;
+ *((int *)&__m128_result[2]) = 0x80000000;
+ *((int *)&__m128_result[1]) = 0x007ffd00;
+ *((int *)&__m128_result[0]) = 0x01400840;
+ __m128_out = __lsx_vfnmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0x00000000;
+ *((int *)&__m128_op2[2]) = 0x00000000;
+ *((int *)&__m128_op2[1]) = 0x7f800000;
+ *((int *)&__m128_op2[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x80000000;
+ *((int *)&__m128_result[2]) = 0x80000000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfnmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_op2[3]) = 0xcd636363;
+ *((int *)&__m128_op2[2]) = 0xcd636363;
+ *((int *)&__m128_op2[1]) = 0xcd636363;
+ *((int *)&__m128_op2[0]) = 0xcd636363;
+ *((int *)&__m128_result[3]) = 0xcd636363;
+ *((int *)&__m128_result[2]) = 0xcd636363;
+ *((int *)&__m128_result[1]) = 0xcd636363;
+ *((int *)&__m128_result[0]) = 0xcd636363;
+ __m128_out = __lsx_vfnmsub_s (__m128_op0, __m128_op1, __m128_op2);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vld.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vld.c
new file mode 100644
index 000000000..7cd9abb7c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vld.c
@@ -0,0 +1,62 @@
+/* { 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]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_result[0]) = 0x3ab7a3fc47a5c31a;
+ __m128i_out = __lsx_vld ((unsigned long *)&__m128i_op0, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_result[0]) = 0x3ab7a3fc47a5c31a;
+ __m128i_out = __lsx_vldx ((unsigned long *)&__m128i_op0, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0xc3c3c3c3c3c3c3c3;
+ *((unsigned long *)&__m128i_result[0]) = 0xc3c3c3c3c3c3c3c3;
+ __m128i_out = __lsx_vldrepl_b ((unsigned long *)&__m128i_op0, 0x1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0xc31ac31ac31ac31a;
+ *((unsigned long *)&__m128i_result[0]) = 0xc31ac31ac31ac31a;
+ __m128i_out = __lsx_vldrepl_h ((unsigned long *)&__m128i_op0, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0x47a5c31a47a5c31a;
+ *((unsigned long *)&__m128i_result[0]) = 0x47a5c31a47a5c31a;
+ __m128i_out = __lsx_vldrepl_w ((unsigned long *)&__m128i_op0, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[0]) = 0x3ab7a3fc47a5c31a;
+ __m128i_out = __lsx_vldrepl_d ((unsigned long *)&__m128i_op0, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vst.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vst.c
new file mode 100644
index 000000000..8afdffa50
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vst.c
@@ -0,0 +1,70 @@
+/* { 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]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0;
+ *((unsigned long *)&__m128i_result[0]) = 0x0;
+ __lsx_vst (__m128i_op0, (unsigned long *)&__m128i_result, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_op0, __m128i_result);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0;
+ *((unsigned long *)&__m128i_result[0]) = 0x0;
+ __lsx_vstx (__m128i_op0, (unsigned long *)&__m128i_result, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_op0, __m128i_result);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0;
+ *((unsigned long *)&__m128i_result[0]) = 0x05;
+ *((unsigned long *)&__m128i_out[1]) = 0x0;
+ *((unsigned long *)&__m128i_out[0]) = 0x0;
+ __lsx_vstelm_b (__m128i_op0, (unsigned long *)&__m128i_out, 0x0, 0x8);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0;
+ *((unsigned long *)&__m128i_result[0]) = 0x5c05;
+ *((unsigned long *)&__m128i_out[1]) = 0x0;
+ *((unsigned long *)&__m128i_out[0]) = 0x0;
+ __lsx_vstelm_h (__m128i_op0, (unsigned long *)&__m128i_out, 0x0, 0x4);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0;
+ *((unsigned long *)&__m128i_result[0]) = 0xc9d85c05;
+ *((unsigned long *)&__m128i_out[1]) = 0x0;
+ *((unsigned long *)&__m128i_out[0]) = 0x0;
+ __lsx_vstelm_w (__m128i_op0, (unsigned long *)&__m128i_out, 0x0, 0x2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0;
+ *((unsigned long *)&__m128i_result[0]) = 0x1dcc4255c9d85c05;
+ *((unsigned long *)&__m128i_out[1]) = 0x0;
+ *((unsigned long *)&__m128i_out[0]) = 0x0;
+ __lsx_vstelm_d (__m128i_op0, (unsigned long *)&__m128i_out, 0x0, 0x1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/luofeng14/gcc.git
git@gitee.com:luofeng14/gcc.git
luofeng14
gcc
gcc
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385