1 Star 0 Fork 139

luofeng14/gcc

forked from src-openEuler/gcc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
LoongArch-Add-tests-for-SX-vector-vbitclr-vbitclri-v.patch 167.18 KB
一键复制 编辑 原始数据 按行查看 历史
ticat_fp 提交于 2024-03-26 09:26 . LoongArch: update from gcc upstream
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324
From 0b75b581703b0eb1eb9ca9e898255de7f4cb51ad Mon Sep 17 00:00:00 2001
From: Xiaolong Chen <chenxiaolong@loongson.cn>
Date: Tue, 12 Sep 2023 11:20:44 +0800
Subject: [PATCH 092/124] LoongArch: Add tests for SX vector
vbitclr/vbitclri/vbitrev/vbitrevi/
vbitsel/vbitseli/vbitset/vbitseti/vclo/vclz/vpcnt instructions.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/vector/lsx/lsx-vbitclr.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vbitclri.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vbitrev.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vbitrevi.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vbitsel.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vbitseli.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vbitset.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vbitseti.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vclo.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vclz.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-vpcnt.c: New test.
Signed-off-by: Peng Fan <fanpeng@loongson.cn>
Signed-off-by: ticat_fp <fanpeng@loongson.cn>
---
.../loongarch/vector/lsx/lsx-vbitclr.c | 461 ++++++++++++++++++
.../loongarch/vector/lsx/lsx-vbitclri.c | 279 +++++++++++
.../loongarch/vector/lsx/lsx-vbitrev.c | 407 ++++++++++++++++
.../loongarch/vector/lsx/lsx-vbitrevi.c | 336 +++++++++++++
.../loongarch/vector/lsx/lsx-vbitsel.c | 109 +++++
.../loongarch/vector/lsx/lsx-vbitseli.c | 84 ++++
.../loongarch/vector/lsx/lsx-vbitset.c | 371 ++++++++++++++
.../loongarch/vector/lsx/lsx-vbitseti.c | 279 +++++++++++
.../loongarch/vector/lsx/lsx-vclo.c | 266 ++++++++++
.../loongarch/vector/lsx/lsx-vclz.c | 265 ++++++++++
.../loongarch/vector/lsx/lsx-vpcnt.c | 350 +++++++++++++
11 files changed, 3207 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclr.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclri.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrev.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrevi.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitsel.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseli.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitset.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseti.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclo.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclz.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpcnt.c
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclr.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclr.c
new file mode 100644
index 000000000..411dcaa40
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclr.c
@@ -0,0 +1,461 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000e0000000e0;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00e0000000e00000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x000000e0000000e0;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000004000;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfff8004000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x19df307a5d04acbb;
+ *((unsigned long *)&__m128i_op0[0]) = 0x5ed032b06bde1ab6;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0080000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0080000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x19de307a5d04acba;
+ *((unsigned long *)&__m128i_result[0]) = 0x5ed032b06bde1ab6;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0018001800180018;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0018001800180018;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xd8248069ffe78077;
+ *((unsigned long *)&__m128i_op1[1]) = 0x85bd6b0e94d89998;
+ *((unsigned long *)&__m128i_op1[0]) = 0xd83c8081ffff808f;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0xd82480697f678077;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000000006597cc3d;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_op1[1]) = 0x7505853d654185f5;
+ *((unsigned long *)&__m128i_op1[0]) = 0x01010000fefe0101;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000006595cc1d;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffff0000ffff0000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xfffe0000fffe0000;
+ *((unsigned long *)&__m128i_result[0]) = 0xfffe0000fffe0000;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_op0[0]) = 0x80000000fff7fc01;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x80000000fff6fc00;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffff800;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x00000000fffefffe;
+ *((unsigned long *)&__m128i_result[0]) = 0x00000000fffef800;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000001000100;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000001000100;
+ *((unsigned long *)&__m128i_result[1]) = 0xfffffffefffffffe;
+ *((unsigned long *)&__m128i_result[0]) = 0xfffffffefffffffe;
+ __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x4101010141010100;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[1]) = 0x4101010141010100;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x23b57fa16d39f7c8;
+ *((unsigned long *)&__m128i_op1[0]) = 0x161c0c363c200824;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x8000ffff00000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x8000ffff00000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x3f8000003f800000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x3f8000003f800000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000fefe00000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000fefe00000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x1ffffffff8001000;
+ *((unsigned long *)&__m128i_op1[0]) = 0xf0bd80bd80bd8000;
+ *((unsigned long *)&__m128i_result[1]) = 0x7fff7ffffffefffe;
+ *((unsigned long *)&__m128i_result[0]) = 0xdfffdfffdffffffe;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000037;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000001f0a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000036;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000100010001007c;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x000100000001007c;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000000010000;
+ __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfefa000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xfefa000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x67b7cf643c9d636a;
+ *((unsigned long *)&__m128i_op0[0]) = 0x39d70e366f547977;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0002ffff00000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x66b34f643c9c626a;
+ *((unsigned long *)&__m128i_result[0]) = 0x38d60e366e547876;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x2020202020202020;
+ *((unsigned long *)&__m128i_op0[0]) = 0x2020202020207fff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000007fff;
+ *((unsigned long *)&__m128i_result[1]) = 0x2020202020202020;
+ *((unsigned long *)&__m128i_result[0]) = 0x2020202020207f7f;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080;
+ *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7ff8000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x7ff8000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000005;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000005;
+ *((unsigned long *)&__m128i_result[1]) = 0x7ef8000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x7ef8000000000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffff0000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000077f97;
+ *((unsigned long *)&__m128i_result[1]) = 0xfffffffefffffffe;
+ *((unsigned long *)&__m128i_result[0]) = 0xfffffffeff7f0000;
+ __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x14ccc6320176a4d2;
+ *((unsigned long *)&__m128i_op0[0]) = 0x685670d37e80682a;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x000000007fffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x14ccc6320076a4d2;
+ *((unsigned long *)&__m128i_result[0]) = 0x685670d27e00682a;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x003fffff00000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x003fffff00000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000001000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00001b4a00007808;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000001000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000001000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0100010001000100;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x000000007fff7fff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000001000100;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x5d7f5d807fea807f;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x5d7f5d007f6a007f;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x00000000fffefffe;
+ *((unsigned long *)&__m128i_result[0]) = 0x00000000fffefffe;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x207fffff22bd04fb;
+ *((unsigned long *)&__m128i_op0[0]) = 0x207fffff22bd04fb;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0001000002000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0001000002000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x207fffff22bd04fa;
+ *((unsigned long *)&__m128i_result[0]) = 0x207fffff22bd04fa;
+ __m128i_out = __lsx_vbitclr_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0xfffefffefffefffe;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000014;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000014;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0001000101010001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000014;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014;
+ __m128i_out = __lsx_vbitclr_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x000000000000ffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636363;
+ *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000100000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00007fff7fff8000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00000000b81c8382;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000077af9450;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x00007efe7f7f8000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0001000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0001000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000000000667ae56;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000020;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00000000000004ff;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000000667ae56;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000020;
+ __m128i_out = __lsx_vbitclr_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclri.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclri.c
new file mode 100644
index 000000000..5d7d66e06
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclri.c
@@ -0,0 +1,279 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0xc);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000b0000000b;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000201000000000b;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000b0000000b;
+ *((unsigned long *)&__m128i_result[0]) = 0x000201000000000b;
+ __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x4);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x004200a000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x004200a000200000;
+ *((unsigned long *)&__m128i_result[1]) = 0x004200a000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x004200a000200000;
+ __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0x4);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x00000000efffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x1c);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000002ff5;
+ *((unsigned long *)&__m128i_op0[0]) = 0xc2cf2471e9b7d7a4;
+ *((unsigned long *)&__m128i_result[1]) = 0x00000000000027f5;
+ *((unsigned long *)&__m128i_result[0]) = 0xc2cf2471e9b7d7a4;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0xb);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7505443065413aed;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0100d6effefd0498;
+ *((unsigned long *)&__m128i_result[1]) = 0x7404443064403aec;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000d6eefefc0498;
+ __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x9);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x36);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x64b680a2ae3af8ca;
+ *((unsigned long *)&__m128i_op0[0]) = 0x161c0c363c200826;
+ *((unsigned long *)&__m128i_result[1]) = 0x64b680a2ae3af8c8;
+ *((unsigned long *)&__m128i_result[0]) = 0x161c0c363c200824;
+ __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xbfffbfffbfffbffe;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0xe);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xff807f807f807f80;
+ *((unsigned long *)&__m128i_op0[0]) = 0xff807f807f807f80;
+ *((unsigned long *)&__m128i_result[1]) = 0xfb807b807b807b80;
+ *((unsigned long *)&__m128i_result[0]) = 0xfb807b807b807b80;
+ __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1000100010001000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x1000100010001000;
+ *((unsigned long *)&__m128i_result[1]) = 0x1000100010001000;
+ *((unsigned long *)&__m128i_result[0]) = 0x1000100010001000;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x4);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x19);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0x3);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xfbffffffffffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0xfbffffffffffffff;
+ __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x3a);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x9941d1d5f4ba9d08;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x9941d155f43a9d08;
+ __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0x7);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffbfffffffbf;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffbfffffffbf;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x6);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x03f1e3d28b1a8a1a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x03f1e3d28b1a8a1a;
+ __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x5);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffda6f;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffe3d7;
+ *((unsigned long *)&__m128i_result[1]) = 0xfefffffffeffda6f;
+ *((unsigned long *)&__m128i_result[0]) = 0xfefffffffeffe3d7;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x18);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x26);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x30);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000040;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040;
+ __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x4);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x8080808080638063;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x8080808080638063;
+ __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0x8);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0004000400040004;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0004000400040004;
+ *((unsigned long *)&__m128i_result[1]) = 0x0004000400040004;
+ *((unsigned long *)&__m128i_result[0]) = 0x0004000400040004;
+ __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0xd);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x1c);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005;
+ __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x13);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x6);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x19);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x11);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x5);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000800000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x3);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000200008;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000200000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000200008;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000200000;
+ __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x5);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0002000200000001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000200000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0002000200000001;
+ __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x7);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xdfdfdfdfdfdfdfdf;
+ *((unsigned long *)&__m128i_result[0]) = 0xdfdfdfdfdfdfdfdf;
+ __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x5);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0xb);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrev.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrev.c
new file mode 100644
index 000000000..ba4f4b6dc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrev.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 *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x1b71a083b3dec3cd;
+ *((unsigned long *)&__m128i_op1[0]) = 0x373a13323b4cdbc1;
+ *((unsigned long *)&__m128i_result[1]) = 0x0802010808400820;
+ *((unsigned long *)&__m128i_result[0]) = 0x8004080408100802;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000800000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vbitrev_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x8000800080008000;
+ *((unsigned long *)&__m128i_result[0]) = 0x8000800080008000;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000501000002;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000008;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000040100;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010400100203;
+ *((unsigned long *)&__m128i_result[0]) = 0x0103010301020109;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffbe6ed563;
+ *((unsigned long *)&__m128i_op1[1]) = 0xd0b1ffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0x9d519ee8d2d84f1d;
+ *((unsigned long *)&__m128i_result[1]) = 0xfefd7f7f7f7f7f7e;
+ *((unsigned long *)&__m128i_result[0]) = 0xdffdbffeba6f5543;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x7da9b23a624082fd;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000;
+ *((unsigned long *)&__m128i_result[1]) = 0x2002040404010420;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010180800101;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000fffe0000ffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001ffff0001fffe;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0e7ffffc01fffffc;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000003f803f4;
+ *((unsigned long *)&__m128i_result[1]) = 0x1000000010000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100100000;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0400040004000400;
+ *((unsigned long *)&__m128i_op0[0]) = 0x040004000400040d;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0501050105010501;
+ *((unsigned long *)&__m128i_result[0]) = 0x050105010501050c;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vbitrev_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x000100010001fffe;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffffffefffffffe;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffffffefffffffe;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000007f00000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0x7ffffffeffffffff;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0040000000400000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0040000000400000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0141010101410101;
+ *((unsigned long *)&__m128i_result[0]) = 0x0141010101410101;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x65b780a3ae3bf8cb;
+ *((unsigned long *)&__m128i_op0[0]) = 0x161d0c363c200826;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x65b780a2ae3bf8ca;
+ *((unsigned long *)&__m128i_result[0]) = 0x161d0c373c200827;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xff00ff00ff00ff00;
+ *((unsigned long *)&__m128i_op0[0]) = 0xff00ff00ff00ff00;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xfe01fe01fe01fe01;
+ *((unsigned long *)&__m128i_result[0]) = 0xfe01fe01fe01fe01;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x000000003bfb4000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0040004000400040;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0040004000400040;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000021ffffffdf;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000e60;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x1ff85ffe2ae5d973;
+ *((unsigned long *)&__m128i_result[1]) = 0x00010020fffeffde;
+ *((unsigned long *)&__m128i_result[0]) = 0x0100400100200e68;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00d3012acc56f9bb;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000001021;
+ *((unsigned long *)&__m128i_result[1]) = 0x0108020410400208;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010102;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000ff0000ff86;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+ *((unsigned long *)&__m128i_result[0]) = 0x010101fe0101fe87;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x343d8dc5b0ed5a08;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+ *((unsigned long *)&__m128i_result[0]) = 0x353c8cc4b1ec5b09;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0037ffc8d7ff2800;
+ *((unsigned long *)&__m128i_op0[0]) = 0xff00ff00ffffff00;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0038d800ff000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00fffe00fffffe00;
+ *((unsigned long *)&__m128i_result[1]) = 0x0137ffc9d7fe2801;
+ *((unsigned long *)&__m128i_result[0]) = 0x7f00ff017fffff01;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000200000002000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001200100012001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000ff00ff;
+ *((unsigned long *)&__m128i_result[1]) = 0xfffffffefffffffe;
+ *((unsigned long *)&__m128i_result[0]) = 0xfffffffe7fffffff;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000100010002;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffc;
+ *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x8000000010000000;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffdfffdfffdfffd;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffdfffdfffdfffd;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xfffdfffcfffdfffc;
+ *((unsigned long *)&__m128i_result[0]) = 0xfffdfffcfffdfffc;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0001ffff0101ffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0001ffff0001ffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0001000101010001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0103fefd0303fefd;
+ *((unsigned long *)&__m128i_result[0]) = 0x0103fefd0103fefd;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000800000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000800000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x6a5d5b056f2f4978;
+ *((unsigned long *)&__m128i_op1[0]) = 0x17483c07141b5971;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000002001000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000008000020000;
+ __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xfffefffefffefffe;
+ *((unsigned long *)&__m128i_result[0]) = 0xfffefffefffefffe;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00000001ce28f9c0;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000004e06b0890;
+ *((unsigned long *)&__m128i_result[1]) = 0xfefefefdbffefdfe;
+ *((unsigned long *)&__m128i_result[0]) = 0xfefefeeffef7fefe;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xff800000ff800000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xff800000ff800000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x003ffffe00800000;
+ *((unsigned long *)&__m128i_result[1]) = 0xff810001ff810002;
+ *((unsigned long *)&__m128i_result[0]) = 0x7f804000ff810001;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xff1affff01001fe0;
+ *((unsigned long *)&__m128i_op0[0]) = 0xff1aff6d02834d70;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000034;
+ *((unsigned long *)&__m128i_result[1]) = 0xfe1bfefe00011ee1;
+ *((unsigned long *)&__m128i_result[0]) = 0xfe1bfe6c03824c60;
+ __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x41945926d8000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00001e5410082727;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00007f7f00107f7f;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001001001000080;
+ *((unsigned long *)&__m128i_result[0]) = 0x4195d926d8018000;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x7f8100017f810001;
+ *((unsigned long *)&__m128i_result[0]) = 0x7f8100017f810001;
+ __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x545501550001113a;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x8000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0xd45501550001113a;
+ __m128i_out = __lsx_vbitrev_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrevi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrevi.c
new file mode 100644
index 000000000..9739182cd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrevi.c
@@ -0,0 +1,336 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000003004;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000400000004000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000400000007004;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0xe);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xfeffffffffffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0xfeffffffffffffff;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x38);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x4000400040004000;
+ *((unsigned long *)&__m128i_result[0]) = 0x4000400040004000;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xe);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000000007fff8000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0001008100000005;
+ *((unsigned long *)&__m128i_result[1]) = 0x0800080077ff8800;
+ *((unsigned long *)&__m128i_result[0]) = 0x0801088108000805;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xb);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0202020202020202;
+ *((unsigned long *)&__m128i_result[0]) = 0x0202020202020202;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xe86ce7eb5e9ce950;
+ *((unsigned long *)&__m128i_result[1]) = 0x0404040404040404;
+ *((unsigned long *)&__m128i_result[0]) = 0xec68e3ef5a98ed54;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000200010;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000400000004000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000400000204010;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0xe);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400;
+ *((unsigned long *)&__m128i_result[0]) = 0x0400040004000400;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xa);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffff02;
+ *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400;
+ *((unsigned long *)&__m128i_result[0]) = 0x04000400fbfffb02;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xa);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010000000100000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010000000100000;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x14);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d;
+ *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400;
+ *((unsigned long *)&__m128i_result[0]) = 0x040004000400040d;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xa);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000000004f804f81;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000004f804f80;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000004fc04f81;
+ *((unsigned long *)&__m128i_result[0]) = 0x000000004fc04f80;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x16);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0040004000400040;
+ *((unsigned long *)&__m128i_result[0]) = 0x0040004000400040;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0x6);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x1010101010101010;
+ *((unsigned long *)&__m128i_result[0]) = 0xefefefefefefefef;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x4);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x4040404040404040;
+ *((unsigned long *)&__m128i_result[0]) = 0x4040404040404040;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x6);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e1d1c1b1a;
+ *((unsigned long *)&__m128i_op0[0]) = 0x1918171615141312;
+ *((unsigned long *)&__m128i_result[1]) = 0x01203f1e3d1c3b1a;
+ *((unsigned long *)&__m128i_result[0]) = 0x3918371635143312;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xd);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x61608654a2d4f6da;
+ *((unsigned long *)&__m128i_result[1]) = 0xfff0800080008000;
+ *((unsigned long *)&__m128i_result[0]) = 0xe160065422d476da;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xf);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x37c0001000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x37c0001000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x77c0401040004000;
+ *((unsigned long *)&__m128i_result[0]) = 0x77c0401040004000;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xe);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x77c0404a4000403a;
+ *((unsigned long *)&__m128i_op0[0]) = 0x77c03fd640003fc6;
+ *((unsigned long *)&__m128i_result[1]) = 0x75c0404a4200403a;
+ *((unsigned long *)&__m128i_result[0]) = 0x75c03fd642003fc6;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x19);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x3);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_result[1]) = 0x0808080808280808;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808280808;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x15);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xfffffefffffffeff;
+ *((unsigned long *)&__m128i_result[0]) = 0x00000100fffffeff;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x8);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000010000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000010000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0404050404040404;
+ *((unsigned long *)&__m128i_result[0]) = 0x0404050404040404;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x1000100010001000;
+ *((unsigned long *)&__m128i_result[0]) = 0x1000100010001000;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xc);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xbfbfbfbfbfbfbfbf;
+ *((unsigned long *)&__m128i_result[0]) = 0xbfbfbfbfbfbfbfbf;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x6);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000040000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000040000000;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x1e);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000020000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000020000;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x11);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x2000200020002000;
+ *((unsigned long *)&__m128i_result[0]) = 0x2000200020002000;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xd);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x441ba9fcffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x181b2541ffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x401fadf8fbfbfbfb;
+ *((unsigned long *)&__m128i_result[0]) = 0x1c1f2145fbfbfbfb;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000100;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000100;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x8);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffefff00001000;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffefff00001000;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0xc);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x8080808080808080;
+ *((unsigned long *)&__m128i_result[0]) = 0x8080808080808080;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x7);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000200000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x21);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000002000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000002000;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0xd);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000010000000100;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000010000000100;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x8);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xd6a09e662ab46b31;
+ *((unsigned long *)&__m128i_op0[0]) = 0x34b8122ef4054bb3;
+ *((unsigned long *)&__m128i_result[1]) = 0xd6e09e262af46b71;
+ *((unsigned long *)&__m128i_result[0]) = 0x34f8126ef4454bf3;
+ __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0x6);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000200008;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000200000;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x15);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfefefefdbffefdfe;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfefefeeffef7feff;
+ *((unsigned long *)&__m128i_result[1]) = 0xfcfcfcffbdfcfffc;
+ *((unsigned long *)&__m128i_result[0]) = 0xfcfcfcedfcf5fcfd;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000555889;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000002580f01;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010000000455889;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010000002480f01;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x14);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00060fbf00040fbf;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00020fbf00000fbf;
+ *((unsigned long *)&__m128i_result[1]) = 0x00060fbf02040fbf;
+ *((unsigned long *)&__m128i_result[0]) = 0x00020fbf02000fbf;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x19);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000000007fffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x400000003fffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0x4000000040000000;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x1e);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x021b7d24c9678a35;
+ *((unsigned long *)&__m128i_op0[0]) = 0x030298a6a1030a49;
+ *((unsigned long *)&__m128i_result[1]) = 0x00197f26cb658837;
+ *((unsigned long *)&__m128i_result[0]) = 0x01009aa4a301084b;
+ __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x3);
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000c6c60000c6c6;
+ *((unsigned long *)&__m128i_op0[0]) = 0x8000c6c58000c6b2;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000c6c40000c6c6;
+ *((unsigned long *)&__m128i_result[0]) = 0x8000c6c78000c6b2;
+ __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x21);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffff7fffffff7f;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffff7fffffff7f;
+ __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x7);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitsel.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitsel.c
new file mode 100644
index 000000000..52ac9939f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitsel.c
@@ -0,0 +1,109 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op2[1]) = 0x0000000000007fff;
+ *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000005050000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0505000005050505;
+ *((unsigned long *)&__m128i_op1[1]) = 0x000d02540000007e;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000001400140014;
+ *((unsigned long *)&__m128i_op2[1]) = 0x0505050505050505;
+ *((unsigned long *)&__m128i_op2[0]) = 0x03574e38e496cbc9;
+ *((unsigned long *)&__m128i_result[1]) = 0x0005000400000004;
+ *((unsigned long *)&__m128i_result[0]) = 0x0400001001150404;
+ __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2);
+ *((unsigned long *)&__m128i_op0[1]) = 0x0080001300000013;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0080001300000013;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0080001300000013;
+ *((unsigned long *)&__m128i_result[0]) = 0x0080001300000013;
+ __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op2[1]) = 0x43d3e0000013e000;
+ *((unsigned long *)&__m128i_op2[0]) = 0x43d3e0000013e000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffe0001fffe0001;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffe0001fffe0001;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op2[1]) = 0xfffe0001fffe0001;
+ *((unsigned long *)&__m128i_op2[0]) = 0xfffe0001fffe0001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffffacdb6dbecac;
+ *((unsigned long *)&__m128i_op0[0]) = 0x1f5533a694f902c0;
+ *((unsigned long *)&__m128i_op1[1]) = 0x62cbf96e4acfaf40;
+ *((unsigned long *)&__m128i_op1[0]) = 0xf0bc9a5278285a4a;
+ *((unsigned long *)&__m128i_op2[1]) = 0xfffffacdb6dbecac;
+ *((unsigned long *)&__m128i_op2[0]) = 0x1f5533a694f902c0;
+ *((unsigned long *)&__m128i_result[1]) = 0x62cbf84c02cbac00;
+ *((unsigned long *)&__m128i_result[0]) = 0x1014120210280240;
+ __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffff59;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff59;
+ __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseli.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseli.c
new file mode 100644
index 000000000..f2d6fb042
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseli.c
@@ -0,0 +1,84 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffcfffcfffcfffc;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffcfffcfffcfffc;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x6664666466646664;
+ *((unsigned long *)&__m128i_result[0]) = 0x6664666466646664;
+ __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0x66);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff7;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000001;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffff0000010000;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x5d5d5d5d5d5d5d55;
+ __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0x5d);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2);
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000004;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004;
+ *((unsigned long *)&__m128i_result[1]) = 0x5959595959595959;
+ *((unsigned long *)&__m128i_result[0]) = 0x5959595959595959;
+ __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0x59);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0xfffd000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xfffd000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0x3a);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0xaa);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0b4c600000000002;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_result[0]) = 0x0004280808080808;
+ __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0xa4);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000004000000040;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00007770ffff9411;
+ *((unsigned long *)&__m128i_op1[1]) = 0x000000400000004c;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00007770ffff941d;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000400000004c;
+ *((unsigned long *)&__m128i_result[0]) = 0x000047404f4f040d;
+ __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0x4f);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitset.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitset.c
new file mode 100644
index 000000000..e05af675e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitset.c
@@ -0,0 +1,371 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vbitset_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vbitset_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffe000ffffe000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffe000ffffe000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffe001ffffe001;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffe001ffffe001;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000038335ca2777;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000800800000;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vbitset_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xf51cf8dad6040188;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0982e2daf234ed87;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xf51df8dbd6050189;
+ *((unsigned long *)&__m128i_result[0]) = 0x0983e2dbf235ed87;
+ __m128i_out = __lsx_vbitset_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfc01fcfefc02fdf7;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfe00fcfffe01fd01;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000001;
+ *((unsigned long *)&__m128i_op1[0]) = 0x5d5d5d5d5d5d5d55;
+ *((unsigned long *)&__m128i_result[1]) = 0xfc01fcfefc02fdf7;
+ *((unsigned long *)&__m128i_result[0]) = 0xfe00fcfffe21fd01;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000fff7fc01;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x80000000fff7fc01;
+ __m128i_out = __lsx_vbitset_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vbitset_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffffffe00000004;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffff01010105;
+ __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00000001c00ffffe;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000001fffffffe;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010201808040;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010280808040;
+ __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x3f8000003f800000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3f8000003f800000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x3f8000003f800001;
+ *((unsigned long *)&__m128i_result[0]) = 0x3f8000003f800001;
+ __m128i_out = __lsx_vbitset_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00000000010a000b;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000104000800;
+ __m128i_out = __lsx_vbitset_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000897957687;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000408;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000010000000080;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000100;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0xfffe0001fffe0001;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfffe0001fffe0001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffff994cb09c;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffc3639d96;
+ *((unsigned long *)&__m128i_op1[1]) = 0x20de27761210386d;
+ *((unsigned long *)&__m128i_op1[0]) = 0x34632935195a123c;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffff994db09c;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffffc7639d96;
+ __m128i_out = __lsx_vbitset_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000545cab1d;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000081a83bea;
+ *((unsigned long *)&__m128i_op1[1]) = 0x13f9c5b60028a415;
+ *((unsigned long *)&__m128i_op1[0]) = 0x545cab1d81a83bea;
+ *((unsigned long *)&__m128i_result[1]) = 0x00400000547cab1d;
+ *((unsigned long *)&__m128i_result[0]) = 0x2000000081a83fea;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000038003;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000040033;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000008;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100080000;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_result[1]) = 0x0909090909090909;
+ *((unsigned long *)&__m128i_result[0]) = 0x0909090909090909;
+ __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x00a600e000a600e0;
+ *((unsigned long *)&__m128i_op1[0]) = 0x01500178010000f8;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0100000001000000;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0xfefbff06fffa0004;
+ *((unsigned long *)&__m128i_op1[0]) = 0xfefeff04fffd0004;
+ *((unsigned long *)&__m128i_result[1]) = 0x4008804080040110;
+ *((unsigned long *)&__m128i_result[0]) = 0x4040801080200110;
+ __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001;
+ __m128i_out = __lsx_vbitset_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vbitset_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x8101010181010101;
+ *((unsigned long *)&__m128i_result[0]) = 0x8101010181010101;
+ __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000020000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000020000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101030101;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101030101;
+ __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vbitset_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000100;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xd78cfd70b5f65d76;
+ *((unsigned long *)&__m128i_op0[0]) = 0x5779108fdedda7e4;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xd78cfd70b5f65d77;
+ *((unsigned long *)&__m128i_result[0]) = 0x5779108fdedda7e5;
+ __m128i_out = __lsx_vbitset_d (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000008;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00004a1e00004a1e;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000100000100;
+ *((unsigned long *)&__m128i_result[0]) = 0x4000000040000000;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0007000000050000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0003000100010001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0080000100200001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0008000200020002;
+ __m128i_out = __lsx_vbitset_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffff80ffff7e02;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00feff8000ff80ff;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0280000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffff81ffff7f03;
+ *((unsigned long *)&__m128i_result[0]) = 0x04ffff8101ff81ff;
+ __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x4480000044800000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x45c0000044800000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00fe00fe7fffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x4481000144810001;
+ *((unsigned long *)&__m128i_result[0]) = 0x45c04000c4808000;
+ __m128i_out = __lsx_vbitset_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x3a8000003a800000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3bc000003a800000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x00fe00fe7fffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x3a8100013a810001;
+ *((unsigned long *)&__m128i_result[0]) = 0x7bc04000ba808000;
+ __m128i_out = __lsx_vbitset_h (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x0000cecd00004657;
+ *((unsigned long *)&__m128i_op1[0]) = 0x0000c90000011197;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000200000800000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000100800000;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000;
+ *((unsigned long *)&__m128i_op1[1]) = 0x7f8000007f800000;
+ *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000;
+ *((unsigned long *)&__m128i_result[1]) = 0x7f8000017f800001;
+ *((unsigned long *)&__m128i_result[0]) = 0x7f8000017f800001;
+ __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseti.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseti.c
new file mode 100644
index 000000000..540a724a7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseti.c
@@ -0,0 +1,279 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0020002000200020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0020002000200020;
+ __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0x5);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000ff00ff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0040000000ff00ff;
+ *((unsigned long *)&__m128i_result[0]) = 0x0040000000000000;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x36);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x54beed87bc3f2be1;
+ *((unsigned long *)&__m128i_op0[0]) = 0x8024d8f6a494afcb;
+ *((unsigned long *)&__m128i_result[1]) = 0x54feed87bc3f2be1;
+ *((unsigned long *)&__m128i_result[0]) = 0x8064d8f6a494afcb;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x36);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000000000c400;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x001000100010c410;
+ __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0x4);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x2e2b34ca59fa4c88;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3b2c8aefd44be966;
+ *((unsigned long *)&__m128i_result[1]) = 0x3e2b34ca59fa4c88;
+ *((unsigned long *)&__m128i_result[0]) = 0x3b2c8aefd44be966;
+ __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x1c);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000017fda829;
+ *((unsigned long *)&__m128i_result[1]) = 0x0040004000400040;
+ *((unsigned long *)&__m128i_result[0]) = 0x0040004017fda869;
+ __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0x6);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x800000ff000000ff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x800000ff080000ff;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x1b);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000000010000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000000010000;
+ __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x10);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0004000000040000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0004000000040000;
+ __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x12);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vbitseti_b (__m128i_op0, 0x2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xf51cf8dad6040188;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0982e2daf234ed87;
+ *((unsigned long *)&__m128i_result[1]) = 0xf51cf8dad6040188;
+ *((unsigned long *)&__m128i_result[0]) = 0x0982eadaf234ed87;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x2b);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0002000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0002000000000000;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x31);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000006;
+ *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x8000000080000006;
+ __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x1f);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000080000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000080000000000;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x2b);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7fff7fff7fff7fff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000010000003f;
+ *((unsigned long *)&__m128i_result[1]) = 0x7fff7fff7fff7fff;
+ *((unsigned long *)&__m128i_result[0]) = 0x000000030000003f;
+ __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x1);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xe5e5e5e5e5e5e5e5;
+ *((unsigned long *)&__m128i_op0[0]) = 0xe5e5e5e5e4e4e46d;
+ *((unsigned long *)&__m128i_result[1]) = 0xe5e5e5e5e5e5e5e5;
+ *((unsigned long *)&__m128i_result[0]) = 0xe5e5e5e5e4e4e46d;
+ __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x1a);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vbitseti_b (__m128i_op0, 0x0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x1000100010001000;
+ *((unsigned long *)&__m128i_result[0]) = 0x1000100010001000;
+ __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0xc);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0800080008000800;
+ *((unsigned long *)&__m128i_result[0]) = 0x0800080008000800;
+ __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0xb);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0100000001000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0100000001000000;
+ __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x18);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000007fff;
+ *((unsigned long *)&__m128i_result[1]) = 0x2020202020202020;
+ *((unsigned long *)&__m128i_result[0]) = 0x2020202020207fff;
+ __m128i_out = __lsx_vbitseti_b (__m128i_op0, 0x5);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000900000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000900013fa0;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x23);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x40f3fa0000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x3ff0008000800080;
+ *((unsigned long *)&__m128i_result[0]) = 0x40f3fa8000800080;
+ __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0x7);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000040000000000;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x2a);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xc000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0404040404040404;
+ *((unsigned long *)&__m128i_result[0]) = 0xc404040404040404;
+ __m128i_out = __lsx_vbitseti_b (__m128i_op0, 0x2);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000040804000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000040804000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000040a04000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000040a04000;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x15);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff;
+ __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x9);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x1f81e3779b97f4a8;
+ *((unsigned long *)&__m128i_result[1]) = 0xffffffff02000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x1f81e3779b97f4a8;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x19);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000008000000080;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000008000000080;
+ __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x7);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0100010001000101;
+ *((unsigned long *)&__m128i_result[0]) = 0x0100010001000101;
+ __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0x8);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+ __m128i_out = __lsx_vbitseti_b (__m128i_op0, 0x3);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000010000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000010000000;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x1c);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0002711250a27112;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00d2701294027112;
+ *((unsigned long *)&__m128i_result[1]) = 0x080a791a58aa791a;
+ *((unsigned long *)&__m128i_result[0]) = 0x08da781a9c0a791a;
+ __m128i_out = __lsx_vbitseti_b (__m128i_op0, 0x3);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0303030303030303;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0303030303030303;
+ *((unsigned long *)&__m128i_result[1]) = 0x1313131313131313;
+ *((unsigned long *)&__m128i_result[0]) = 0x1313131313131313;
+ __m128i_out = __lsx_vbitseti_b (__m128i_op0, 0x4);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0001000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0001000000000000;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x30);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000002000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000002000000000;
+ __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x25);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfff0000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0xfff0008000000080;
+ *((unsigned long *)&__m128i_result[0]) = 0xfff0008000000080;
+ __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x7);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclo.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclo.c
new file mode 100644
index 000000000..2c1099a04
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclo.c
@@ -0,0 +1,266 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000005555555554;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000005555555554;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000040;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040;
+ __m128i_out = __lsx_vclo_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xe2ecd48adedc7c82;
+ *((unsigned long *)&__m128i_op0[0]) = 0x25d666472b01d18d;
+ *((unsigned long *)&__m128i_result[1]) = 0x0303020102020001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0002000000000201;
+ __m128i_out = __lsx_vclo_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000fefefe6a;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000c2bac2c2;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000007070700;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000002010202;
+ __m128i_out = __lsx_vclo_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x3d3d3d3d3d3d3d3d;
+ *((unsigned long *)&__m128i_op0[0]) = 0x3d3d3d3d3d3d3d3d;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000007e8a60;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000000001edde;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003;
+ __m128i_out = __lsx_vclo_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x05d0ae6002e8748e;
+ *((unsigned long *)&__m128i_op0[0]) = 0xcd1de80217374041;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x7ff0000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000001fffff59;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010;
+ __m128i_out = __lsx_vclo_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000000000000aaaa;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x2);
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffe500ffffc085;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffc000ffffc005;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000001300000012;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000001200000012;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x003fffff00000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x003fffff00000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000001000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000001000000000;
+ __m128i_out = __lsx_vclo_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7fff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffc0ff80ff800000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000a00000009;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x8080808080808080;
+ *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808080;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vclo_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000008;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x413e276583869d79;
+ *((unsigned long *)&__m128i_op0[0]) = 0x7f7f017f9d8726d3;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffbfffc;
+ *((unsigned long *)&__m128i_op0[0]) = 0xc090380000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000200000000d;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010012;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000fec20704;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclo_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffff4;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff4;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000200000001c;
+ *((unsigned long *)&__m128i_result[0]) = 0x000000200000001c;
+ __m128i_out = __lsx_vclo_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclz.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclz.c
new file mode 100644
index 000000000..12df2c670
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclz.c
@@ -0,0 +1,265 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000ff000000ff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010000800100008;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000000001fc1a568;
+ *((unsigned long *)&__m128i_op0[0]) = 0x02693fe0e7beb077;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000030000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0006000200000000;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020;
+ __m128i_out = __lsx_vclz_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020;
+ __m128i_out = __lsx_vclz_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020;
+ __m128i_out = __lsx_vclz_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020;
+ __m128i_out = __lsx_vclz_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7f7f000b000b000b;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000b000b010a000b;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101080408040804;
+ *((unsigned long *)&__m128i_result[0]) = 0x0804080407040804;
+ __m128i_out = __lsx_vclz_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1ffffffff8001000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xf0bd80bd80bd8000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000003;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclz_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000100010000fe7c;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000100010000fe01;
+ *((unsigned long *)&__m128i_result[1]) = 0x000f000f00100000;
+ *((unsigned long *)&__m128i_result[0]) = 0x000f000f00100000;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+ __m128i_out = __lsx_vclz_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+ __m128i_out = __lsx_vclz_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x41dfffff00000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0100000008080808;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+ __m128i_out = __lsx_vclz_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000040;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040;
+ __m128i_out = __lsx_vclz_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000039;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000039;
+ __m128i_out = __lsx_vclz_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020;
+ __m128i_out = __lsx_vclz_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00ff000100ff00fe;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00ff003000ff00a0;
+ *((unsigned long *)&__m128i_result[1]) = 0x0008000f00080008;
+ *((unsigned long *)&__m128i_result[0]) = 0x0008000a00080008;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfe813f00fe813f00;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfe813f00fe813f00;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000bffffffe;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040;
+ __m128i_out = __lsx_vclz_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000c0c00000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffe;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000014;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vclz_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363;
+ *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101;
+ __m128i_out = __lsx_vclz_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x687a8373f249bc44;
+ *((unsigned long *)&__m128i_op0[0]) = 0x7861145d9241a14a;
+ *((unsigned long *)&__m128i_result[1]) = 0x0101000100010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0101030100010001;
+ __m128i_out = __lsx_vclz_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000040;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040;
+ __m128i_out = __lsx_vclz_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020;
+ __m128i_out = __lsx_vclz_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000001fffffffe;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0808080700000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+ __m128i_out = __lsx_vclz_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+ __m128i_out = __lsx_vclz_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000f0000000f;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000f0000000f;
+ __m128i_out = __lsx_vclz_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x000000000000001f;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000008000001e;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000200000001b;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000002000000000;
+ __m128i_out = __lsx_vclz_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000005;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005;
+ *((unsigned long *)&__m128i_result[1]) = 0x0808080808080805;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808080805;
+ __m128i_out = __lsx_vclz_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+ __m128i_out = __lsx_vclz_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000000000;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010;
+ __m128i_out = __lsx_vclz_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpcnt.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpcnt.c
new file mode 100644
index 000000000..66982d89f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpcnt.c
@@ -0,0 +1,350 @@
+/* { dg-do run } */
+/* { dg-options "-mlsx -w -fno-strict-aliasing" } */
+#include "../simd_correctness_check.h"
+#include <lsxintrin.h>
+
+int
+main ()
+{
+ __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result;
+ __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result;
+ __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result;
+
+ int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail;
+ long int long_op0, long_op1, long_op2, lont_out, lont_result;
+ long int long_int_out, long_int_result;
+ unsigned int unsigned_int_out, unsigned_int_result;
+ unsigned long int unsigned_long_int_out, unsigned_long_int_result;
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x7);
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffefefefe;
+ *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000000000003c;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000800000008;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000800000008;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x7f80000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0701000007010000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0701000000000000;
+ __m128i_out = __lsx_vpcnt_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x807f7f8000ffff00;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff00feff00;
+ *((unsigned long *)&__m128i_result[1]) = 0x0107070100080800;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000080800070800;
+ __m128i_out = __lsx_vpcnt_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x5252525252525252;
+ *((unsigned long *)&__m128i_op0[0]) = 0x5252525252525252;
+ *((unsigned long *)&__m128i_result[1]) = 0x0303030303030303;
+ *((unsigned long *)&__m128i_result[0]) = 0x0303030303030303;
+ __m128i_out = __lsx_vpcnt_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000100010;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xe0404041e0404041;
+ *((unsigned long *)&__m128i_op0[0]) = 0x803f800080000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000000000000e;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000009;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0007000000040000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0003000000010000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0003000000010000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0002000000010000;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x1111111111111111;
+ *((unsigned long *)&__m128i_op0[0]) = 0x1111111111111111;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0ba00ba00ba00ba0;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0ba00ba00ba011eb;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000a0000000a;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000a0000000d;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfbfbfb17fbfb38ea;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfbfb47fbfbfb0404;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000000000002f;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000029;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffbfc0ffffbfc0;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000032;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e19181716;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0003000900050007;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000005;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000002;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000002;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfff0800080008000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xe160065422d476da;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000d00000002;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000b00000010;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000001000000010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000001000000000;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000040;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000010100000101;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000010100000101;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808;
+ __m128i_out = __lsx_vpcnt_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000020000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0103000201030002;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000008;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffc;
+ *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffc;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000200000001e;
+ *((unsigned long *)&__m128i_result[0]) = 0x000000200000001e;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xbbe5560400010001;
+ *((unsigned long *)&__m128i_op0[0]) = 0xe7e5dabf00010001;
+ *((unsigned long *)&__m128i_result[1]) = 0x000b000500010001;
+ *((unsigned long *)&__m128i_result[0]) = 0x000b000c00010001;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010;
+ *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000001f0000001f;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x9c9c9c9c9c9c9c9c;
+ *((unsigned long *)&__m128i_op0[0]) = 0x9c9c9c9c9c9c9c9c;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000020;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000020;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_h (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000600007fff;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000008ffffa209;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000011;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000016;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000467fef81;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000013;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_d (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x00000000fe03fe01;
+ *((unsigned long *)&__m128i_op0[0]) = 0x00000000fe01fe01;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000007020701;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000007010701;
+ __m128i_out = __lsx_vpcnt_b (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0x7f80000000000000;
+ *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000;
+ *((unsigned long *)&__m128i_result[1]) = 0x0000000800000000;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ *((unsigned long *)&__m128i_op0[1]) = 0xf654ad7447e59090;
+ *((unsigned long *)&__m128i_op0[0]) = 0x27b1b106b8145f50;
+ *((unsigned long *)&__m128i_result[1]) = 0x000000120000000d;
+ *((unsigned long *)&__m128i_result[0]) = 0x0000000e0000000e;
+ __m128i_out = __lsx_vpcnt_w (__m128i_op0);
+ ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out);
+
+ return 0;
+}
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/luofeng14/gcc.git
git@gitee.com:luofeng14/gcc.git
luofeng14
gcc
gcc
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385