加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
LoongArch-Add-tests-for-SX-vector-floating-point-ari.patch 130.21 KB
一键复制 编辑 原始数据 按行查看 历史
ticat_fp 提交于 2024-03-26 09:26 . LoongArch: update from gcc upstream
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928
From 4ccb21b6d2d23046c6a71c4540a1eb288609f041 Mon Sep 17 00:00:00 2001
From: Xiaolong Chen <chenxiaolong@loongson.cn>
Date: Tue, 12 Sep 2023 11:25:20 +0800
Subject: [PATCH 093/124] LoongArch: Add tests for SX vector floating point
arithmetic instructions.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/vector/lsx/lsx-vfadd_d.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfadd_s.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfclass_d.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfclass_s.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vflogb_d.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vflogb_s.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfmax_d.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfmax_s.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfmaxa_d.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfmaxa_s.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfsqrt_d.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vfsqrt_s.c: New test.
Signed-off-by: Peng Fan <fanpeng@loongson.cn>
Signed-off-by: ticat_fp <fanpeng@loongson.cn>
---
.../loongarch/vector/lsx/lsx-vfadd_d.c | 407 +++++++++++++++
.../loongarch/vector/lsx/lsx-vfadd_s.c | 470 ++++++++++++++++++
.../loongarch/vector/lsx/lsx-vfclass_d.c | 83 ++++
.../loongarch/vector/lsx/lsx-vfclass_s.c | 74 +++
.../loongarch/vector/lsx/lsx-vflogb_d.c | 76 +++
.../loongarch/vector/lsx/lsx-vflogb_s.c | 185 +++++++
.../loongarch/vector/lsx/lsx-vfmax_d.c | 200 ++++++++
.../loongarch/vector/lsx/lsx-vfmax_s.c | 335 +++++++++++++
.../loongarch/vector/lsx/lsx-vfmaxa_d.c | 155 ++++++
.../loongarch/vector/lsx/lsx-vfmaxa_s.c | 230 +++++++++
.../loongarch/vector/lsx/lsx-vfsqrt_d.c | 216 ++++++++
.../loongarch/vector/lsx/lsx-vfsqrt_s.c | 372 ++++++++++++++
12 files changed, 2803 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_d.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_s.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_d.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_s.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_d.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_s.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_d.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_s.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_d.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_s.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_d.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_s.c
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_d.c
new file mode 100644
index 000000000..7ffbd385e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_d.c
@@ -0,0 +1,407 @@
+/* { 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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x00000000fea8ff44;
+ *((unsigned long *)&__m128d_op1[1]) = 0x2020202020202020;
+ *((unsigned long *)&__m128d_op1[0]) = 0x2020202020202020;
+ *((unsigned long *)&__m128d_result[1]) = 0x2020202020202020;
+ *((unsigned long *)&__m128d_result[0]) = 0x2020202020202020;
+ __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x1000100010001000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x1000100010001000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x1000100010001000;
+ *((unsigned long *)&__m128d_result[0]) = 0x1000100010001000;
+ __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1);
+ 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]) = 0x000000000000000f;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x000000000000000f;
+ __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000010100fe0101;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffff0200ffff01ff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000ffffffffffff;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000ffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0x0001010100fe0100;
+ *((unsigned long *)&__m128d_result[0]) = 0xffff0200ffff01ff;
+ __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x7fff0101ffffe000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x7fffffffa0204000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x7f370101ff04ffff;
+ *((unsigned long *)&__m128d_op1[0]) = 0x7f3bffffa0226021;
+ *((unsigned long *)&__m128d_result[1]) = 0x7fff0101ffffe000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7fffffffa0204000;
+ __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000ebd20000714f;
+ *((unsigned long *)&__m128d_op0[0]) = 0x00012c8a0000a58a;
+ *((unsigned long *)&__m128d_op1[1]) = 0xf654ad7447e59090;
+ *((unsigned long *)&__m128d_op1[0]) = 0x27b1b106b8145f50;
+ *((unsigned long *)&__m128d_result[1]) = 0xf654ad7447e59090;
+ *((unsigned long *)&__m128d_result[0]) = 0x27b1b106b8145f50;
+ __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000001300000013;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000001300000013;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000100000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x1000100000001000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000100000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x1000100000001000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0010001000100010;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000007000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x01533b5e7489ae24;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffab7e71e33848;
+ *((unsigned long *)&__m128d_op1[1]) = 0x01533b5e7489ae24;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffffab7e71e33848;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffab7e71e33848;
+ __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x000000ff000000ff;
+ *((unsigned long *)&__m128d_op1[0]) = 0x000000ff000000ff;
+ *((unsigned long *)&__m128d_result[1]) = 0x800000ff000000ff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x00000000fff8fff8;
+ *((unsigned long *)&__m128d_op1[0]) = 0x00000000fff80000;
+ *((unsigned long *)&__m128d_result[1]) = 0x80000000fff8fff8;
+ *((unsigned long *)&__m128d_result[0]) = 0x80000000fff80000;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x00000001fffffffe;
+ *((unsigned long *)&__m128d_op0[0]) = 0x00000001fffffffe;
+ *((unsigned long *)&__m128d_op1[1]) = 0xb55ccf30f52a6a68;
+ *((unsigned long *)&__m128d_op1[0]) = 0x4e0018eceb82c53a;
+ *((unsigned long *)&__m128d_result[1]) = 0x355ccf30f52a6a68;
+ *((unsigned long *)&__m128d_result[0]) = 0xce0018eceb82c53a;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffff00006c82;
+ *((unsigned long *)&__m128d_op0[0]) = 0x00009b140000917b;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffff00006c82;
+ *((unsigned long *)&__m128d_result[0]) = 0x00009b140000917b;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000100000020;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000083b00000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xe93d0bd19ff0c170;
+ *((unsigned long *)&__m128d_op0[0]) = 0x5237c1bac9eadf55;
+ *((unsigned long *)&__m128d_op1[1]) = 0xe6d4572c8a5835bc;
+ *((unsigned long *)&__m128d_op1[0]) = 0xe5017c2ac9ca9fd0;
+ *((unsigned long *)&__m128d_result[1]) = 0xe93d0bd19ff07013;
+ *((unsigned long *)&__m128d_result[0]) = 0x65017c2ac9ca9fd0;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xe93d0bd19ff07013;
+ *((unsigned long *)&__m128d_op0[0]) = 0x65017c2ac9ca9fd0;
+ *((unsigned long *)&__m128d_op1[1]) = 0x00008bf700017052;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000f841000091aa;
+ *((unsigned long *)&__m128d_result[1]) = 0xe93d0bd19ff07013;
+ *((unsigned long *)&__m128d_result[0]) = 0x65017c2ac9ca9fd0;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x00000001ca02f854;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x00000001ca02f854;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000004000000002;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x5555410154551515;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0004455501500540;
+ *((unsigned long *)&__m128d_result[1]) = 0xd555410154551515;
+ *((unsigned long *)&__m128d_result[0]) = 0x8004455501500540;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000005;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x000300037ff000ff;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0003000300a10003;
+ *((unsigned long *)&__m128d_op1[1]) = 0x000000007ff000ff;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0003000300000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0003000300a10003;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x56a09e662ab46b31;
+ *((unsigned long *)&__m128d_op1[0]) = 0xb4b8122ef4054bb3;
+ *((unsigned long *)&__m128d_result[1]) = 0xd6a09e662ab46b31;
+ *((unsigned long *)&__m128d_result[0]) = 0x34b8122ef4054bb3;
+ __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1);
+ 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]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff8000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x7f4000007f040000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x7f0200007f020000;
+ *((unsigned long *)&__m128d_op1[1]) = 0xfffffffff8f8dada;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffffffff01018888;
+ *((unsigned long *)&__m128d_result[1]) = 0xfffffffff8f8dada;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffff01018888;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x8000000080000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x8000000080000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000100007f01;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffefefffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000020;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0400000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffefefffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x7ff8000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x00000000ff801c9e;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000810000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x000000000000ffff;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x40eff02383e383e4;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0xc8847ef6ed3f2000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0001000000010000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000cd630000cd63;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffff00000000ffff;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xffff00000000ffff;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x000aa822a79308f6;
+ *((unsigned long *)&__m128d_op1[0]) = 0x03aa558e1d37b5a1;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xfffffffefffffffe;
+ *((unsigned long *)&__m128d_op0[0]) = 0xfffffffefffffffe;
+ *((unsigned long *)&__m128d_op1[1]) = 0xfffefffefffefffe;
+ *((unsigned long *)&__m128d_op1[0]) = 0xfffefffe011df03e;
+ *((unsigned long *)&__m128d_result[1]) = 0xfffffffefffffffe;
+ *((unsigned long *)&__m128d_result[0]) = 0xfffffffefffffffe;
+ __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_s.c
new file mode 100644
index 000000000..388430278
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_s.c
@@ -0,0 +1,470 @@
+/* { 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]) = 0x05050505;
+ *((int *)&__m128_op0[2]) = 0x05050505;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x05050000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x03574e38;
+ *((int *)&__m128_op1[0]) = 0xe496cbc9;
+ *((int *)&__m128_result[3]) = 0x05050505;
+ *((int *)&__m128_result[2]) = 0x05050505;
+ *((int *)&__m128_result[1]) = 0x03574e38;
+ *((int *)&__m128_result[0]) = 0xe496cbc9;
+ __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1);
+ 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]) = 0x0000000f;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00077f88;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00077f97;
+ __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x000000ff;
+ *((int *)&__m128_op0[0]) = 0x000000ff;
+ *((int *)&__m128_op1[3]) = 0x370bdfec;
+ *((int *)&__m128_op1[2]) = 0xffecffec;
+ *((int *)&__m128_op1[1]) = 0x370bdfec;
+ *((int *)&__m128_op1[0]) = 0xffecffec;
+ *((int *)&__m128_result[3]) = 0x370bdfec;
+ *((int *)&__m128_result[2]) = 0xffecffec;
+ *((int *)&__m128_result[1]) = 0x370bdfec;
+ *((int *)&__m128_result[0]) = 0xffecffec;
+ __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1);
+ 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]) = 0xffffffff;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x0000ff00;
+ *((int *)&__m128_op1[0]) = 0x00ff0000;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0xffffffff;
+ *((int *)&__m128_result[0]) = 0xffffffff;
+ __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xffff0000;
+ *((int *)&__m128_op0[2]) = 0xffff0000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x40088040;
+ *((int *)&__m128_op1[2]) = 0x80040110;
+ *((int *)&__m128_op1[1]) = 0x40408010;
+ *((int *)&__m128_op1[0]) = 0x80200110;
+ *((int *)&__m128_result[3]) = 0xffff0000;
+ *((int *)&__m128_result[2]) = 0xffff0000;
+ *((int *)&__m128_result[1]) = 0x40408010;
+ *((int *)&__m128_result[0]) = 0x80200110;
+ __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1);
+ 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]) = 0xffffffff;
+ *((int *)&__m128_op1[2]) = 0xfffffffc;
+ *((int *)&__m128_op1[1]) = 0xffffffff;
+ *((int *)&__m128_op1[0]) = 0xfffffffc;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xfffffffc;
+ *((int *)&__m128_result[1]) = 0xffffffff;
+ *((int *)&__m128_result[0]) = 0xfffffffc;
+ __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x0000001b;
+ *((int *)&__m128_op0[2]) = 0x0000001b;
+ *((int *)&__m128_op0[1]) = 0x0000001b;
+ *((int *)&__m128_op0[0]) = 0x0000001b;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x0000001b;
+ *((int *)&__m128_result[2]) = 0x0000001b;
+ *((int *)&__m128_result[1]) = 0x0000001b;
+ *((int *)&__m128_result[0]) = 0x0000001b;
+ __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x56411278;
+ *((int *)&__m128_op0[2]) = 0x43c0d41e;
+ *((int *)&__m128_op0[1]) = 0x0124d8f6;
+ *((int *)&__m128_op0[0]) = 0xa494006b;
+ *((int *)&__m128_op1[3]) = 0xffffffff;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x80000000;
+ __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1);
+ 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]) = 0x05010501;
+ *((int *)&__m128_op1[2]) = 0x05010501;
+ *((int *)&__m128_op1[1]) = 0x05010501;
+ *((int *)&__m128_op1[0]) = 0x0501050c;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x21f32eaf;
+ *((int *)&__m128_op0[2]) = 0x5b7a02c8;
+ *((int *)&__m128_op0[1]) = 0x407c2ca3;
+ *((int *)&__m128_op0[0]) = 0x2cbd0357;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00010400;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xfffe0001;
+ *((int *)&__m128_op0[2]) = 0xfffe0001;
+ *((int *)&__m128_op0[1]) = 0xfffe0001;
+ *((int *)&__m128_op0[0]) = 0xfffe0001;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0xfffe0001;
+ *((int *)&__m128_result[2]) = 0xfffe0001;
+ *((int *)&__m128_result[1]) = 0xfffe0001;
+ *((int *)&__m128_result[0]) = 0xfffe0001;
+ __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00002ebf;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0xffffffff;
+ *((int *)&__m128_op1[0]) = 0xffffffff;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0xffffffff;
+ *((int *)&__m128_result[0]) = 0xffffffff;
+ __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x01000000;
+ *((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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00081f1f;
+ *((int *)&__m128_op0[2]) = 0x1f1f1f1f;
+ *((int *)&__m128_op0[1]) = 0x1f1f1f1f;
+ *((int *)&__m128_op0[0]) = 0x1f1f1f1f;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[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_vfmul_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x021b7d24;
+ *((int *)&__m128_op0[2]) = 0x49678a35;
+ *((int *)&__m128_op0[1]) = 0x030298a6;
+ *((int *)&__m128_op0[0]) = 0x21030a49;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000002;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xf6548a17;
+ *((int *)&__m128_op0[2]) = 0x47e59090;
+ *((int *)&__m128_op0[1]) = 0x27b169bb;
+ *((int *)&__m128_op0[0]) = 0xb8145f50;
+ *((int *)&__m128_op1[3]) = 0x004eff62;
+ *((int *)&__m128_op1[2]) = 0x00d2ff76;
+ *((int *)&__m128_op1[1]) = 0xff700028;
+ *((int *)&__m128_op1[0]) = 0x00be00a0;
+ *((int *)&__m128_result[3]) = 0xb7032c34;
+ *((int *)&__m128_result[2]) = 0x093d35ab;
+ *((int *)&__m128_result[1]) = 0xe7a6533b;
+ *((int *)&__m128_result[0]) = 0x800001b8;
+ __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfsub_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x7fff0101;
+ *((int *)&__m128_op0[2]) = 0x81010102;
+ *((int *)&__m128_op0[1]) = 0x7fffffff;
+ *((int *)&__m128_op0[0]) = 0x81010102;
+ *((int *)&__m128_op1[3]) = 0x00000fff;
+ *((int *)&__m128_op1[2]) = 0xffffe000;
+ *((int *)&__m128_op1[1]) = 0x00001020;
+ *((int *)&__m128_op1[0]) = 0x20204000;
+ *((int *)&__m128_result[3]) = 0x7fff0101;
+ *((int *)&__m128_result[2]) = 0xffffe000;
+ *((int *)&__m128_result[1]) = 0x7fffffff;
+ *((int *)&__m128_result[0]) = 0xa0204000;
+ __m128_out = __lsx_vfsub_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0xffffffff;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0xffffffff;
+ *((int *)&__m128_op1[3]) = 0x00000fff;
+ *((int *)&__m128_op1[2]) = 0xffffe000;
+ *((int *)&__m128_op1[1]) = 0x00001020;
+ *((int *)&__m128_op1[0]) = 0x20204000;
+ *((int *)&__m128_result[3]) = 0x80000fff;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0x80001020;
+ *((int *)&__m128_result[0]) = 0xffffffff;
+ __m128_out = __lsx_vfsub_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfsub_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x54feed87;
+ *((int *)&__m128_op0[2]) = 0xbc3f2be1;
+ *((int *)&__m128_op0[1]) = 0x8064d8f6;
+ *((int *)&__m128_op0[0]) = 0xa494afcb;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0xff800000;
+ *((int *)&__m128_result[0]) = 0xff800000;
+ __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0xd8248069;
+ *((int *)&__m128_op0[0]) = 0x7f678077;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0xd8248069;
+ *((int *)&__m128_op1[0]) = 0x7f678077;
+ *((int *)&__m128_result[3]) = 0x7fc00000;
+ *((int *)&__m128_result[2]) = 0x7fc00000;
+ *((int *)&__m128_result[1]) = 0x3f800000;
+ *((int *)&__m128_result[0]) = 0x3f800000;
+ __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x7fc00000;
+ *((int *)&__m128_result[2]) = 0x7fc00000;
+ *((int *)&__m128_result[1]) = 0x7fc00000;
+ *((int *)&__m128_result[0]) = 0x7fc00000;
+ __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00070000;
+ *((int *)&__m128_op0[2]) = 0x00040000;
+ *((int *)&__m128_op0[1]) = 0x00030000;
+ *((int *)&__m128_op0[0]) = 0x00010000;
+ *((int *)&__m128_op1[3]) = 0x00070000;
+ *((int *)&__m128_op1[2]) = 0x00040000;
+ *((int *)&__m128_op1[1]) = 0x00030000;
+ *((int *)&__m128_op1[0]) = 0x00010000;
+ *((int *)&__m128_result[3]) = 0x3f800000;
+ *((int *)&__m128_result[2]) = 0x3f800000;
+ *((int *)&__m128_result[1]) = 0x3f800000;
+ *((int *)&__m128_result[0]) = 0x3f800000;
+ __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1);
+ 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]) = 0x00010001;
+ *((int *)&__m128_op1[2]) = 0x0001007c;
+ *((int *)&__m128_op1[1]) = 0x00010001;
+ *((int *)&__m128_op1[0]) = 0x00010001;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00001fff;
+ *((int *)&__m128_op0[2]) = 0x00001fff;
+ *((int *)&__m128_op0[1]) = 0x00000003;
+ *((int *)&__m128_op0[0]) = 0xfffffffc;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0xfffffffc;
+ __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x7fc00000;
+ *((int *)&__m128_result[2]) = 0x7fc00000;
+ *((int *)&__m128_result[1]) = 0x7fc00000;
+ *((int *)&__m128_result[0]) = 0x7fc00000;
+ __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_d.c
new file mode 100644
index 000000000..9706d7adc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_d.c
@@ -0,0 +1,83 @@
+/* { 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]) = 0x0001ffff0001ffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0001ffff0001ffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000100;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000100;
+ __m128i_out = __lsx_vfclass_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000200;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200;
+ __m128i_out = __lsx_vfclass_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000200;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200;
+ __m128i_out = __lsx_vfclass_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000002;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000002;
+ __m128i_out = __lsx_vfclass_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xff00ff00ff00ff00;
+ *((unsigned long *)&__m128d_op0[0]) = 0xff00000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000008;
+ __m128i_out = __lsx_vfclass_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000200;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200;
+ __m128i_out = __lsx_vfclass_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x14ccc6320176a4d2;
+ *((unsigned long *)&__m128d_op0[0]) = 0x685670d37e80682a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000080;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000080;
+ __m128i_out = __lsx_vfclass_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000200;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200;
+ __m128i_out = __lsx_vfclass_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000200;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200;
+ __m128i_out = __lsx_vfclass_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_s.c
new file mode 100644
index 000000000..7166f954b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_s.c
@@ -0,0 +1,74 @@
+/* { 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]) = 0x7fff8000;
+ *((int *)&__m128_op0[1]) = 0x00010081;
+ *((int *)&__m128_op0[0]) = 0x00000005;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000020000000002;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000010000000100;
+ __m128i_out = __lsx_vfclass_s (__m128_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((int *)&__m128_op0[3]) = 0xfe02fe02;
+ *((int *)&__m128_op0[2]) = 0xfe02fe02;
+ *((int *)&__m128_op0[1]) = 0xfe02fe02;
+ *((int *)&__m128_op0[0]) = 0xfe02fe02;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000800000008;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000800000008;
+ __m128i_out = __lsx_vfclass_s (__m128_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((int *)&__m128_op0[3]) = 0x0000000c;
+ *((int *)&__m128_op0[2]) = 0x7fff000c;
+ *((int *)&__m128_op0[1]) = 0x10001000;
+ *((int *)&__m128_op0[0]) = 0x10001000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000010000000002;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000008000000080;
+ __m128i_out = __lsx_vfclass_s (__m128_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000020000000200;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000020000000200;
+ __m128i_out = __lsx_vfclass_s (__m128_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000020000000200;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000020000000200;
+ __m128i_out = __lsx_vfclass_s (__m128_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((int *)&__m128_op0[3]) = 0x0c0b0a09;
+ *((int *)&__m128_op0[2]) = 0x0b0a0908;
+ *((int *)&__m128_op0[1]) = 0x0a090807;
+ *((int *)&__m128_op0[0]) = 0x09080706;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000008000000080;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000008000000080;
+ __m128i_out = __lsx_vfclass_s (__m128_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_d.c
new file mode 100644
index 000000000..cc36bf136
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_d.c
@@ -0,0 +1,76 @@
+/* { 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]) = 0x0000000000000002;
+ *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xc090c40000000000;
+ __m128d_out = __lsx_vflogb_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000;
+ __m128d_out = __lsx_vflogb_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000;
+ __m128d_out = __lsx_vflogb_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000;
+ __m128d_out = __lsx_vflogb_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000;
+ __m128d_out = __lsx_vflogb_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000;
+ __m128d_out = __lsx_vflogb_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000;
+ __m128d_out = __lsx_vflogb_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xfffffffffffbfffc;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000001000000048;
+ *((unsigned long *)&__m128d_result[1]) = 0xfffffffffffbfffc;
+ *((unsigned long *)&__m128d_result[0]) = 0xc090380000000000;
+ __m128d_out = __lsx_vflogb_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_s.c
new file mode 100644
index 000000000..624589620
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_s.c
@@ -0,0 +1,185 @@
+/* { 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]) = 0x00003004;
+ *((int *)&__m128_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0xff800000;
+ *((int *)&__m128_result[0]) = 0xc3080000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xffffffff;
+ *((int *)&__m128_op0[2]) = 0xffffffff;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0xff800000;
+ *((int *)&__m128_result[0]) = 0xff800000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0xffffffff;
+ *((int *)&__m128_op0[0]) = 0xffffffff;
+ *((int *)&__m128_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0xffffffff;
+ *((int *)&__m128_result[0]) = 0xffffffff;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x01010101;
+ *((int *)&__m128_op0[2]) = 0x01010101;
+ *((int *)&__m128_op0[1]) = 0x01010101;
+ *((int *)&__m128_op0[0]) = 0x01010101;
+ *((int *)&__m128_result[3]) = 0xc2fa0000;
+ *((int *)&__m128_result[2]) = 0xc2fa0000;
+ *((int *)&__m128_result[1]) = 0xc2fa0000;
+ *((int *)&__m128_result[0]) = 0xc2fa0000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x01ff01ff;
+ *((int *)&__m128_op0[2]) = 0x01ff01ff;
+ *((int *)&__m128_op0[1]) = 0x01ff01ff;
+ *((int *)&__m128_op0[0]) = 0x01ff01ff;
+ *((int *)&__m128_result[3]) = 0xc2f80000;
+ *((int *)&__m128_result[2]) = 0xc2f80000;
+ *((int *)&__m128_result[1]) = 0xc2f80000;
+ *((int *)&__m128_result[0]) = 0xc2f80000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ 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]) = 0xd46cdc13;
+ *((int *)&__m128_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0xff800000;
+ *((int *)&__m128_result[0]) = 0x7fc00000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00fe00fe;
+ *((int *)&__m128_op0[2]) = 0x000200fe;
+ *((int *)&__m128_op0[1]) = 0x00fe00fe;
+ *((int *)&__m128_op0[0]) = 0x000200fe;
+ *((int *)&__m128_result[3]) = 0xc2fc0000;
+ *((int *)&__m128_result[2]) = 0xc3040000;
+ *((int *)&__m128_result[1]) = 0xc2fc0000;
+ *((int *)&__m128_result[0]) = 0xc3040000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x01010101;
+ *((int *)&__m128_op0[0]) = 0x00000100;
+ *((int *)&__m128_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0xc2fa0000;
+ *((int *)&__m128_result[0]) = 0xc30d0000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000014;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000014;
+ *((int *)&__m128_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xc3110000;
+ *((int *)&__m128_result[1]) = 0xff800000;
+ *((int *)&__m128_result[0]) = 0xc3110000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x4e3e1337;
+ *((int *)&__m128_op0[0]) = 0x38bb47d2;
+ *((int *)&__m128_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0x41e80000;
+ *((int *)&__m128_result[0]) = 0xc1600000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ 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_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0xff800000;
+ *((int *)&__m128_result[0]) = 0xff800000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ 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_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0xff800000;
+ *((int *)&__m128_result[0]) = 0xff800000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ 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_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0xff800000;
+ *((int *)&__m128_result[0]) = 0xff800000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ 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]) = 0x00003ff8;
+ *((int *)&__m128_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0xff800000;
+ *((int *)&__m128_result[1]) = 0xff800000;
+ *((int *)&__m128_result[0]) = 0xc3080000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xf1f181a2;
+ *((int *)&__m128_op0[2]) = 0xf1f1f1b0;
+ *((int *)&__m128_op0[1]) = 0xf1f1f1f1;
+ *((int *)&__m128_op0[0]) = 0xf180f1f1;
+ *((int *)&__m128_result[3]) = 0x7fc00000;
+ *((int *)&__m128_result[2]) = 0x7fc00000;
+ *((int *)&__m128_result[1]) = 0x7fc00000;
+ *((int *)&__m128_result[0]) = 0x7fc00000;
+ __m128_out = __lsx_vflogb_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_d.c
new file mode 100644
index 000000000..442473fb4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_d.c
@@ -0,0 +1,200 @@
+/* { 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]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000010;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0400040004000400;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0400040004000400;
+ *((unsigned long *)&__m128d_result[1]) = 0x0400040004000400;
+ *((unsigned long *)&__m128d_result[0]) = 0x0400040004000400;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x01ff01ff01ff01ff;
+ *((unsigned long *)&__m128d_op0[0]) = 0x01ff01ff01ff01ff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x01ff01ff01ff01ff;
+ *((unsigned long *)&__m128d_result[0]) = 0x01ff01ff01ff01ff;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xfffcfffcfffcfffc;
+ *((unsigned long *)&__m128d_op0[0]) = 0xfffcfffcfffcfffc;
+ *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0xfffcfffcfffcfffc;
+ *((unsigned long *)&__m128d_result[0]) = 0xfffcfffcfffcfffc;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ 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]) = 0x000000000000ffff;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x000000000000ffff;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x6363636363636363;
+ *((unsigned long *)&__m128d_op0[0]) = 0x6363636363636363;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128d_op1[0]) = 0xfdfef9ff0efff900;
+ *((unsigned long *)&__m128d_result[1]) = 0x6363636363636363;
+ *((unsigned long *)&__m128d_result[0]) = 0x6363636363636363;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xd70b30c96ea9f4e8;
+ *((unsigned long *)&__m128d_op0[0]) = 0xa352bfac9269e0aa;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x98147a504d145000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x377b810912c0e000;
+ *((unsigned long *)&__m128d_op1[1]) = 0xfffffffffffffff7;
+ *((unsigned long *)&__m128d_op1[0]) = 0xfffffffffffffff7;
+ *((unsigned long *)&__m128d_result[1]) = 0x98147a504d145000;
+ *((unsigned long *)&__m128d_result[0]) = 0x377b810912c0e000;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x4399d3221a29d3f2;
+ *((unsigned long *)&__m128d_op0[0]) = 0xc3818bffe7b7a7b8;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x4399d3221a29d3f2;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x17c64aaef639f093;
+ *((unsigned long *)&__m128d_op0[0]) = 0xdb8f439722ec502d;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x17c64aaef639f093;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x10f881a20ffd02b0;
+ *((unsigned long *)&__m128d_op0[0]) = 0x00000000ff800000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x10f881a20ffd02b0;
+ *((unsigned long *)&__m128d_result[0]) = 0x00000000ff800000;
+ __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1);
+ 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]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000006f00001f0a;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000c000ffffc000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000006f00001f0a;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000958affff995d;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000006f00001f0a;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000958affff995d;
+ __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x1748c4f9ed1a5870;
+ *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_s.c
new file mode 100644
index 000000000..876588827
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_s.c
@@ -0,0 +1,335 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x0000ffff;
+ *((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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x0000ffff;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ 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]) = 0xc2409eda;
+ *((int *)&__m128_op1[2]) = 0xb019323f;
+ *((int *)&__m128_op1[1]) = 0x460f3b39;
+ *((int *)&__m128_op1[0]) = 0x3ef4be3a;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x460f3b39;
+ *((int *)&__m128_result[0]) = 0x3ef4be3a;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000001;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000001;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000001;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000001;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ 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]) = 0xfefd7f7f;
+ *((int *)&__m128_op1[2]) = 0x7f7f7f7e;
+ *((int *)&__m128_op1[1]) = 0xdffdbffe;
+ *((int *)&__m128_op1[0]) = 0xba6f5543;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x7f7f7f7e;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xff84fff4;
+ *((int *)&__m128_op0[2]) = 0xff84fff4;
+ *((int *)&__m128_op0[1]) = 0xffffffff;
+ *((int *)&__m128_op0[0]) = 0xfffffff0;
+ *((int *)&__m128_op1[3]) = 0xff84fff4;
+ *((int *)&__m128_op1[2]) = 0xff84fff4;
+ *((int *)&__m128_op1[1]) = 0xffffffff;
+ *((int *)&__m128_op1[0]) = 0xfffffff0;
+ *((int *)&__m128_result[3]) = 0xffc4fff4;
+ *((int *)&__m128_result[2]) = 0xffc4fff4;
+ *((int *)&__m128_result[1]) = 0xffffffff;
+ *((int *)&__m128_result[0]) = 0xfffffff0;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ 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]) = 0x00007fff;
+ *((int *)&__m128_op1[2]) = 0x00007fff;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x00007fff;
+ *((int *)&__m128_result[2]) = 0x00007fff;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0xffffffff;
+ *((int *)&__m128_op0[1]) = 0xffffffff;
+ *((int *)&__m128_op0[0]) = 0xffffffff;
+ *((int *)&__m128_op1[3]) = 0xffffffff;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[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_vfmax_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000001;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0xffffffff;
+ *((int *)&__m128_op1[2]) = 0xffffffff;
+ *((int *)&__m128_op1[1]) = 0xffffffff;
+ *((int *)&__m128_op1[0]) = 0xffffffff;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000001;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x01010001;
+ *((int *)&__m128_op0[0]) = 0x01010001;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00020000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00020000;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00020000;
+ *((int *)&__m128_result[1]) = 0x01010001;
+ *((int *)&__m128_result[0]) = 0x01010001;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ 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]) = 0x00000020;
+ *((int *)&__m128_op1[2]) = 0x00000020;
+ *((int *)&__m128_op1[1]) = 0x0000001f;
+ *((int *)&__m128_op1[0]) = 0x0000001f;
+ *((int *)&__m128_result[3]) = 0x00000020;
+ *((int *)&__m128_result[2]) = 0x00000020;
+ *((int *)&__m128_result[1]) = 0x0000001f;
+ *((int *)&__m128_result[0]) = 0x0000001f;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0xf3040705;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0xf3040705;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0xf3040705;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000004;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000004;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000004;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000004;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000004;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000004;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x0000ffff;
+ *((int *)&__m128_op0[2]) = 0x0000ffff;
+ *((int *)&__m128_op0[1]) = 0x0000ffff;
+ *((int *)&__m128_op0[0]) = 0x0000fffe;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[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_vfmin_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xffffffff;
+ *((int *)&__m128_op0[2]) = 0xffffffe5;
+ *((int *)&__m128_op0[1]) = 0xffffffff;
+ *((int *)&__m128_op0[0]) = 0xffffffe5;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[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_vfmin_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmin_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x13121110;
+ *((int *)&__m128_op0[2]) = 0x1211100f;
+ *((int *)&__m128_op0[1]) = 0x11100f0e;
+ *((int *)&__m128_op0[0]) = 0x100f0e0d;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[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_vfmin_s (__m128_op0, __m128_op1);
+ 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]) = 0xfffffff3;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000008;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x00000088;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000008;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000088;
+ __m128_out = __lsx_vfmin_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x52525252;
+ *((int *)&__m128_op0[2]) = 0xadadadad;
+ *((int *)&__m128_op0[1]) = 0x52525252;
+ *((int *)&__m128_op0[0]) = 0xadadadad;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0xffffffff;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0xffffffff;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0xadadadad;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0xadadadad;
+ __m128_out = __lsx_vfmin_s (__m128_op0, __m128_op1);
+ 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]) = 0x0000ffff;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x0000ffff;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x0000ffff;
+ __m128_out = __lsx_vfmin_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_d.c
new file mode 100644
index 000000000..c2766d5c6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_d.c
@@ -0,0 +1,155 @@
+/* { 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]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000800000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000800000000000;
+ __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x01203f1e3d1c3b1a;
+ *((unsigned long *)&__m128d_op0[0]) = 0x3918371635143312;
+ *((unsigned long *)&__m128d_op1[1]) = 0x00000af555555555;
+ *((unsigned long *)&__m128d_op1[0]) = 0x00000af555555555;
+ *((unsigned long *)&__m128d_result[1]) = 0x01203f1e3d1c3b1a;
+ *((unsigned long *)&__m128d_result[0]) = 0x3918371635143312;
+ __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000010000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000010000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000010000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000010000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000010000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000010000000000;
+ __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1);
+ 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_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x10f8000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0xfff8ffa2fffdffb0;
+ *((unsigned long *)&__m128d_op1[0]) = 0x00000000ff800000;
+ *((unsigned long *)&__m128d_result[1]) = 0x10f8000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x00000000ff800000;
+ __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000200000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000200000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000100000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000080000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0x80000000fff6fc00;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000080000000;
+ __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1);
+ 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]) = 0x0000080000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000158;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op1[0]) = 0xfffe0004fffe0004;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xff800000ff800000;
+ *((unsigned long *)&__m128d_op0[0]) = 0xff800000ff800000;
+ *((unsigned long *)&__m128d_op1[1]) = 0x002a001a001a000b;
+ *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x002a001a001a000b;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_s.c
new file mode 100644
index 000000000..5fcdedd3f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_s.c
@@ -0,0 +1,230 @@
+/* { 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmaxa_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0xf436f3f5;
+ *((int *)&__m128_op0[0]) = 0x2f4ef4a8;
+ *((int *)&__m128_op1[3]) = 0xff800000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0xff800000;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0xff800000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0xff800000;
+ *((int *)&__m128_result[0]) = 0x2f4ef4a8;
+ __m128_out = __lsx_vfmaxa_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000800;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00000800;
+ *((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_result[3]) = 0x00000800;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000800;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmaxa_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0xc0c0c000;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_op1[3]) = 0x00800080;
+ *((int *)&__m128_op1[2]) = 0x00800080;
+ *((int *)&__m128_op1[1]) = 0x0080006b;
+ *((int *)&__m128_op1[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x00800080;
+ *((int *)&__m128_result[2]) = 0xc0c0c000;
+ *((int *)&__m128_result[1]) = 0x0080006b;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmaxa_s (__m128_op0, __m128_op1);
+ 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]) = 0xffffffff;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[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_vfmaxa_s (__m128_op0, __m128_op1);
+ 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]) = 0x80000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x80000000;
+ *((int *)&__m128_op1[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_vfmaxa_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmaxa_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmina_s (__m128_op0, __m128_op1);
+ 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]) = 0xffffffff;
+ *((int *)&__m128_op1[2]) = 0xffffffff;
+ *((int *)&__m128_op1[1]) = 0xffffffff;
+ *((int *)&__m128_op1[0]) = 0xffffffff;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmina_s (__m128_op0, __m128_op1);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmina_s (__m128_op0, __m128_op1);
+ 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]) = 0xff01ff01;
+ *((int *)&__m128_op1[2]) = 0x0000ff7d;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[0]) = 0x0000fffc;
+ *((int *)&__m128_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfmina_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0xdfa6e0c6;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0xd46cdc13;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[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_vfmina_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x01010101;
+ *((int *)&__m128_op0[2]) = 0x01010101;
+ *((int *)&__m128_op0[1]) = 0x010101fe;
+ *((int *)&__m128_op0[0]) = 0x0101fe87;
+ *((int *)&__m128_op1[3]) = 0x00000000;
+ *((int *)&__m128_op1[2]) = 0x00000000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[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_vfmina_s (__m128_op0, __m128_op1);
+ 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]) = 0xffffffff;
+ *((int *)&__m128_op1[3]) = 0xffff0000;
+ *((int *)&__m128_op1[2]) = 0xffff0000;
+ *((int *)&__m128_op1[1]) = 0x00000000;
+ *((int *)&__m128_op1[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_vfmina_s (__m128_op0, __m128_op1);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_d.c
new file mode 100644
index 000000000..8a35dfe24
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_d.c
@@ -0,0 +1,216 @@
+/* { 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]) = 0xffffffffa486c90f;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000058bcc201;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffa486c90f;
+ *((unsigned long *)&__m128d_result[0]) = 0x1f52d710bf295626;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffff01ff01;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffff01ff01;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000be00be;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x1f1b917c9f3d5e05;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000001400000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x1f81e3779b97f4a8;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xff800000ff800000;
+ *((unsigned long *)&__m128d_op0[0]) = 0xff800000ff800000;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff8000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x001effae001effae;
+ *((unsigned long *)&__m128d_op0[0]) = 0x001effae001effae;
+ *((unsigned long *)&__m128d_result[1]) = 0x2006454690d3de87;
+ *((unsigned long *)&__m128d_result[0]) = 0x2006454690d3de87;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xc0b4d1a5f8babad3;
+ *((unsigned long *)&__m128d_op0[0]) = 0xbbc8ecc5f3ced5f3;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff8000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000;
+ __m128d_out = __lsx_vfsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0xff800000ff800000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000;
+ __m128d_out = __lsx_vfrsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0001ffff00000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0001ffff0001ffff;
+ *((unsigned long *)&__m128d_result[1]) = 0x5ff6a0a40ea8f47c;
+ *((unsigned long *)&__m128d_result[0]) = 0x5ff6a0a40e9da42a;
+ __m128d_out = __lsx_vfrsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x000000000000000f;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x61608654a2d4f6da;
+ __m128d_out = __lsx_vfrsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffff0000ffff0000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffff0000ffff0000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000;
+ __m128d_out = __lsx_vfrsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x00fe000100cf005f;
+ *((unsigned long *)&__m128d_op0[0]) = 0x7fff7fff7fff7fff;
+ *((unsigned long *)&__m128d_result[1]) = 0x5f675e96e29a5a60;
+ *((unsigned long *)&__m128d_result[0]) = 0x7fff7fff7fff7fff;
+ __m128d_out = __lsx_vfrsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000;
+ __m128d_out = __lsx_vfrsqrt_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0x7ff8000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000;
+ __m128d_out = __lsx_vfrecip_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000;
+ __m128d_out = __lsx_vfrecip_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x00003f8000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x00003f8000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000;
+ __m128d_out = __lsx_vfrecip_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000;
+ __m128d_out = __lsx_vfrecip_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000;
+ __m128d_out = __lsx_vfrecip_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff;
+ __m128d_out = __lsx_vfrecip_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x00000000fffa0000;
+ *((unsigned long *)&__m128d_op0[0]) = 0x00000000fffa0000;
+ *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000;
+ __m128d_out = __lsx_vfrecip_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0xff800000ff800000;
+ *((unsigned long *)&__m128d_op0[0]) = 0xe593c8c4e593c8c4;
+ *((unsigned long *)&__m128d_result[1]) = 0x805ffffe01001fe0;
+ *((unsigned long *)&__m128d_result[0]) = 0x9a49e11102834d70;
+ __m128d_out = __lsx_vfrecip_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ *((unsigned long *)&__m128d_op0[1]) = 0x5252525252525252;
+ *((unsigned long *)&__m128d_op0[0]) = 0x5252dcdcdcdcdcdc;
+ *((unsigned long *)&__m128d_result[1]) = 0x2d8bf1f8fc7e3f20;
+ *((unsigned long *)&__m128d_result[0]) = 0x2d8b24b936d1b24d;
+ __m128d_out = __lsx_vfrecip_d (__m128d_op0);
+ ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_s.c
new file mode 100644
index 000000000..ffd80540b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_s.c
@@ -0,0 +1,372 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((int *)&__m128_op0[3]) = 0xfe07e5fe;
+ *((int *)&__m128_op0[2]) = 0xfefdddfe;
+ *((int *)&__m128_op0[1]) = 0x00020100;
+ *((int *)&__m128_op0[0]) = 0xfedd0c00;
+ *((int *)&__m128_result[3]) = 0x7fc00000;
+ *((int *)&__m128_result[2]) = 0x7fc00000;
+ *((int *)&__m128_result[1]) = 0x1e801ffc;
+ *((int *)&__m128_result[0]) = 0x7fc00000;
+ __m128_out = __lsx_vfsqrt_s (__m128_op0);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xff00ff00;
+ *((int *)&__m128_op0[2]) = 0xff00ff00;
+ *((int *)&__m128_op0[1]) = 0xff00ff00;
+ *((int *)&__m128_op0[0]) = 0xff00ff00;
+ *((int *)&__m128_result[3]) = 0x7fc00000;
+ *((int *)&__m128_result[2]) = 0x7fc00000;
+ *((int *)&__m128_result[1]) = 0x7fc00000;
+ *((int *)&__m128_result[0]) = 0x7fc00000;
+ __m128_out = __lsx_vfsqrt_s (__m128_op0);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x8c7fc73a;
+ *((int *)&__m128_op0[2]) = 0x137e54af;
+ *((int *)&__m128_op0[1]) = 0xbc84cf6f;
+ *((int *)&__m128_op0[0]) = 0x76208329;
+ *((int *)&__m128_result[3]) = 0x7fc00000;
+ *((int *)&__m128_result[2]) = 0x297f29fe;
+ *((int *)&__m128_result[1]) = 0x7fc00000;
+ *((int *)&__m128_result[0]) = 0x5acab5a5;
+ __m128_out = __lsx_vfsqrt_s (__m128_op0);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xffff9727;
+ *((int *)&__m128_op0[2]) = 0xffff9727;
+ *((int *)&__m128_op0[1]) = 0xfffffe79;
+ *((int *)&__m128_op0[0]) = 0xffffba5f;
+ *((int *)&__m128_result[3]) = 0xffff9727;
+ *((int *)&__m128_result[2]) = 0xffff9727;
+ *((int *)&__m128_result[1]) = 0xfffffe79;
+ *((int *)&__m128_result[0]) = 0xffffba5f;
+ __m128_out = __lsx_vfsqrt_s (__m128_op0);
+ 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_result[3]) = 0x00000000;
+ *((int *)&__m128_result[2]) = 0x00000000;
+ *((int *)&__m128_result[1]) = 0x00000000;
+ *((int *)&__m128_result[0]) = 0x00000000;
+ __m128_out = __lsx_vfsqrt_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0xfff8fff8;
+ *((int *)&__m128_op0[1]) = 0x00000000;
+ *((int *)&__m128_op0[0]) = 0xfff80000;
+ *((int *)&__m128_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0xfff8fff8;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0xfff80000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ 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]) = 0xffffffff;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0xffffffff;
+ *((int *)&__m128_result[0]) = 0xffffffff;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x1f1b917c;
+ *((int *)&__m128_op0[0]) = 0x9f3d5e05;
+ *((int *)&__m128_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x4fa432d6;
+ *((int *)&__m128_result[0]) = 0x7fc00000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xffffffff;
+ *((int *)&__m128_op0[2]) = 0xffffffff;
+ *((int *)&__m128_op0[1]) = 0x12835580;
+ *((int *)&__m128_op0[0]) = 0xb880eb98;
+ *((int *)&__m128_result[3]) = 0xffffffff;
+ *((int *)&__m128_result[2]) = 0xffffffff;
+ *((int *)&__m128_result[1]) = 0x55fcbad1;
+ *((int *)&__m128_result[0]) = 0x7fc00000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x06070607;
+ *((int *)&__m128_op0[2]) = 0x00000807;
+ *((int *)&__m128_op0[1]) = 0x0707f8f8;
+ *((int *)&__m128_op0[0]) = 0x03e8157e;
+ *((int *)&__m128_result[3]) = 0x5c303f97;
+ *((int *)&__m128_result[2]) = 0x61ff9049;
+ *((int *)&__m128_result[1]) = 0x5bafa1dd;
+ *((int *)&__m128_result[0]) = 0x5d3e1e1d;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xfff7fffe;
+ *((int *)&__m128_op0[2]) = 0xfffa01ff;
+ *((int *)&__m128_op0[1]) = 0xfffbfffe;
+ *((int *)&__m128_op0[0]) = 0xfffe01ff;
+ *((int *)&__m128_result[3]) = 0xfff7fffe;
+ *((int *)&__m128_result[2]) = 0xfffa01ff;
+ *((int *)&__m128_result[1]) = 0xfffbfffe;
+ *((int *)&__m128_result[0]) = 0xfffe01ff;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x45000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x44000000;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x3cb504f3;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x3d3504f3;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000000;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x00020001;
+ *((int *)&__m128_op0[0]) = 0x00020002;
+ *((int *)&__m128_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x607fffc0;
+ *((int *)&__m128_result[0]) = 0x607fff80;
+ __m128_out = __lsx_vfrsqrt_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x00000002;
+ *((int *)&__m128_op0[2]) = 0x00000002;
+ *((int *)&__m128_op0[1]) = 0x00000003;
+ *((int *)&__m128_op0[0]) = 0x00000003;
+ *((int *)&__m128_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrecip_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xf6e91c00;
+ *((int *)&__m128_op0[2]) = 0x00000000;
+ *((int *)&__m128_op0[1]) = 0x51cfd7c0;
+ *((int *)&__m128_op0[0]) = 0x00000000;
+ *((int *)&__m128_result[3]) = 0x880c91b8;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x2d1da85b;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrecip_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrecip_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrecip_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xfffffffa;
+ *((int *)&__m128_op0[2]) = 0xfffffffa;
+ *((int *)&__m128_op0[1]) = 0xfffffffa;
+ *((int *)&__m128_op0[0]) = 0xfffffffa;
+ *((int *)&__m128_result[3]) = 0xfffffffa;
+ *((int *)&__m128_result[2]) = 0xfffffffa;
+ *((int *)&__m128_result[1]) = 0xfffffffa;
+ *((int *)&__m128_result[0]) = 0xfffffffa;
+ __m128_out = __lsx_vfrecip_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrecip_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0xffff0001;
+ *((int *)&__m128_op0[2]) = 0xffff0001;
+ *((int *)&__m128_op0[1]) = 0xffff0001;
+ *((int *)&__m128_op0[0]) = 0xffff0001;
+ *((int *)&__m128_result[3]) = 0xffff0001;
+ *((int *)&__m128_result[2]) = 0xffff0001;
+ *((int *)&__m128_result[1]) = 0xffff0001;
+ *((int *)&__m128_result[0]) = 0xffff0001;
+ __m128_out = __lsx_vfrecip_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ *((int *)&__m128_op0[3]) = 0x0a000000;
+ *((int *)&__m128_op0[2]) = 0x0a000000;
+ *((int *)&__m128_op0[1]) = 0x0a000000;
+ *((int *)&__m128_op0[0]) = 0x0a000000;
+ *((int *)&__m128_result[3]) = 0x75000000;
+ *((int *)&__m128_result[2]) = 0x75000000;
+ *((int *)&__m128_result[1]) = 0x75000000;
+ *((int *)&__m128_result[0]) = 0x75000000;
+ __m128_out = __lsx_vfrecip_s (__m128_op0);
+ 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_result[3]) = 0x7f800000;
+ *((int *)&__m128_result[2]) = 0x7f800000;
+ *((int *)&__m128_result[1]) = 0x7f800000;
+ *((int *)&__m128_result[0]) = 0x7f800000;
+ __m128_out = __lsx_vfrecip_s (__m128_op0);
+ ASSERTEQ_32 (__LINE__, __m128_result, __m128_out);
+
+ return 0;
+}
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化