IntrinsicsX86.td 325 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382
  1. //===- IntrinsicsX86.td - Defines X86 intrinsics -----------*- tablegen -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file defines all of the X86-specific intrinsics.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. //===----------------------------------------------------------------------===//
  13. // Interrupt traps
  14. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  15. def int_x86_int : Intrinsic<[], [llvm_i8_ty], [ImmArg<ArgIndex<0>>]>;
  16. }
  17. //===----------------------------------------------------------------------===//
  18. // SEH intrinsics for Windows
  19. let TargetPrefix = "x86" in {
  20. def int_x86_seh_lsda : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], [IntrNoMem]>;
  21. // Marks the EH registration node created in LLVM IR prior to code generation.
  22. def int_x86_seh_ehregnode : Intrinsic<[], [llvm_ptr_ty], []>;
  23. // Marks the EH guard slot node created in LLVM IR prior to code generation.
  24. def int_x86_seh_ehguard : Intrinsic<[], [llvm_ptr_ty], []>;
  25. }
  26. //===----------------------------------------------------------------------===//
  27. // FLAGS.
  28. let TargetPrefix = "x86" in {
  29. def int_x86_flags_read_u32 : ClangBuiltin<"__builtin_ia32_readeflags_u32">,
  30. Intrinsic<[llvm_i32_ty], [], []>;
  31. def int_x86_flags_read_u64 : ClangBuiltin<"__builtin_ia32_readeflags_u64">,
  32. Intrinsic<[llvm_i64_ty], [], []>;
  33. def int_x86_flags_write_u32 : ClangBuiltin<"__builtin_ia32_writeeflags_u32">,
  34. Intrinsic<[], [llvm_i32_ty], []>;
  35. def int_x86_flags_write_u64 : ClangBuiltin<"__builtin_ia32_writeeflags_u64">,
  36. Intrinsic<[], [llvm_i64_ty], []>;
  37. }
  38. //===----------------------------------------------------------------------===//
  39. // Read Time Stamp Counter.
  40. let TargetPrefix = "x86" in {
  41. def int_x86_rdtsc : ClangBuiltin<"__builtin_ia32_rdtsc">,
  42. Intrinsic<[llvm_i64_ty], [], []>;
  43. def int_x86_rdtscp :
  44. Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
  45. }
  46. // Read Performance-Monitoring Counter.
  47. let TargetPrefix = "x86" in {
  48. def int_x86_rdpmc : ClangBuiltin<"__builtin_ia32_rdpmc">,
  49. Intrinsic<[llvm_i64_ty], [llvm_i32_ty], []>;
  50. }
  51. // Read processor ID.
  52. let TargetPrefix = "x86" in {
  53. def int_x86_rdpid : ClangBuiltin<"__builtin_ia32_rdpid">,
  54. Intrinsic<[llvm_i32_ty], [], []>;
  55. }
  56. // Lock bit test.
  57. let TargetPrefix = "x86" in {
  58. def int_x86_atomic_bts : Intrinsic<[llvm_anyint_ty], [llvm_ptr_ty, llvm_i8_ty],
  59. [ImmArg<ArgIndex<1>>]>;
  60. def int_x86_atomic_btc : Intrinsic<[llvm_anyint_ty], [llvm_ptr_ty, llvm_i8_ty],
  61. [ImmArg<ArgIndex<1>>]>;
  62. def int_x86_atomic_btr : Intrinsic<[llvm_anyint_ty], [llvm_ptr_ty, llvm_i8_ty],
  63. [ImmArg<ArgIndex<1>>]>;
  64. def int_x86_atomic_bts_rm : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty],
  65. []>;
  66. def int_x86_atomic_btc_rm : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty],
  67. []>;
  68. def int_x86_atomic_btr_rm : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty],
  69. []>;
  70. }
  71. // Lock binary arith with CC.
  72. let TargetPrefix = "x86" in {
  73. def int_x86_atomic_add_cc : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty, llvm_i32_ty],
  74. [ImmArg<ArgIndex<2>>]>;
  75. def int_x86_atomic_sub_cc : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty, llvm_i32_ty],
  76. [ImmArg<ArgIndex<2>>]>;
  77. def int_x86_atomic_or_cc : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty, llvm_i32_ty],
  78. [ImmArg<ArgIndex<2>>]>;
  79. def int_x86_atomic_and_cc : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty, llvm_i32_ty],
  80. [ImmArg<ArgIndex<2>>]>;
  81. def int_x86_atomic_xor_cc : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty, llvm_i32_ty],
  82. [ImmArg<ArgIndex<2>>]>;
  83. }
  84. // Read Processor Register.
  85. let TargetPrefix = "x86" in {
  86. def int_x86_rdpru : ClangBuiltin<"__builtin_ia32_rdpru">,
  87. Intrinsic<[llvm_i64_ty], [llvm_i32_ty], []>;
  88. }
  89. //===----------------------------------------------------------------------===//
  90. // CET SS
  91. let TargetPrefix = "x86" in {
  92. def int_x86_incsspd : ClangBuiltin<"__builtin_ia32_incsspd">,
  93. Intrinsic<[], [llvm_i32_ty], []>;
  94. def int_x86_incsspq : ClangBuiltin<"__builtin_ia32_incsspq">,
  95. Intrinsic<[], [llvm_i64_ty], []>;
  96. def int_x86_rdsspd : ClangBuiltin<"__builtin_ia32_rdsspd">,
  97. Intrinsic<[llvm_i32_ty], [llvm_i32_ty], []>;
  98. def int_x86_rdsspq : ClangBuiltin<"__builtin_ia32_rdsspq">,
  99. Intrinsic<[llvm_i64_ty], [llvm_i64_ty], []>;
  100. def int_x86_saveprevssp : ClangBuiltin<"__builtin_ia32_saveprevssp">,
  101. Intrinsic<[], [], []>;
  102. def int_x86_rstorssp : ClangBuiltin<"__builtin_ia32_rstorssp">,
  103. Intrinsic<[], [llvm_ptr_ty], []>;
  104. def int_x86_wrssd : ClangBuiltin<"__builtin_ia32_wrssd">,
  105. Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>;
  106. def int_x86_wrssq : ClangBuiltin<"__builtin_ia32_wrssq">,
  107. Intrinsic<[], [llvm_i64_ty, llvm_ptr_ty], []>;
  108. def int_x86_wrussd : ClangBuiltin<"__builtin_ia32_wrussd">,
  109. Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>;
  110. def int_x86_wrussq : ClangBuiltin<"__builtin_ia32_wrussq">,
  111. Intrinsic<[], [llvm_i64_ty, llvm_ptr_ty], []>;
  112. def int_x86_setssbsy : ClangBuiltin<"__builtin_ia32_setssbsy">,
  113. Intrinsic<[], [], []>;
  114. def int_x86_clrssbsy : ClangBuiltin<"__builtin_ia32_clrssbsy">,
  115. Intrinsic<[], [llvm_ptr_ty], []>;
  116. }
  117. //===----------------------------------------------------------------------===//
  118. // 3DNow!
  119. let TargetPrefix = "x86" in {
  120. def int_x86_3dnow_pavgusb : ClangBuiltin<"__builtin_ia32_pavgusb">,
  121. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  122. [IntrNoMem]>;
  123. def int_x86_3dnow_pf2id : ClangBuiltin<"__builtin_ia32_pf2id">,
  124. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  125. def int_x86_3dnow_pfacc : ClangBuiltin<"__builtin_ia32_pfacc">,
  126. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  127. [IntrNoMem]>;
  128. def int_x86_3dnow_pfadd : ClangBuiltin<"__builtin_ia32_pfadd">,
  129. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  130. [IntrNoMem]>;
  131. def int_x86_3dnow_pfcmpeq : ClangBuiltin<"__builtin_ia32_pfcmpeq">,
  132. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  133. [IntrNoMem]>;
  134. def int_x86_3dnow_pfcmpge : ClangBuiltin<"__builtin_ia32_pfcmpge">,
  135. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  136. [IntrNoMem]>;
  137. def int_x86_3dnow_pfcmpgt : ClangBuiltin<"__builtin_ia32_pfcmpgt">,
  138. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  139. [IntrNoMem]>;
  140. def int_x86_3dnow_pfmax : ClangBuiltin<"__builtin_ia32_pfmax">,
  141. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  142. [IntrNoMem]>;
  143. def int_x86_3dnow_pfmin : ClangBuiltin<"__builtin_ia32_pfmin">,
  144. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  145. [IntrNoMem]>;
  146. def int_x86_3dnow_pfmul : ClangBuiltin<"__builtin_ia32_pfmul">,
  147. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  148. [IntrNoMem]>;
  149. def int_x86_3dnow_pfrcp : ClangBuiltin<"__builtin_ia32_pfrcp">,
  150. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  151. def int_x86_3dnow_pfrcpit1 : ClangBuiltin<"__builtin_ia32_pfrcpit1">,
  152. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  153. [IntrNoMem]>;
  154. def int_x86_3dnow_pfrcpit2 : ClangBuiltin<"__builtin_ia32_pfrcpit2">,
  155. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  156. [IntrNoMem]>;
  157. def int_x86_3dnow_pfrsqrt : ClangBuiltin<"__builtin_ia32_pfrsqrt">,
  158. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  159. def int_x86_3dnow_pfrsqit1 : ClangBuiltin<"__builtin_ia32_pfrsqit1">,
  160. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  161. [IntrNoMem]>;
  162. def int_x86_3dnow_pfsub : ClangBuiltin<"__builtin_ia32_pfsub">,
  163. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  164. [IntrNoMem]>;
  165. def int_x86_3dnow_pfsubr : ClangBuiltin<"__builtin_ia32_pfsubr">,
  166. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  167. [IntrNoMem]>;
  168. def int_x86_3dnow_pi2fd : ClangBuiltin<"__builtin_ia32_pi2fd">,
  169. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  170. def int_x86_3dnow_pmulhrw : ClangBuiltin<"__builtin_ia32_pmulhrw">,
  171. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  172. [IntrNoMem]>;
  173. }
  174. //===----------------------------------------------------------------------===//
  175. // 3DNow! extensions
  176. let TargetPrefix = "x86" in {
  177. def int_x86_3dnowa_pf2iw : ClangBuiltin<"__builtin_ia32_pf2iw">,
  178. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  179. def int_x86_3dnowa_pfnacc : ClangBuiltin<"__builtin_ia32_pfnacc">,
  180. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  181. [IntrNoMem]>;
  182. def int_x86_3dnowa_pfpnacc : ClangBuiltin<"__builtin_ia32_pfpnacc">,
  183. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  184. [IntrNoMem]>;
  185. def int_x86_3dnowa_pi2fw : ClangBuiltin<"__builtin_ia32_pi2fw">,
  186. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  187. def int_x86_3dnowa_pswapd :
  188. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  189. }
  190. //===----------------------------------------------------------------------===//
  191. // SSE1
  192. // Arithmetic ops
  193. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  194. def int_x86_sse_rcp_ss : ClangBuiltin<"__builtin_ia32_rcpss">,
  195. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
  196. [IntrNoMem]>;
  197. def int_x86_sse_rcp_ps : ClangBuiltin<"__builtin_ia32_rcpps">,
  198. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
  199. [IntrNoMem]>;
  200. def int_x86_sse_rsqrt_ss : ClangBuiltin<"__builtin_ia32_rsqrtss">,
  201. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
  202. [IntrNoMem]>;
  203. def int_x86_sse_rsqrt_ps : ClangBuiltin<"__builtin_ia32_rsqrtps">,
  204. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
  205. [IntrNoMem]>;
  206. def int_x86_sse_min_ss : ClangBuiltin<"__builtin_ia32_minss">,
  207. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  208. llvm_v4f32_ty], [IntrNoMem]>;
  209. def int_x86_sse_min_ps : ClangBuiltin<"__builtin_ia32_minps">,
  210. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  211. llvm_v4f32_ty], [IntrNoMem]>;
  212. def int_x86_sse_max_ss : ClangBuiltin<"__builtin_ia32_maxss">,
  213. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  214. llvm_v4f32_ty], [IntrNoMem]>;
  215. def int_x86_sse_max_ps : ClangBuiltin<"__builtin_ia32_maxps">,
  216. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  217. llvm_v4f32_ty], [IntrNoMem]>;
  218. }
  219. // Comparison ops
  220. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  221. def int_x86_sse_cmp_ss : ClangBuiltin<"__builtin_ia32_cmpss">,
  222. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  223. llvm_v4f32_ty, llvm_i8_ty],
  224. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  225. // NOTE: This comparison intrinsic is not used by clang as long as the
  226. // distinction in signaling behaviour is not implemented.
  227. def int_x86_sse_cmp_ps :
  228. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  229. llvm_v4f32_ty, llvm_i8_ty],
  230. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  231. def int_x86_sse_comieq_ss : ClangBuiltin<"__builtin_ia32_comieq">,
  232. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  233. llvm_v4f32_ty], [IntrNoMem]>;
  234. def int_x86_sse_comilt_ss : ClangBuiltin<"__builtin_ia32_comilt">,
  235. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  236. llvm_v4f32_ty], [IntrNoMem]>;
  237. def int_x86_sse_comile_ss : ClangBuiltin<"__builtin_ia32_comile">,
  238. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  239. llvm_v4f32_ty], [IntrNoMem]>;
  240. def int_x86_sse_comigt_ss : ClangBuiltin<"__builtin_ia32_comigt">,
  241. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  242. llvm_v4f32_ty], [IntrNoMem]>;
  243. def int_x86_sse_comige_ss : ClangBuiltin<"__builtin_ia32_comige">,
  244. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  245. llvm_v4f32_ty], [IntrNoMem]>;
  246. def int_x86_sse_comineq_ss : ClangBuiltin<"__builtin_ia32_comineq">,
  247. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  248. llvm_v4f32_ty], [IntrNoMem]>;
  249. def int_x86_sse_ucomieq_ss : ClangBuiltin<"__builtin_ia32_ucomieq">,
  250. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  251. llvm_v4f32_ty], [IntrNoMem]>;
  252. def int_x86_sse_ucomilt_ss : ClangBuiltin<"__builtin_ia32_ucomilt">,
  253. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  254. llvm_v4f32_ty], [IntrNoMem]>;
  255. def int_x86_sse_ucomile_ss : ClangBuiltin<"__builtin_ia32_ucomile">,
  256. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  257. llvm_v4f32_ty], [IntrNoMem]>;
  258. def int_x86_sse_ucomigt_ss : ClangBuiltin<"__builtin_ia32_ucomigt">,
  259. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  260. llvm_v4f32_ty], [IntrNoMem]>;
  261. def int_x86_sse_ucomige_ss : ClangBuiltin<"__builtin_ia32_ucomige">,
  262. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  263. llvm_v4f32_ty], [IntrNoMem]>;
  264. def int_x86_sse_ucomineq_ss : ClangBuiltin<"__builtin_ia32_ucomineq">,
  265. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  266. llvm_v4f32_ty], [IntrNoMem]>;
  267. }
  268. // Conversion ops
  269. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  270. def int_x86_sse_cvtss2si : ClangBuiltin<"__builtin_ia32_cvtss2si">,
  271. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  272. def int_x86_sse_cvtss2si64 : ClangBuiltin<"__builtin_ia32_cvtss2si64">,
  273. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  274. def int_x86_sse_cvttss2si : ClangBuiltin<"__builtin_ia32_cvttss2si">,
  275. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  276. def int_x86_sse_cvttss2si64 : ClangBuiltin<"__builtin_ia32_cvttss2si64">,
  277. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  278. def int_x86_sse_cvtps2pi : ClangBuiltin<"__builtin_ia32_cvtps2pi">,
  279. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  280. def int_x86_sse_cvttps2pi: ClangBuiltin<"__builtin_ia32_cvttps2pi">,
  281. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  282. def int_x86_sse_cvtpi2ps : ClangBuiltin<"__builtin_ia32_cvtpi2ps">,
  283. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  284. llvm_x86mmx_ty], [IntrNoMem]>;
  285. }
  286. // Cacheability support ops
  287. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  288. def int_x86_sse_sfence : ClangBuiltin<"__builtin_ia32_sfence">,
  289. Intrinsic<[], [], []>;
  290. }
  291. // Control register.
  292. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  293. def int_x86_sse_stmxcsr :
  294. Intrinsic<[], [llvm_ptr_ty],
  295. [IntrWriteMem, IntrArgMemOnly,
  296. // This prevents reordering with ldmxcsr
  297. IntrHasSideEffects]>;
  298. def int_x86_sse_ldmxcsr :
  299. Intrinsic<[], [llvm_ptr_ty],
  300. // FIXME: LDMXCSR does not actually write to memory,
  301. // but intrinsic properties are generated incorrectly
  302. // for IntrReadMem+IntrHasSideEffects.
  303. [/*IntrReadMem, IntrArgMemOnly,*/ IntrHasSideEffects]>;
  304. }
  305. // Misc.
  306. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  307. def int_x86_sse_movmsk_ps : ClangBuiltin<"__builtin_ia32_movmskps">,
  308. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  309. }
  310. //===----------------------------------------------------------------------===//
  311. // SSE2
  312. // FP arithmetic ops
  313. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  314. def int_x86_sse2_min_sd : ClangBuiltin<"__builtin_ia32_minsd">,
  315. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
  316. llvm_v2f64_ty], [IntrNoMem]>;
  317. def int_x86_sse2_min_pd : ClangBuiltin<"__builtin_ia32_minpd">,
  318. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
  319. llvm_v2f64_ty], [IntrNoMem]>;
  320. def int_x86_sse2_max_sd : ClangBuiltin<"__builtin_ia32_maxsd">,
  321. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
  322. llvm_v2f64_ty], [IntrNoMem]>;
  323. def int_x86_sse2_max_pd : ClangBuiltin<"__builtin_ia32_maxpd">,
  324. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
  325. llvm_v2f64_ty], [IntrNoMem]>;
  326. }
  327. // FP comparison ops
  328. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  329. def int_x86_sse2_cmp_sd : ClangBuiltin<"__builtin_ia32_cmpsd">,
  330. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
  331. llvm_v2f64_ty, llvm_i8_ty],
  332. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  333. // NOTE: This comparison intrinsic is not used by clang as long as the
  334. // distinction in signaling behaviour is not implemented.
  335. def int_x86_sse2_cmp_pd :
  336. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
  337. llvm_v2f64_ty, llvm_i8_ty],
  338. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  339. def int_x86_sse2_comieq_sd : ClangBuiltin<"__builtin_ia32_comisdeq">,
  340. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  341. llvm_v2f64_ty], [IntrNoMem]>;
  342. def int_x86_sse2_comilt_sd : ClangBuiltin<"__builtin_ia32_comisdlt">,
  343. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  344. llvm_v2f64_ty], [IntrNoMem]>;
  345. def int_x86_sse2_comile_sd : ClangBuiltin<"__builtin_ia32_comisdle">,
  346. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  347. llvm_v2f64_ty], [IntrNoMem]>;
  348. def int_x86_sse2_comigt_sd : ClangBuiltin<"__builtin_ia32_comisdgt">,
  349. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  350. llvm_v2f64_ty], [IntrNoMem]>;
  351. def int_x86_sse2_comige_sd : ClangBuiltin<"__builtin_ia32_comisdge">,
  352. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  353. llvm_v2f64_ty], [IntrNoMem]>;
  354. def int_x86_sse2_comineq_sd : ClangBuiltin<"__builtin_ia32_comisdneq">,
  355. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  356. llvm_v2f64_ty], [IntrNoMem]>;
  357. def int_x86_sse2_ucomieq_sd : ClangBuiltin<"__builtin_ia32_ucomisdeq">,
  358. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  359. llvm_v2f64_ty], [IntrNoMem]>;
  360. def int_x86_sse2_ucomilt_sd : ClangBuiltin<"__builtin_ia32_ucomisdlt">,
  361. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  362. llvm_v2f64_ty], [IntrNoMem]>;
  363. def int_x86_sse2_ucomile_sd : ClangBuiltin<"__builtin_ia32_ucomisdle">,
  364. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  365. llvm_v2f64_ty], [IntrNoMem]>;
  366. def int_x86_sse2_ucomigt_sd : ClangBuiltin<"__builtin_ia32_ucomisdgt">,
  367. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  368. llvm_v2f64_ty], [IntrNoMem]>;
  369. def int_x86_sse2_ucomige_sd : ClangBuiltin<"__builtin_ia32_ucomisdge">,
  370. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  371. llvm_v2f64_ty], [IntrNoMem]>;
  372. def int_x86_sse2_ucomineq_sd : ClangBuiltin<"__builtin_ia32_ucomisdneq">,
  373. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  374. llvm_v2f64_ty], [IntrNoMem]>;
  375. }
  376. // Integer arithmetic ops.
  377. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  378. def int_x86_sse2_pmulhu_w : ClangBuiltin<"__builtin_ia32_pmulhuw128">,
  379. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  380. llvm_v8i16_ty], [IntrNoMem, Commutative]>;
  381. def int_x86_sse2_pmulh_w : ClangBuiltin<"__builtin_ia32_pmulhw128">,
  382. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  383. llvm_v8i16_ty], [IntrNoMem, Commutative]>;
  384. def int_x86_sse2_pmadd_wd : ClangBuiltin<"__builtin_ia32_pmaddwd128">,
  385. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty,
  386. llvm_v8i16_ty], [IntrNoMem, Commutative]>;
  387. def int_x86_sse2_pavg_b : ClangBuiltin<"__builtin_ia32_pavgb128">,
  388. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
  389. llvm_v16i8_ty], [IntrNoMem, Commutative]>;
  390. def int_x86_sse2_pavg_w : ClangBuiltin<"__builtin_ia32_pavgw128">,
  391. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  392. llvm_v8i16_ty], [IntrNoMem, Commutative]>;
  393. def int_x86_sse2_psad_bw : ClangBuiltin<"__builtin_ia32_psadbw128">,
  394. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty,
  395. llvm_v16i8_ty], [IntrNoMem, Commutative]>;
  396. }
  397. // Integer shift ops.
  398. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  399. def int_x86_sse2_psll_w : ClangBuiltin<"__builtin_ia32_psllw128">,
  400. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  401. llvm_v8i16_ty], [IntrNoMem]>;
  402. def int_x86_sse2_psll_d : ClangBuiltin<"__builtin_ia32_pslld128">,
  403. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
  404. llvm_v4i32_ty], [IntrNoMem]>;
  405. def int_x86_sse2_psll_q : ClangBuiltin<"__builtin_ia32_psllq128">,
  406. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
  407. llvm_v2i64_ty], [IntrNoMem]>;
  408. def int_x86_sse2_psrl_w : ClangBuiltin<"__builtin_ia32_psrlw128">,
  409. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  410. llvm_v8i16_ty], [IntrNoMem]>;
  411. def int_x86_sse2_psrl_d : ClangBuiltin<"__builtin_ia32_psrld128">,
  412. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
  413. llvm_v4i32_ty], [IntrNoMem]>;
  414. def int_x86_sse2_psrl_q : ClangBuiltin<"__builtin_ia32_psrlq128">,
  415. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
  416. llvm_v2i64_ty], [IntrNoMem]>;
  417. def int_x86_sse2_psra_w : ClangBuiltin<"__builtin_ia32_psraw128">,
  418. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  419. llvm_v8i16_ty], [IntrNoMem]>;
  420. def int_x86_sse2_psra_d : ClangBuiltin<"__builtin_ia32_psrad128">,
  421. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
  422. llvm_v4i32_ty], [IntrNoMem]>;
  423. // Oddly these don't require an immediate due to a gcc compatibility issue.
  424. def int_x86_sse2_pslli_w : ClangBuiltin<"__builtin_ia32_psllwi128">,
  425. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  426. llvm_i32_ty], [IntrNoMem]>;
  427. def int_x86_sse2_pslli_d : ClangBuiltin<"__builtin_ia32_pslldi128">,
  428. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
  429. llvm_i32_ty], [IntrNoMem]>;
  430. def int_x86_sse2_pslli_q : ClangBuiltin<"__builtin_ia32_psllqi128">,
  431. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
  432. llvm_i32_ty], [IntrNoMem]>;
  433. def int_x86_sse2_psrli_w : ClangBuiltin<"__builtin_ia32_psrlwi128">,
  434. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  435. llvm_i32_ty], [IntrNoMem]>;
  436. def int_x86_sse2_psrli_d : ClangBuiltin<"__builtin_ia32_psrldi128">,
  437. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
  438. llvm_i32_ty], [IntrNoMem]>;
  439. def int_x86_sse2_psrli_q : ClangBuiltin<"__builtin_ia32_psrlqi128">,
  440. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
  441. llvm_i32_ty], [IntrNoMem]>;
  442. def int_x86_sse2_psrai_w : ClangBuiltin<"__builtin_ia32_psrawi128">,
  443. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  444. llvm_i32_ty], [IntrNoMem]>;
  445. def int_x86_sse2_psrai_d : ClangBuiltin<"__builtin_ia32_psradi128">,
  446. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
  447. llvm_i32_ty], [IntrNoMem]>;
  448. }
  449. // Conversion ops
  450. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  451. def int_x86_sse2_cvtpd2dq : ClangBuiltin<"__builtin_ia32_cvtpd2dq">,
  452. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  453. def int_x86_sse2_cvttpd2dq : ClangBuiltin<"__builtin_ia32_cvttpd2dq">,
  454. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  455. def int_x86_sse2_cvtpd2ps : ClangBuiltin<"__builtin_ia32_cvtpd2ps">,
  456. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  457. def int_x86_sse2_cvtps2dq : ClangBuiltin<"__builtin_ia32_cvtps2dq">,
  458. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  459. def int_x86_sse2_cvttps2dq : ClangBuiltin<"__builtin_ia32_cvttps2dq">,
  460. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  461. def int_x86_sse2_cvtsd2si : ClangBuiltin<"__builtin_ia32_cvtsd2si">,
  462. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  463. def int_x86_sse2_cvtsd2si64 : ClangBuiltin<"__builtin_ia32_cvtsd2si64">,
  464. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  465. def int_x86_sse2_cvttsd2si : ClangBuiltin<"__builtin_ia32_cvttsd2si">,
  466. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  467. def int_x86_sse2_cvttsd2si64 : ClangBuiltin<"__builtin_ia32_cvttsd2si64">,
  468. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  469. def int_x86_sse2_cvtsd2ss : ClangBuiltin<"__builtin_ia32_cvtsd2ss">,
  470. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  471. llvm_v2f64_ty], [IntrNoMem]>;
  472. def int_x86_sse_cvtpd2pi : ClangBuiltin<"__builtin_ia32_cvtpd2pi">,
  473. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  474. def int_x86_sse_cvttpd2pi: ClangBuiltin<"__builtin_ia32_cvttpd2pi">,
  475. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  476. def int_x86_sse_cvtpi2pd : ClangBuiltin<"__builtin_ia32_cvtpi2pd">,
  477. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  478. }
  479. // Misc.
  480. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  481. def int_x86_sse2_packsswb_128 : ClangBuiltin<"__builtin_ia32_packsswb128">,
  482. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty,
  483. llvm_v8i16_ty], [IntrNoMem]>;
  484. def int_x86_sse2_packssdw_128 : ClangBuiltin<"__builtin_ia32_packssdw128">,
  485. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty,
  486. llvm_v4i32_ty], [IntrNoMem]>;
  487. def int_x86_sse2_packuswb_128 : ClangBuiltin<"__builtin_ia32_packuswb128">,
  488. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty,
  489. llvm_v8i16_ty], [IntrNoMem]>;
  490. def int_x86_sse2_movmsk_pd : ClangBuiltin<"__builtin_ia32_movmskpd">,
  491. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  492. def int_x86_sse2_pmovmskb_128 : ClangBuiltin<"__builtin_ia32_pmovmskb128">,
  493. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
  494. def int_x86_sse2_maskmov_dqu : ClangBuiltin<"__builtin_ia32_maskmovdqu">,
  495. Intrinsic<[], [llvm_v16i8_ty,
  496. llvm_v16i8_ty, llvm_ptr_ty], []>;
  497. def int_x86_sse2_clflush : ClangBuiltin<"__builtin_ia32_clflush">,
  498. Intrinsic<[], [llvm_ptr_ty], []>;
  499. def int_x86_sse2_lfence : ClangBuiltin<"__builtin_ia32_lfence">,
  500. Intrinsic<[], [], []>;
  501. def int_x86_sse2_mfence : ClangBuiltin<"__builtin_ia32_mfence">,
  502. Intrinsic<[], [], []>;
  503. def int_x86_sse2_pause : ClangBuiltin<"__builtin_ia32_pause">,
  504. Intrinsic<[], [], []>;
  505. }
  506. //===----------------------------------------------------------------------===//
  507. // SSE3
  508. // Addition / subtraction ops.
  509. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  510. def int_x86_sse3_addsub_ps : ClangBuiltin<"__builtin_ia32_addsubps">,
  511. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  512. llvm_v4f32_ty], [IntrNoMem]>;
  513. def int_x86_sse3_addsub_pd : ClangBuiltin<"__builtin_ia32_addsubpd">,
  514. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
  515. llvm_v2f64_ty], [IntrNoMem]>;
  516. }
  517. // Horizontal ops.
  518. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  519. def int_x86_sse3_hadd_ps : ClangBuiltin<"__builtin_ia32_haddps">,
  520. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  521. llvm_v4f32_ty], [IntrNoMem]>;
  522. def int_x86_sse3_hadd_pd : ClangBuiltin<"__builtin_ia32_haddpd">,
  523. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
  524. llvm_v2f64_ty], [IntrNoMem]>;
  525. def int_x86_sse3_hsub_ps : ClangBuiltin<"__builtin_ia32_hsubps">,
  526. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  527. llvm_v4f32_ty], [IntrNoMem]>;
  528. def int_x86_sse3_hsub_pd : ClangBuiltin<"__builtin_ia32_hsubpd">,
  529. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
  530. llvm_v2f64_ty], [IntrNoMem]>;
  531. }
  532. // Specialized unaligned load.
  533. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  534. def int_x86_sse3_ldu_dq : ClangBuiltin<"__builtin_ia32_lddqu">,
  535. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
  536. }
  537. // Thread synchronization ops.
  538. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  539. def int_x86_sse3_monitor : ClangBuiltin<"__builtin_ia32_monitor">,
  540. Intrinsic<[], [llvm_ptr_ty,
  541. llvm_i32_ty, llvm_i32_ty], []>;
  542. def int_x86_sse3_mwait : ClangBuiltin<"__builtin_ia32_mwait">,
  543. Intrinsic<[], [llvm_i32_ty,
  544. llvm_i32_ty], []>;
  545. }
  546. //===----------------------------------------------------------------------===//
  547. // SSSE3
  548. // Horizontal arithmetic ops
  549. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  550. def int_x86_ssse3_phadd_w : ClangBuiltin<"__builtin_ia32_phaddw">,
  551. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  552. llvm_x86mmx_ty], [IntrNoMem]>;
  553. def int_x86_ssse3_phadd_w_128 : ClangBuiltin<"__builtin_ia32_phaddw128">,
  554. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  555. llvm_v8i16_ty], [IntrNoMem]>;
  556. def int_x86_ssse3_phadd_d : ClangBuiltin<"__builtin_ia32_phaddd">,
  557. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  558. llvm_x86mmx_ty], [IntrNoMem]>;
  559. def int_x86_ssse3_phadd_d_128 : ClangBuiltin<"__builtin_ia32_phaddd128">,
  560. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
  561. llvm_v4i32_ty], [IntrNoMem]>;
  562. def int_x86_ssse3_phadd_sw : ClangBuiltin<"__builtin_ia32_phaddsw">,
  563. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  564. llvm_x86mmx_ty], [IntrNoMem]>;
  565. def int_x86_ssse3_phadd_sw_128 : ClangBuiltin<"__builtin_ia32_phaddsw128">,
  566. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  567. llvm_v8i16_ty], [IntrNoMem]>;
  568. def int_x86_ssse3_phsub_w : ClangBuiltin<"__builtin_ia32_phsubw">,
  569. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  570. llvm_x86mmx_ty], [IntrNoMem]>;
  571. def int_x86_ssse3_phsub_w_128 : ClangBuiltin<"__builtin_ia32_phsubw128">,
  572. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  573. llvm_v8i16_ty], [IntrNoMem]>;
  574. def int_x86_ssse3_phsub_d : ClangBuiltin<"__builtin_ia32_phsubd">,
  575. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  576. llvm_x86mmx_ty], [IntrNoMem]>;
  577. def int_x86_ssse3_phsub_d_128 : ClangBuiltin<"__builtin_ia32_phsubd128">,
  578. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
  579. llvm_v4i32_ty], [IntrNoMem]>;
  580. def int_x86_ssse3_phsub_sw : ClangBuiltin<"__builtin_ia32_phsubsw">,
  581. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  582. llvm_x86mmx_ty], [IntrNoMem]>;
  583. def int_x86_ssse3_phsub_sw_128 : ClangBuiltin<"__builtin_ia32_phsubsw128">,
  584. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  585. llvm_v8i16_ty], [IntrNoMem]>;
  586. def int_x86_ssse3_pmadd_ub_sw : ClangBuiltin<"__builtin_ia32_pmaddubsw">,
  587. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  588. llvm_x86mmx_ty], [IntrNoMem]>;
  589. def int_x86_ssse3_pmadd_ub_sw_128 : ClangBuiltin<"__builtin_ia32_pmaddubsw128">,
  590. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty,
  591. llvm_v16i8_ty], [IntrNoMem]>;
  592. }
  593. // Packed multiply high with round and scale
  594. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  595. def int_x86_ssse3_pmul_hr_sw : ClangBuiltin<"__builtin_ia32_pmulhrsw">,
  596. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  597. llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
  598. def int_x86_ssse3_pmul_hr_sw_128 : ClangBuiltin<"__builtin_ia32_pmulhrsw128">,
  599. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  600. llvm_v8i16_ty], [IntrNoMem, Commutative]>;
  601. }
  602. // Shuffle ops
  603. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  604. def int_x86_ssse3_pshuf_b : ClangBuiltin<"__builtin_ia32_pshufb">,
  605. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  606. llvm_x86mmx_ty], [IntrNoMem]>;
  607. def int_x86_ssse3_pshuf_b_128 : ClangBuiltin<"__builtin_ia32_pshufb128">,
  608. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
  609. llvm_v16i8_ty], [IntrNoMem]>;
  610. def int_x86_sse_pshuf_w : ClangBuiltin<"__builtin_ia32_pshufw">,
  611. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i8_ty],
  612. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  613. }
  614. // Sign ops
  615. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  616. def int_x86_ssse3_psign_b : ClangBuiltin<"__builtin_ia32_psignb">,
  617. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  618. llvm_x86mmx_ty], [IntrNoMem]>;
  619. def int_x86_ssse3_psign_b_128 : ClangBuiltin<"__builtin_ia32_psignb128">,
  620. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
  621. llvm_v16i8_ty], [IntrNoMem]>;
  622. def int_x86_ssse3_psign_w : ClangBuiltin<"__builtin_ia32_psignw">,
  623. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  624. llvm_x86mmx_ty], [IntrNoMem]>;
  625. def int_x86_ssse3_psign_w_128 : ClangBuiltin<"__builtin_ia32_psignw128">,
  626. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
  627. llvm_v8i16_ty], [IntrNoMem]>;
  628. def int_x86_ssse3_psign_d : ClangBuiltin<"__builtin_ia32_psignd">,
  629. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
  630. llvm_x86mmx_ty], [IntrNoMem]>;
  631. def int_x86_ssse3_psign_d_128 : ClangBuiltin<"__builtin_ia32_psignd128">,
  632. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
  633. llvm_v4i32_ty], [IntrNoMem]>;
  634. }
  635. // Absolute value ops
  636. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  637. def int_x86_ssse3_pabs_b : ClangBuiltin<"__builtin_ia32_pabsb">,
  638. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  639. def int_x86_ssse3_pabs_w : ClangBuiltin<"__builtin_ia32_pabsw">,
  640. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  641. def int_x86_ssse3_pabs_d : ClangBuiltin<"__builtin_ia32_pabsd">,
  642. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  643. }
  644. //===----------------------------------------------------------------------===//
  645. // SSE4.1
  646. // FP rounding ops
  647. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  648. def int_x86_sse41_round_ss : ClangBuiltin<"__builtin_ia32_roundss">,
  649. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
  650. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  651. def int_x86_sse41_round_ps : ClangBuiltin<"__builtin_ia32_roundps">,
  652. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
  653. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  654. def int_x86_sse41_round_sd : ClangBuiltin<"__builtin_ia32_roundsd">,
  655. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
  656. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  657. def int_x86_sse41_round_pd : ClangBuiltin<"__builtin_ia32_roundpd">,
  658. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
  659. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  660. }
  661. // Vector min element
  662. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  663. def int_x86_sse41_phminposuw : ClangBuiltin<"__builtin_ia32_phminposuw128">,
  664. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty], [IntrNoMem]>;
  665. }
  666. // Advanced Encryption Standard (AES) Instructions
  667. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  668. def int_x86_aesni_aesimc : ClangBuiltin<"__builtin_ia32_aesimc128">,
  669. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
  670. def int_x86_aesni_aesenc : ClangBuiltin<"__builtin_ia32_aesenc128">,
  671. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  672. [IntrNoMem]>;
  673. def int_x86_aesni_aesenc_256 : ClangBuiltin<"__builtin_ia32_aesenc256">,
  674. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  675. [IntrNoMem]>;
  676. def int_x86_aesni_aesenc_512 : ClangBuiltin<"__builtin_ia32_aesenc512">,
  677. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
  678. [IntrNoMem]>;
  679. def int_x86_aesni_aesenclast : ClangBuiltin<"__builtin_ia32_aesenclast128">,
  680. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  681. [IntrNoMem]>;
  682. def int_x86_aesni_aesenclast_256 :
  683. ClangBuiltin<"__builtin_ia32_aesenclast256">,
  684. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  685. [IntrNoMem]>;
  686. def int_x86_aesni_aesenclast_512 :
  687. ClangBuiltin<"__builtin_ia32_aesenclast512">,
  688. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
  689. [IntrNoMem]>;
  690. def int_x86_aesni_aesdec : ClangBuiltin<"__builtin_ia32_aesdec128">,
  691. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  692. [IntrNoMem]>;
  693. def int_x86_aesni_aesdec_256 : ClangBuiltin<"__builtin_ia32_aesdec256">,
  694. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  695. [IntrNoMem]>;
  696. def int_x86_aesni_aesdec_512 : ClangBuiltin<"__builtin_ia32_aesdec512">,
  697. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
  698. [IntrNoMem]>;
  699. def int_x86_aesni_aesdeclast : ClangBuiltin<"__builtin_ia32_aesdeclast128">,
  700. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  701. [IntrNoMem]>;
  702. def int_x86_aesni_aesdeclast_256 :
  703. ClangBuiltin<"__builtin_ia32_aesdeclast256">,
  704. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  705. [IntrNoMem]>;
  706. def int_x86_aesni_aesdeclast_512 :
  707. ClangBuiltin<"__builtin_ia32_aesdeclast512">,
  708. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
  709. [IntrNoMem]>;
  710. def int_x86_aesni_aeskeygenassist :
  711. ClangBuiltin<"__builtin_ia32_aeskeygenassist128">,
  712. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i8_ty],
  713. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  714. }
  715. // PCLMUL instructions
  716. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  717. def int_x86_pclmulqdq : ClangBuiltin<"__builtin_ia32_pclmulqdq128">,
  718. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  719. [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
  720. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  721. def int_x86_pclmulqdq_256 : ClangBuiltin<"__builtin_ia32_pclmulqdq256">,
  722. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  723. [llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
  724. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  725. def int_x86_pclmulqdq_512 : ClangBuiltin<"__builtin_ia32_pclmulqdq512">,
  726. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  727. [llvm_v8i64_ty, llvm_v8i64_ty, llvm_i8_ty],
  728. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  729. }
  730. // Vector pack
  731. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  732. def int_x86_sse41_packusdw : ClangBuiltin<"__builtin_ia32_packusdw128">,
  733. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  734. [IntrNoMem]>;
  735. }
  736. // Vector insert
  737. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  738. def int_x86_sse41_insertps : ClangBuiltin<"__builtin_ia32_insertps128">,
  739. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  740. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
  741. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  742. }
  743. // Vector blend
  744. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  745. def int_x86_sse41_pblendvb : ClangBuiltin<"__builtin_ia32_pblendvb128">,
  746. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  747. [llvm_v16i8_ty, llvm_v16i8_ty,llvm_v16i8_ty],
  748. [IntrNoMem]>;
  749. def int_x86_sse41_blendvpd : ClangBuiltin<"__builtin_ia32_blendvpd">,
  750. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  751. [llvm_v2f64_ty, llvm_v2f64_ty,llvm_v2f64_ty],
  752. [IntrNoMem]>;
  753. def int_x86_sse41_blendvps : ClangBuiltin<"__builtin_ia32_blendvps">,
  754. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  755. [llvm_v4f32_ty, llvm_v4f32_ty,llvm_v4f32_ty],
  756. [IntrNoMem]>;
  757. }
  758. // Vector dot product
  759. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  760. def int_x86_sse41_dppd : ClangBuiltin<"__builtin_ia32_dppd">,
  761. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  762. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
  763. [IntrNoMem, Commutative, ImmArg<ArgIndex<2>>]>;
  764. def int_x86_sse41_dpps : ClangBuiltin<"__builtin_ia32_dpps">,
  765. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  766. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
  767. [IntrNoMem, Commutative, ImmArg<ArgIndex<2>>]>;
  768. }
  769. // Vector sum of absolute differences
  770. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  771. def int_x86_sse41_mpsadbw : ClangBuiltin<"__builtin_ia32_mpsadbw128">,
  772. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  773. [llvm_v16i8_ty, llvm_v16i8_ty,llvm_i8_ty],
  774. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  775. }
  776. // Test instruction with bitwise comparison.
  777. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  778. def int_x86_sse41_ptestz : ClangBuiltin<"__builtin_ia32_ptestz128">,
  779. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  780. [IntrNoMem]>;
  781. def int_x86_sse41_ptestc : ClangBuiltin<"__builtin_ia32_ptestc128">,
  782. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  783. [IntrNoMem]>;
  784. def int_x86_sse41_ptestnzc : ClangBuiltin<"__builtin_ia32_ptestnzc128">,
  785. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  786. [IntrNoMem]>;
  787. }
  788. //===----------------------------------------------------------------------===//
  789. // SSE4.2
  790. // Miscellaneous
  791. // CRC Instruction
  792. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  793. def int_x86_sse42_crc32_32_8 : ClangBuiltin<"__builtin_ia32_crc32qi">,
  794. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i8_ty],
  795. [IntrNoMem]>;
  796. def int_x86_sse42_crc32_32_16 : ClangBuiltin<"__builtin_ia32_crc32hi">,
  797. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i16_ty],
  798. [IntrNoMem]>;
  799. def int_x86_sse42_crc32_32_32 : ClangBuiltin<"__builtin_ia32_crc32si">,
  800. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  801. [IntrNoMem]>;
  802. def int_x86_sse42_crc32_64_64 : ClangBuiltin<"__builtin_ia32_crc32di">,
  803. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
  804. [IntrNoMem]>;
  805. }
  806. // String/text processing ops.
  807. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  808. def int_x86_sse42_pcmpistrm128 : ClangBuiltin<"__builtin_ia32_pcmpistrm128">,
  809. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  810. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
  811. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  812. def int_x86_sse42_pcmpistri128 : ClangBuiltin<"__builtin_ia32_pcmpistri128">,
  813. DefaultAttrsIntrinsic<[llvm_i32_ty],
  814. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
  815. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  816. def int_x86_sse42_pcmpistria128 : ClangBuiltin<"__builtin_ia32_pcmpistria128">,
  817. DefaultAttrsIntrinsic<[llvm_i32_ty],
  818. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
  819. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  820. def int_x86_sse42_pcmpistric128 : ClangBuiltin<"__builtin_ia32_pcmpistric128">,
  821. DefaultAttrsIntrinsic<[llvm_i32_ty],
  822. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
  823. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  824. def int_x86_sse42_pcmpistrio128 : ClangBuiltin<"__builtin_ia32_pcmpistrio128">,
  825. DefaultAttrsIntrinsic<[llvm_i32_ty],
  826. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
  827. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  828. def int_x86_sse42_pcmpistris128 : ClangBuiltin<"__builtin_ia32_pcmpistris128">,
  829. DefaultAttrsIntrinsic<[llvm_i32_ty],
  830. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
  831. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  832. def int_x86_sse42_pcmpistriz128 : ClangBuiltin<"__builtin_ia32_pcmpistriz128">,
  833. DefaultAttrsIntrinsic<[llvm_i32_ty],
  834. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
  835. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  836. def int_x86_sse42_pcmpestrm128 : ClangBuiltin<"__builtin_ia32_pcmpestrm128">,
  837. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  838. [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
  839. llvm_i8_ty],
  840. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  841. def int_x86_sse42_pcmpestri128 : ClangBuiltin<"__builtin_ia32_pcmpestri128">,
  842. DefaultAttrsIntrinsic<[llvm_i32_ty],
  843. [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
  844. llvm_i8_ty],
  845. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  846. def int_x86_sse42_pcmpestria128 : ClangBuiltin<"__builtin_ia32_pcmpestria128">,
  847. DefaultAttrsIntrinsic<[llvm_i32_ty],
  848. [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
  849. llvm_i8_ty],
  850. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  851. def int_x86_sse42_pcmpestric128 : ClangBuiltin<"__builtin_ia32_pcmpestric128">,
  852. DefaultAttrsIntrinsic<[llvm_i32_ty],
  853. [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
  854. llvm_i8_ty],
  855. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  856. def int_x86_sse42_pcmpestrio128 : ClangBuiltin<"__builtin_ia32_pcmpestrio128">,
  857. DefaultAttrsIntrinsic<[llvm_i32_ty],
  858. [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
  859. llvm_i8_ty],
  860. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  861. def int_x86_sse42_pcmpestris128 : ClangBuiltin<"__builtin_ia32_pcmpestris128">,
  862. DefaultAttrsIntrinsic<[llvm_i32_ty],
  863. [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
  864. llvm_i8_ty],
  865. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  866. def int_x86_sse42_pcmpestriz128 : ClangBuiltin<"__builtin_ia32_pcmpestriz128">,
  867. DefaultAttrsIntrinsic<[llvm_i32_ty],
  868. [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
  869. llvm_i8_ty],
  870. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  871. }
  872. //===----------------------------------------------------------------------===//
  873. // SSE4A
  874. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  875. def int_x86_sse4a_extrqi : ClangBuiltin<"__builtin_ia32_extrqi">,
  876. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  877. [llvm_v2i64_ty, llvm_i8_ty, llvm_i8_ty],
  878. [IntrNoMem, ImmArg<ArgIndex<1>>,
  879. ImmArg<ArgIndex<2>>]>;
  880. def int_x86_sse4a_extrq : ClangBuiltin<"__builtin_ia32_extrq">,
  881. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v16i8_ty],
  882. [IntrNoMem]>;
  883. def int_x86_sse4a_insertqi : ClangBuiltin<"__builtin_ia32_insertqi">,
  884. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
  885. llvm_i8_ty, llvm_i8_ty],
  886. [IntrNoMem, ImmArg<ArgIndex<2>>,
  887. ImmArg<ArgIndex<3>>]>;
  888. def int_x86_sse4a_insertq : ClangBuiltin<"__builtin_ia32_insertq">,
  889. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  890. [IntrNoMem]>;
  891. }
  892. //===----------------------------------------------------------------------===//
  893. // AVX
  894. // Arithmetic ops
  895. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  896. def int_x86_avx_addsub_pd_256 : ClangBuiltin<"__builtin_ia32_addsubpd256">,
  897. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
  898. [IntrNoMem]>;
  899. def int_x86_avx_addsub_ps_256 : ClangBuiltin<"__builtin_ia32_addsubps256">,
  900. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
  901. [IntrNoMem]>;
  902. def int_x86_avx_max_pd_256 : ClangBuiltin<"__builtin_ia32_maxpd256">,
  903. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
  904. [IntrNoMem]>;
  905. def int_x86_avx_max_ps_256 : ClangBuiltin<"__builtin_ia32_maxps256">,
  906. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
  907. [IntrNoMem]>;
  908. def int_x86_avx_min_pd_256 : ClangBuiltin<"__builtin_ia32_minpd256">,
  909. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
  910. [IntrNoMem]>;
  911. def int_x86_avx_min_ps_256 : ClangBuiltin<"__builtin_ia32_minps256">,
  912. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
  913. [IntrNoMem]>;
  914. def int_x86_avx_rsqrt_ps_256 : ClangBuiltin<"__builtin_ia32_rsqrtps256">,
  915. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
  916. def int_x86_avx_rcp_ps_256 : ClangBuiltin<"__builtin_ia32_rcpps256">,
  917. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
  918. def int_x86_avx_round_pd_256 : ClangBuiltin<"__builtin_ia32_roundpd256">,
  919. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_i32_ty],
  920. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  921. def int_x86_avx_round_ps_256 : ClangBuiltin<"__builtin_ia32_roundps256">,
  922. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_i32_ty],
  923. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  924. }
  925. // Horizontal ops
  926. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  927. def int_x86_avx_hadd_pd_256 : ClangBuiltin<"__builtin_ia32_haddpd256">,
  928. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
  929. [IntrNoMem]>;
  930. def int_x86_avx_hsub_ps_256 : ClangBuiltin<"__builtin_ia32_hsubps256">,
  931. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
  932. [IntrNoMem]>;
  933. def int_x86_avx_hsub_pd_256 : ClangBuiltin<"__builtin_ia32_hsubpd256">,
  934. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
  935. [IntrNoMem]>;
  936. def int_x86_avx_hadd_ps_256 : ClangBuiltin<"__builtin_ia32_haddps256">,
  937. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
  938. [IntrNoMem]>;
  939. }
  940. // Vector permutation
  941. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  942. def int_x86_avx_vpermilvar_pd : ClangBuiltin<"__builtin_ia32_vpermilvarpd">,
  943. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2i64_ty],
  944. [IntrNoMem]>;
  945. def int_x86_avx_vpermilvar_ps : ClangBuiltin<"__builtin_ia32_vpermilvarps">,
  946. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4i32_ty],
  947. [IntrNoMem]>;
  948. def int_x86_avx_vpermilvar_pd_256 :
  949. ClangBuiltin<"__builtin_ia32_vpermilvarpd256">,
  950. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4i64_ty],
  951. [IntrNoMem]>;
  952. def int_x86_avx_vpermilvar_ps_256 :
  953. ClangBuiltin<"__builtin_ia32_vpermilvarps256">,
  954. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8i32_ty],
  955. [IntrNoMem]>;
  956. def int_x86_avx512_vpermi2var_d_128 :
  957. ClangBuiltin<"__builtin_ia32_vpermi2vard128">,
  958. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  959. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  960. [IntrNoMem]>;
  961. def int_x86_avx512_vpermi2var_d_256 :
  962. ClangBuiltin<"__builtin_ia32_vpermi2vard256">,
  963. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  964. [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
  965. [IntrNoMem]>;
  966. def int_x86_avx512_vpermi2var_d_512 :
  967. ClangBuiltin<"__builtin_ia32_vpermi2vard512">,
  968. DefaultAttrsIntrinsic<[llvm_v16i32_ty],
  969. [llvm_v16i32_ty, llvm_v16i32_ty, llvm_v16i32_ty],
  970. [IntrNoMem]>;
  971. def int_x86_avx512_vpermi2var_hi_128 :
  972. ClangBuiltin<"__builtin_ia32_vpermi2varhi128">,
  973. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  974. [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
  975. [IntrNoMem]>;
  976. def int_x86_avx512_vpermi2var_hi_256 :
  977. ClangBuiltin<"__builtin_ia32_vpermi2varhi256">,
  978. DefaultAttrsIntrinsic<[llvm_v16i16_ty],
  979. [llvm_v16i16_ty, llvm_v16i16_ty, llvm_v16i16_ty],
  980. [IntrNoMem]>;
  981. def int_x86_avx512_vpermi2var_hi_512 :
  982. ClangBuiltin<"__builtin_ia32_vpermi2varhi512">,
  983. DefaultAttrsIntrinsic<[llvm_v32i16_ty],
  984. [llvm_v32i16_ty, llvm_v32i16_ty, llvm_v32i16_ty],
  985. [IntrNoMem]>;
  986. def int_x86_avx512_vpermi2var_pd_128 :
  987. ClangBuiltin<"__builtin_ia32_vpermi2varpd128">,
  988. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  989. [llvm_v2f64_ty, llvm_v2i64_ty, llvm_v2f64_ty],
  990. [IntrNoMem]>;
  991. def int_x86_avx512_vpermi2var_pd_256 :
  992. ClangBuiltin<"__builtin_ia32_vpermi2varpd256">,
  993. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  994. [llvm_v4f64_ty, llvm_v4i64_ty, llvm_v4f64_ty],
  995. [IntrNoMem]>;
  996. def int_x86_avx512_vpermi2var_pd_512 :
  997. ClangBuiltin<"__builtin_ia32_vpermi2varpd512">,
  998. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  999. [llvm_v8f64_ty, llvm_v8i64_ty, llvm_v8f64_ty],
  1000. [IntrNoMem]>;
  1001. def int_x86_avx512_vpermi2var_ps_128 :
  1002. ClangBuiltin<"__builtin_ia32_vpermi2varps128">,
  1003. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  1004. [llvm_v4f32_ty, llvm_v4i32_ty, llvm_v4f32_ty],
  1005. [IntrNoMem]>;
  1006. def int_x86_avx512_vpermi2var_ps_256 :
  1007. ClangBuiltin<"__builtin_ia32_vpermi2varps256">,
  1008. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  1009. [llvm_v8f32_ty, llvm_v8i32_ty, llvm_v8f32_ty],
  1010. [IntrNoMem]>;
  1011. def int_x86_avx512_vpermi2var_ps_512 :
  1012. ClangBuiltin<"__builtin_ia32_vpermi2varps512">,
  1013. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  1014. [llvm_v16f32_ty, llvm_v16i32_ty, llvm_v16f32_ty],
  1015. [IntrNoMem]>;
  1016. def int_x86_avx512_vpermi2var_q_128 :
  1017. ClangBuiltin<"__builtin_ia32_vpermi2varq128">,
  1018. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  1019. [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
  1020. [IntrNoMem]>;
  1021. def int_x86_avx512_vpermi2var_q_256 :
  1022. ClangBuiltin<"__builtin_ia32_vpermi2varq256">,
  1023. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  1024. [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty],
  1025. [IntrNoMem]>;
  1026. def int_x86_avx512_vpermi2var_q_512 :
  1027. ClangBuiltin<"__builtin_ia32_vpermi2varq512">,
  1028. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  1029. [llvm_v8i64_ty, llvm_v8i64_ty, llvm_v8i64_ty],
  1030. [IntrNoMem]>;
  1031. def int_x86_avx512_vpermi2var_qi_128 :
  1032. ClangBuiltin<"__builtin_ia32_vpermi2varqi128">,
  1033. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  1034. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
  1035. [IntrNoMem]>;
  1036. def int_x86_avx512_vpermi2var_qi_256 :
  1037. ClangBuiltin<"__builtin_ia32_vpermi2varqi256">,
  1038. DefaultAttrsIntrinsic<[llvm_v32i8_ty],
  1039. [llvm_v32i8_ty, llvm_v32i8_ty, llvm_v32i8_ty],
  1040. [IntrNoMem]>;
  1041. def int_x86_avx512_vpermi2var_qi_512 :
  1042. ClangBuiltin<"__builtin_ia32_vpermi2varqi512">,
  1043. DefaultAttrsIntrinsic<[llvm_v64i8_ty],
  1044. [llvm_v64i8_ty, llvm_v64i8_ty, llvm_v64i8_ty],
  1045. [IntrNoMem]>;
  1046. def int_x86_avx512_vpermilvar_pd_512 :
  1047. ClangBuiltin<"__builtin_ia32_vpermilvarpd512">,
  1048. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8i64_ty],
  1049. [IntrNoMem]>;
  1050. def int_x86_avx512_vpermilvar_ps_512 :
  1051. ClangBuiltin<"__builtin_ia32_vpermilvarps512">,
  1052. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  1053. [llvm_v16f32_ty, llvm_v16i32_ty], [IntrNoMem]>;
  1054. def int_x86_avx512_pshuf_b_512 :
  1055. ClangBuiltin<"__builtin_ia32_pshufb512">,
  1056. DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
  1057. [IntrNoMem]>;
  1058. }
  1059. // GFNI Instructions
  1060. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1061. def int_x86_vgf2p8affineinvqb_128 :
  1062. ClangBuiltin<"__builtin_ia32_vgf2p8affineinvqb_v16qi">,
  1063. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  1064. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
  1065. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1066. def int_x86_vgf2p8affineinvqb_256 :
  1067. ClangBuiltin<"__builtin_ia32_vgf2p8affineinvqb_v32qi">,
  1068. DefaultAttrsIntrinsic<[llvm_v32i8_ty],
  1069. [llvm_v32i8_ty, llvm_v32i8_ty, llvm_i8_ty],
  1070. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1071. def int_x86_vgf2p8affineinvqb_512 :
  1072. ClangBuiltin<"__builtin_ia32_vgf2p8affineinvqb_v64qi">,
  1073. DefaultAttrsIntrinsic<[llvm_v64i8_ty],
  1074. [llvm_v64i8_ty, llvm_v64i8_ty, llvm_i8_ty],
  1075. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1076. def int_x86_vgf2p8affineqb_128 :
  1077. ClangBuiltin<"__builtin_ia32_vgf2p8affineqb_v16qi">,
  1078. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  1079. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
  1080. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1081. def int_x86_vgf2p8affineqb_256 :
  1082. ClangBuiltin<"__builtin_ia32_vgf2p8affineqb_v32qi">,
  1083. DefaultAttrsIntrinsic<[llvm_v32i8_ty],
  1084. [llvm_v32i8_ty, llvm_v32i8_ty, llvm_i8_ty],
  1085. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1086. def int_x86_vgf2p8affineqb_512 :
  1087. ClangBuiltin<"__builtin_ia32_vgf2p8affineqb_v64qi">,
  1088. DefaultAttrsIntrinsic<[llvm_v64i8_ty],
  1089. [llvm_v64i8_ty, llvm_v64i8_ty, llvm_i8_ty],
  1090. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1091. def int_x86_vgf2p8mulb_128 :
  1092. ClangBuiltin<"__builtin_ia32_vgf2p8mulb_v16qi">,
  1093. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
  1094. [IntrNoMem]>;
  1095. def int_x86_vgf2p8mulb_256 :
  1096. ClangBuiltin<"__builtin_ia32_vgf2p8mulb_v32qi">,
  1097. DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty],
  1098. [IntrNoMem]>;
  1099. def int_x86_vgf2p8mulb_512 :
  1100. ClangBuiltin<"__builtin_ia32_vgf2p8mulb_v64qi">,
  1101. DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
  1102. [IntrNoMem]>;
  1103. }
  1104. // Vector blend
  1105. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1106. def int_x86_avx_blendv_pd_256 : ClangBuiltin<"__builtin_ia32_blendvpd256">,
  1107. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  1108. [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty],
  1109. [IntrNoMem]>;
  1110. def int_x86_avx_blendv_ps_256 : ClangBuiltin<"__builtin_ia32_blendvps256">,
  1111. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  1112. [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty],
  1113. [IntrNoMem]>;
  1114. }
  1115. // Vector dot product
  1116. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1117. def int_x86_avx_dp_ps_256 : ClangBuiltin<"__builtin_ia32_dpps256">,
  1118. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  1119. [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
  1120. [IntrNoMem, Commutative, ImmArg<ArgIndex<2>>]>;
  1121. }
  1122. // Vector compare
  1123. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1124. def int_x86_avx_cmp_pd_256 :
  1125. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  1126. [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i8_ty],
  1127. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1128. def int_x86_avx_cmp_ps_256 :
  1129. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  1130. [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
  1131. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1132. }
  1133. // Vector convert
  1134. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1135. def int_x86_avx_cvt_pd2_ps_256 : ClangBuiltin<"__builtin_ia32_cvtpd2ps256">,
  1136. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
  1137. def int_x86_avx_cvt_ps2dq_256 : ClangBuiltin<"__builtin_ia32_cvtps2dq256">,
  1138. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
  1139. def int_x86_avx_cvtt_pd2dq_256 : ClangBuiltin<"__builtin_ia32_cvttpd2dq256">,
  1140. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
  1141. def int_x86_avx_cvt_pd2dq_256 : ClangBuiltin<"__builtin_ia32_cvtpd2dq256">,
  1142. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
  1143. def int_x86_avx_cvtt_ps2dq_256 : ClangBuiltin<"__builtin_ia32_cvttps2dq256">,
  1144. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
  1145. }
  1146. // Vector bit test
  1147. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1148. def int_x86_avx_vtestz_pd : ClangBuiltin<"__builtin_ia32_vtestzpd">,
  1149. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_v2f64_ty],
  1150. [IntrNoMem]>;
  1151. def int_x86_avx_vtestc_pd : ClangBuiltin<"__builtin_ia32_vtestcpd">,
  1152. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_v2f64_ty],
  1153. [IntrNoMem]>;
  1154. def int_x86_avx_vtestnzc_pd : ClangBuiltin<"__builtin_ia32_vtestnzcpd">,
  1155. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_v2f64_ty],
  1156. [IntrNoMem]>;
  1157. def int_x86_avx_vtestz_ps : ClangBuiltin<"__builtin_ia32_vtestzps">,
  1158. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
  1159. [IntrNoMem]>;
  1160. def int_x86_avx_vtestc_ps : ClangBuiltin<"__builtin_ia32_vtestcps">,
  1161. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
  1162. [IntrNoMem]>;
  1163. def int_x86_avx_vtestnzc_ps : ClangBuiltin<"__builtin_ia32_vtestnzcps">,
  1164. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
  1165. [IntrNoMem]>;
  1166. def int_x86_avx_vtestz_pd_256 : ClangBuiltin<"__builtin_ia32_vtestzpd256">,
  1167. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
  1168. [IntrNoMem]>;
  1169. def int_x86_avx_vtestc_pd_256 : ClangBuiltin<"__builtin_ia32_vtestcpd256">,
  1170. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
  1171. [IntrNoMem]>;
  1172. def int_x86_avx_vtestnzc_pd_256 : ClangBuiltin<"__builtin_ia32_vtestnzcpd256">,
  1173. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
  1174. [IntrNoMem]>;
  1175. def int_x86_avx_vtestz_ps_256 : ClangBuiltin<"__builtin_ia32_vtestzps256">,
  1176. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
  1177. [IntrNoMem]>;
  1178. def int_x86_avx_vtestc_ps_256 : ClangBuiltin<"__builtin_ia32_vtestcps256">,
  1179. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
  1180. [IntrNoMem]>;
  1181. def int_x86_avx_vtestnzc_ps_256 : ClangBuiltin<"__builtin_ia32_vtestnzcps256">,
  1182. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
  1183. [IntrNoMem]>;
  1184. def int_x86_avx_ptestz_256 : ClangBuiltin<"__builtin_ia32_ptestz256">,
  1185. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  1186. [IntrNoMem]>;
  1187. def int_x86_avx_ptestc_256 : ClangBuiltin<"__builtin_ia32_ptestc256">,
  1188. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  1189. [IntrNoMem]>;
  1190. def int_x86_avx_ptestnzc_256 : ClangBuiltin<"__builtin_ia32_ptestnzc256">,
  1191. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  1192. [IntrNoMem]>;
  1193. def int_x86_avx512_fpclass_pd_128 :
  1194. DefaultAttrsIntrinsic<[llvm_v2i1_ty], [llvm_v2f64_ty, llvm_i32_ty],
  1195. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  1196. def int_x86_avx512_fpclass_pd_256 :
  1197. DefaultAttrsIntrinsic<[llvm_v4i1_ty], [llvm_v4f64_ty, llvm_i32_ty],
  1198. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  1199. def int_x86_avx512_fpclass_pd_512 :
  1200. DefaultAttrsIntrinsic<[llvm_v8i1_ty], [llvm_v8f64_ty, llvm_i32_ty],
  1201. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  1202. def int_x86_avx512_fpclass_ps_128 :
  1203. DefaultAttrsIntrinsic<[llvm_v4i1_ty], [llvm_v4f32_ty, llvm_i32_ty],
  1204. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  1205. def int_x86_avx512_fpclass_ps_256 :
  1206. DefaultAttrsIntrinsic<[llvm_v8i1_ty], [llvm_v8f32_ty, llvm_i32_ty],
  1207. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  1208. def int_x86_avx512_fpclass_ps_512 :
  1209. DefaultAttrsIntrinsic<[llvm_v16i1_ty], [llvm_v16f32_ty, llvm_i32_ty],
  1210. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  1211. def int_x86_avx512_mask_fpclass_sd :
  1212. ClangBuiltin<"__builtin_ia32_fpclasssd_mask">,
  1213. DefaultAttrsIntrinsic<[llvm_i8_ty],
  1214. [llvm_v2f64_ty, llvm_i32_ty, llvm_i8_ty],
  1215. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  1216. def int_x86_avx512_mask_fpclass_ss :
  1217. ClangBuiltin<"__builtin_ia32_fpclassss_mask">,
  1218. DefaultAttrsIntrinsic<[llvm_i8_ty],
  1219. [llvm_v4f32_ty, llvm_i32_ty, llvm_i8_ty],
  1220. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  1221. }
  1222. // Vector extract sign mask
  1223. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1224. def int_x86_avx_movmsk_pd_256 : ClangBuiltin<"__builtin_ia32_movmskpd256">,
  1225. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
  1226. def int_x86_avx_movmsk_ps_256 : ClangBuiltin<"__builtin_ia32_movmskps256">,
  1227. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
  1228. }
  1229. // Vector zero
  1230. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1231. def int_x86_avx_vzeroall : ClangBuiltin<"__builtin_ia32_vzeroall">,
  1232. Intrinsic<[], [], [IntrNoMem, IntrHasSideEffects]>;
  1233. def int_x86_avx_vzeroupper : ClangBuiltin<"__builtin_ia32_vzeroupper">,
  1234. Intrinsic<[], [], [IntrNoMem, IntrHasSideEffects]>;
  1235. }
  1236. // SIMD load ops
  1237. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1238. def int_x86_avx_ldu_dq_256 : ClangBuiltin<"__builtin_ia32_lddqu256">,
  1239. DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
  1240. }
  1241. // Conditional load ops
  1242. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1243. def int_x86_avx_maskload_pd : ClangBuiltin<"__builtin_ia32_maskloadpd">,
  1244. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_ptr_ty, llvm_v2i64_ty],
  1245. [IntrReadMem, IntrArgMemOnly]>;
  1246. def int_x86_avx_maskload_ps : ClangBuiltin<"__builtin_ia32_maskloadps">,
  1247. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty, llvm_v4i32_ty],
  1248. [IntrReadMem, IntrArgMemOnly]>;
  1249. def int_x86_avx_maskload_pd_256 : ClangBuiltin<"__builtin_ia32_maskloadpd256">,
  1250. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_ptr_ty, llvm_v4i64_ty],
  1251. [IntrReadMem, IntrArgMemOnly]>;
  1252. def int_x86_avx_maskload_ps_256 : ClangBuiltin<"__builtin_ia32_maskloadps256">,
  1253. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty, llvm_v8i32_ty],
  1254. [IntrReadMem, IntrArgMemOnly]>;
  1255. }
  1256. // Conditional store ops
  1257. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1258. def int_x86_avx_maskstore_pd : ClangBuiltin<"__builtin_ia32_maskstorepd">,
  1259. Intrinsic<[], [llvm_ptr_ty,
  1260. llvm_v2i64_ty, llvm_v2f64_ty], [IntrArgMemOnly]>;
  1261. def int_x86_avx_maskstore_ps : ClangBuiltin<"__builtin_ia32_maskstoreps">,
  1262. Intrinsic<[], [llvm_ptr_ty,
  1263. llvm_v4i32_ty, llvm_v4f32_ty], [IntrArgMemOnly]>;
  1264. def int_x86_avx_maskstore_pd_256 :
  1265. ClangBuiltin<"__builtin_ia32_maskstorepd256">,
  1266. Intrinsic<[], [llvm_ptr_ty,
  1267. llvm_v4i64_ty, llvm_v4f64_ty], [IntrArgMemOnly]>;
  1268. def int_x86_avx_maskstore_ps_256 :
  1269. ClangBuiltin<"__builtin_ia32_maskstoreps256">,
  1270. Intrinsic<[], [llvm_ptr_ty,
  1271. llvm_v8i32_ty, llvm_v8f32_ty], [IntrArgMemOnly]>;
  1272. }
  1273. // BITALG bits shuffle
  1274. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1275. def int_x86_avx512_vpshufbitqmb_128 :
  1276. DefaultAttrsIntrinsic<[llvm_v16i1_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
  1277. [IntrNoMem]>;
  1278. def int_x86_avx512_vpshufbitqmb_256 :
  1279. DefaultAttrsIntrinsic<[llvm_v32i1_ty], [llvm_v32i8_ty, llvm_v32i8_ty],
  1280. [IntrNoMem]>;
  1281. def int_x86_avx512_vpshufbitqmb_512 :
  1282. DefaultAttrsIntrinsic<[llvm_v64i1_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
  1283. [IntrNoMem]>;
  1284. }
  1285. //===----------------------------------------------------------------------===//
  1286. // AVX2
  1287. // Integer arithmetic ops.
  1288. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1289. def int_x86_avx2_pmulhu_w : ClangBuiltin<"__builtin_ia32_pmulhuw256">,
  1290. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1291. llvm_v16i16_ty], [IntrNoMem, Commutative]>;
  1292. def int_x86_avx2_pmulh_w : ClangBuiltin<"__builtin_ia32_pmulhw256">,
  1293. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1294. llvm_v16i16_ty], [IntrNoMem, Commutative]>;
  1295. def int_x86_avx2_pmadd_wd : ClangBuiltin<"__builtin_ia32_pmaddwd256">,
  1296. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v16i16_ty,
  1297. llvm_v16i16_ty], [IntrNoMem, Commutative]>;
  1298. def int_x86_avx2_pavg_b : ClangBuiltin<"__builtin_ia32_pavgb256">,
  1299. DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
  1300. llvm_v32i8_ty], [IntrNoMem, Commutative]>;
  1301. def int_x86_avx2_pavg_w : ClangBuiltin<"__builtin_ia32_pavgw256">,
  1302. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1303. llvm_v16i16_ty], [IntrNoMem, Commutative]>;
  1304. def int_x86_avx2_psad_bw : ClangBuiltin<"__builtin_ia32_psadbw256">,
  1305. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v32i8_ty,
  1306. llvm_v32i8_ty], [IntrNoMem, Commutative]>;
  1307. }
  1308. // Integer shift ops.
  1309. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1310. def int_x86_avx2_psll_w : ClangBuiltin<"__builtin_ia32_psllw256">,
  1311. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1312. llvm_v8i16_ty], [IntrNoMem]>;
  1313. def int_x86_avx2_psll_d : ClangBuiltin<"__builtin_ia32_pslld256">,
  1314. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
  1315. llvm_v4i32_ty], [IntrNoMem]>;
  1316. def int_x86_avx2_psll_q : ClangBuiltin<"__builtin_ia32_psllq256">,
  1317. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
  1318. llvm_v2i64_ty], [IntrNoMem]>;
  1319. def int_x86_avx2_psrl_w : ClangBuiltin<"__builtin_ia32_psrlw256">,
  1320. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1321. llvm_v8i16_ty], [IntrNoMem]>;
  1322. def int_x86_avx2_psrl_d : ClangBuiltin<"__builtin_ia32_psrld256">,
  1323. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
  1324. llvm_v4i32_ty], [IntrNoMem]>;
  1325. def int_x86_avx2_psrl_q : ClangBuiltin<"__builtin_ia32_psrlq256">,
  1326. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
  1327. llvm_v2i64_ty], [IntrNoMem]>;
  1328. def int_x86_avx2_psra_w : ClangBuiltin<"__builtin_ia32_psraw256">,
  1329. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1330. llvm_v8i16_ty], [IntrNoMem]>;
  1331. def int_x86_avx2_psra_d : ClangBuiltin<"__builtin_ia32_psrad256">,
  1332. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
  1333. llvm_v4i32_ty], [IntrNoMem]>;
  1334. // Oddly these don't require an immediate due to a gcc compatibility issue.
  1335. def int_x86_avx2_pslli_w : ClangBuiltin<"__builtin_ia32_psllwi256">,
  1336. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1337. llvm_i32_ty], [IntrNoMem]>;
  1338. def int_x86_avx2_pslli_d : ClangBuiltin<"__builtin_ia32_pslldi256">,
  1339. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
  1340. llvm_i32_ty], [IntrNoMem]>;
  1341. def int_x86_avx2_pslli_q : ClangBuiltin<"__builtin_ia32_psllqi256">,
  1342. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
  1343. llvm_i32_ty], [IntrNoMem]>;
  1344. def int_x86_avx2_psrli_w : ClangBuiltin<"__builtin_ia32_psrlwi256">,
  1345. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1346. llvm_i32_ty], [IntrNoMem]>;
  1347. def int_x86_avx2_psrli_d : ClangBuiltin<"__builtin_ia32_psrldi256">,
  1348. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
  1349. llvm_i32_ty], [IntrNoMem]>;
  1350. def int_x86_avx2_psrli_q : ClangBuiltin<"__builtin_ia32_psrlqi256">,
  1351. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
  1352. llvm_i32_ty], [IntrNoMem]>;
  1353. def int_x86_avx2_psrai_w : ClangBuiltin<"__builtin_ia32_psrawi256">,
  1354. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1355. llvm_i32_ty], [IntrNoMem]>;
  1356. def int_x86_avx2_psrai_d : ClangBuiltin<"__builtin_ia32_psradi256">,
  1357. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
  1358. llvm_i32_ty], [IntrNoMem]>;
  1359. def int_x86_avx512_psra_q_128 : ClangBuiltin<"__builtin_ia32_psraq128">,
  1360. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
  1361. llvm_v2i64_ty], [IntrNoMem]>;
  1362. def int_x86_avx512_psra_q_256 : ClangBuiltin<"__builtin_ia32_psraq256">,
  1363. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
  1364. llvm_v2i64_ty], [IntrNoMem]>;
  1365. // Oddly these don't require an immediate due to a gcc compatibility issue.
  1366. def int_x86_avx512_psrai_q_128 : ClangBuiltin<"__builtin_ia32_psraqi128">,
  1367. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
  1368. llvm_i32_ty], [IntrNoMem]>;
  1369. def int_x86_avx512_psrai_q_256 : ClangBuiltin<"__builtin_ia32_psraqi256">,
  1370. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
  1371. llvm_i32_ty], [IntrNoMem]>;
  1372. def int_x86_avx512_psll_w_512 : ClangBuiltin<"__builtin_ia32_psllw512">,
  1373. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
  1374. llvm_v8i16_ty], [IntrNoMem]>;
  1375. def int_x86_avx512_psll_d_512 : ClangBuiltin<"__builtin_ia32_pslld512">,
  1376. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
  1377. llvm_v4i32_ty], [IntrNoMem]>;
  1378. def int_x86_avx512_psll_q_512 : ClangBuiltin<"__builtin_ia32_psllq512">,
  1379. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
  1380. llvm_v2i64_ty], [IntrNoMem]>;
  1381. def int_x86_avx512_psrl_w_512 : ClangBuiltin<"__builtin_ia32_psrlw512">,
  1382. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
  1383. llvm_v8i16_ty], [IntrNoMem]>;
  1384. def int_x86_avx512_psrl_d_512 : ClangBuiltin<"__builtin_ia32_psrld512">,
  1385. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
  1386. llvm_v4i32_ty], [IntrNoMem]>;
  1387. def int_x86_avx512_psrl_q_512 : ClangBuiltin<"__builtin_ia32_psrlq512">,
  1388. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
  1389. llvm_v2i64_ty], [IntrNoMem]>;
  1390. def int_x86_avx512_psra_w_512 : ClangBuiltin<"__builtin_ia32_psraw512">,
  1391. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
  1392. llvm_v8i16_ty], [IntrNoMem]>;
  1393. def int_x86_avx512_psra_d_512 : ClangBuiltin<"__builtin_ia32_psrad512">,
  1394. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
  1395. llvm_v4i32_ty], [IntrNoMem]>;
  1396. def int_x86_avx512_psra_q_512 : ClangBuiltin<"__builtin_ia32_psraq512">,
  1397. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
  1398. llvm_v2i64_ty], [IntrNoMem]>;
  1399. // Oddly these don't require an immediate due to a gcc compatibility issue.
  1400. def int_x86_avx512_pslli_w_512 : ClangBuiltin<"__builtin_ia32_psllwi512">,
  1401. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
  1402. llvm_i32_ty], [IntrNoMem]>;
  1403. def int_x86_avx512_pslli_d_512 : ClangBuiltin<"__builtin_ia32_pslldi512">,
  1404. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
  1405. llvm_i32_ty], [IntrNoMem]>;
  1406. def int_x86_avx512_pslli_q_512 : ClangBuiltin<"__builtin_ia32_psllqi512">,
  1407. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
  1408. llvm_i32_ty], [IntrNoMem]>;
  1409. def int_x86_avx512_psrli_w_512 : ClangBuiltin<"__builtin_ia32_psrlwi512">,
  1410. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
  1411. llvm_i32_ty], [IntrNoMem]>;
  1412. def int_x86_avx512_psrli_d_512 : ClangBuiltin<"__builtin_ia32_psrldi512">,
  1413. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
  1414. llvm_i32_ty], [IntrNoMem]>;
  1415. def int_x86_avx512_psrli_q_512 : ClangBuiltin<"__builtin_ia32_psrlqi512">,
  1416. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
  1417. llvm_i32_ty], [IntrNoMem]>;
  1418. def int_x86_avx512_psrai_w_512 : ClangBuiltin<"__builtin_ia32_psrawi512">,
  1419. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
  1420. llvm_i32_ty], [IntrNoMem]>;
  1421. def int_x86_avx512_psrai_d_512 : ClangBuiltin<"__builtin_ia32_psradi512">,
  1422. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
  1423. llvm_i32_ty], [IntrNoMem]>;
  1424. def int_x86_avx512_psrai_q_512 : ClangBuiltin<"__builtin_ia32_psraqi512">,
  1425. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
  1426. llvm_i32_ty], [IntrNoMem]>;
  1427. def int_x86_avx512_pmultishift_qb_128:
  1428. ClangBuiltin<"__builtin_ia32_vpmultishiftqb128">,
  1429. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
  1430. [IntrNoMem]>;
  1431. def int_x86_avx512_pmultishift_qb_256:
  1432. ClangBuiltin<"__builtin_ia32_vpmultishiftqb256">,
  1433. DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty],
  1434. [IntrNoMem]>;
  1435. def int_x86_avx512_pmultishift_qb_512:
  1436. ClangBuiltin<"__builtin_ia32_vpmultishiftqb512">,
  1437. DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
  1438. [IntrNoMem]>;
  1439. }
  1440. // Pack ops.
  1441. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1442. def int_x86_avx2_packsswb : ClangBuiltin<"__builtin_ia32_packsswb256">,
  1443. DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v16i16_ty,
  1444. llvm_v16i16_ty], [IntrNoMem]>;
  1445. def int_x86_avx2_packssdw : ClangBuiltin<"__builtin_ia32_packssdw256">,
  1446. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v8i32_ty,
  1447. llvm_v8i32_ty], [IntrNoMem]>;
  1448. def int_x86_avx2_packuswb : ClangBuiltin<"__builtin_ia32_packuswb256">,
  1449. DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v16i16_ty,
  1450. llvm_v16i16_ty], [IntrNoMem]>;
  1451. def int_x86_avx2_packusdw : ClangBuiltin<"__builtin_ia32_packusdw256">,
  1452. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v8i32_ty,
  1453. llvm_v8i32_ty], [IntrNoMem]>;
  1454. }
  1455. // Horizontal arithmetic ops
  1456. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1457. def int_x86_avx2_phadd_w : ClangBuiltin<"__builtin_ia32_phaddw256">,
  1458. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1459. llvm_v16i16_ty], [IntrNoMem]>;
  1460. def int_x86_avx2_phadd_d : ClangBuiltin<"__builtin_ia32_phaddd256">,
  1461. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
  1462. llvm_v8i32_ty], [IntrNoMem]>;
  1463. def int_x86_avx2_phadd_sw : ClangBuiltin<"__builtin_ia32_phaddsw256">,
  1464. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1465. llvm_v16i16_ty], [IntrNoMem]>;
  1466. def int_x86_avx2_phsub_w : ClangBuiltin<"__builtin_ia32_phsubw256">,
  1467. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1468. llvm_v16i16_ty], [IntrNoMem]>;
  1469. def int_x86_avx2_phsub_d : ClangBuiltin<"__builtin_ia32_phsubd256">,
  1470. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
  1471. llvm_v8i32_ty], [IntrNoMem]>;
  1472. def int_x86_avx2_phsub_sw : ClangBuiltin<"__builtin_ia32_phsubsw256">,
  1473. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1474. llvm_v16i16_ty], [IntrNoMem]>;
  1475. def int_x86_avx2_pmadd_ub_sw : ClangBuiltin<"__builtin_ia32_pmaddubsw256">,
  1476. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v32i8_ty,
  1477. llvm_v32i8_ty], [IntrNoMem]>;
  1478. }
  1479. // Sign ops
  1480. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1481. def int_x86_avx2_psign_b : ClangBuiltin<"__builtin_ia32_psignb256">,
  1482. DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
  1483. llvm_v32i8_ty], [IntrNoMem]>;
  1484. def int_x86_avx2_psign_w : ClangBuiltin<"__builtin_ia32_psignw256">,
  1485. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1486. llvm_v16i16_ty], [IntrNoMem]>;
  1487. def int_x86_avx2_psign_d : ClangBuiltin<"__builtin_ia32_psignd256">,
  1488. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
  1489. llvm_v8i32_ty], [IntrNoMem]>;
  1490. }
  1491. // Packed multiply high with round and scale
  1492. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1493. def int_x86_avx2_pmul_hr_sw : ClangBuiltin<"__builtin_ia32_pmulhrsw256">,
  1494. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
  1495. llvm_v16i16_ty], [IntrNoMem, Commutative]>;
  1496. def int_x86_avx512_pmul_hr_sw_512 : ClangBuiltin<"__builtin_ia32_pmulhrsw512">,
  1497. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
  1498. llvm_v32i16_ty], [IntrNoMem, Commutative]>;
  1499. }
  1500. // Vector blend
  1501. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1502. def int_x86_avx2_pblendvb : ClangBuiltin<"__builtin_ia32_pblendvb256">,
  1503. DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
  1504. llvm_v32i8_ty], [IntrNoMem]>;
  1505. }
  1506. // Vector permutation
  1507. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1508. def int_x86_avx2_permd : ClangBuiltin<"__builtin_ia32_permvarsi256">,
  1509. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
  1510. [IntrNoMem]>;
  1511. def int_x86_avx2_permps : ClangBuiltin<"__builtin_ia32_permvarsf256">,
  1512. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8i32_ty],
  1513. [IntrNoMem]>;
  1514. }
  1515. // Conditional load ops
  1516. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1517. def int_x86_avx2_maskload_d : ClangBuiltin<"__builtin_ia32_maskloadd">,
  1518. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_ptr_ty, llvm_v4i32_ty],
  1519. [IntrReadMem, IntrArgMemOnly]>;
  1520. def int_x86_avx2_maskload_q : ClangBuiltin<"__builtin_ia32_maskloadq">,
  1521. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_ptr_ty, llvm_v2i64_ty],
  1522. [IntrReadMem, IntrArgMemOnly]>;
  1523. def int_x86_avx2_maskload_d_256 : ClangBuiltin<"__builtin_ia32_maskloadd256">,
  1524. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_ptr_ty, llvm_v8i32_ty],
  1525. [IntrReadMem, IntrArgMemOnly]>;
  1526. def int_x86_avx2_maskload_q_256 : ClangBuiltin<"__builtin_ia32_maskloadq256">,
  1527. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_ptr_ty, llvm_v4i64_ty],
  1528. [IntrReadMem, IntrArgMemOnly]>;
  1529. }
  1530. // Conditional store ops
  1531. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1532. def int_x86_avx2_maskstore_d : ClangBuiltin<"__builtin_ia32_maskstored">,
  1533. Intrinsic<[], [llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  1534. [IntrArgMemOnly]>;
  1535. def int_x86_avx2_maskstore_q : ClangBuiltin<"__builtin_ia32_maskstoreq">,
  1536. Intrinsic<[], [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty],
  1537. [IntrArgMemOnly]>;
  1538. def int_x86_avx2_maskstore_d_256 :
  1539. ClangBuiltin<"__builtin_ia32_maskstored256">,
  1540. Intrinsic<[], [llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty],
  1541. [IntrArgMemOnly]>;
  1542. def int_x86_avx2_maskstore_q_256 :
  1543. ClangBuiltin<"__builtin_ia32_maskstoreq256">,
  1544. Intrinsic<[], [llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty],
  1545. [IntrArgMemOnly]>;
  1546. }
  1547. // Variable bit shift ops
  1548. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1549. def int_x86_avx2_psllv_d : ClangBuiltin<"__builtin_ia32_psllv4si">,
  1550. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  1551. [IntrNoMem]>;
  1552. def int_x86_avx2_psllv_d_256 : ClangBuiltin<"__builtin_ia32_psllv8si">,
  1553. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
  1554. [IntrNoMem]>;
  1555. def int_x86_avx2_psllv_q : ClangBuiltin<"__builtin_ia32_psllv2di">,
  1556. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  1557. [IntrNoMem]>;
  1558. def int_x86_avx2_psllv_q_256 : ClangBuiltin<"__builtin_ia32_psllv4di">,
  1559. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  1560. [IntrNoMem]>;
  1561. def int_x86_avx512_psllv_d_512 : ClangBuiltin<"__builtin_ia32_psllv16si">,
  1562. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
  1563. [IntrNoMem]>;
  1564. def int_x86_avx512_psllv_q_512 : ClangBuiltin<"__builtin_ia32_psllv8di">,
  1565. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
  1566. [IntrNoMem]>;
  1567. def int_x86_avx2_psrlv_d : ClangBuiltin<"__builtin_ia32_psrlv4si">,
  1568. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  1569. [IntrNoMem]>;
  1570. def int_x86_avx2_psrlv_d_256 : ClangBuiltin<"__builtin_ia32_psrlv8si">,
  1571. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
  1572. [IntrNoMem]>;
  1573. def int_x86_avx2_psrlv_q : ClangBuiltin<"__builtin_ia32_psrlv2di">,
  1574. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  1575. [IntrNoMem]>;
  1576. def int_x86_avx2_psrlv_q_256 : ClangBuiltin<"__builtin_ia32_psrlv4di">,
  1577. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  1578. [IntrNoMem]>;
  1579. def int_x86_avx512_psrlv_d_512 : ClangBuiltin<"__builtin_ia32_psrlv16si">,
  1580. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
  1581. [IntrNoMem]>;
  1582. def int_x86_avx512_psrlv_q_512 : ClangBuiltin<"__builtin_ia32_psrlv8di">,
  1583. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
  1584. [IntrNoMem]>;
  1585. def int_x86_avx2_psrav_d : ClangBuiltin<"__builtin_ia32_psrav4si">,
  1586. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  1587. [IntrNoMem]>;
  1588. def int_x86_avx2_psrav_d_256 : ClangBuiltin<"__builtin_ia32_psrav8si">,
  1589. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
  1590. [IntrNoMem]>;
  1591. def int_x86_avx512_psrav_d_512 : ClangBuiltin<"__builtin_ia32_psrav16si">,
  1592. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
  1593. [IntrNoMem]>;
  1594. def int_x86_avx512_psrav_q_128 : ClangBuiltin<"__builtin_ia32_psravq128">,
  1595. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  1596. [IntrNoMem]>;
  1597. def int_x86_avx512_psrav_q_256 : ClangBuiltin<"__builtin_ia32_psravq256">,
  1598. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  1599. [IntrNoMem]>;
  1600. def int_x86_avx512_psrav_q_512 : ClangBuiltin<"__builtin_ia32_psrav8di">,
  1601. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
  1602. [IntrNoMem]>;
  1603. def int_x86_avx512_psllv_w_128 : ClangBuiltin<"__builtin_ia32_psllv8hi">,
  1604. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  1605. [IntrNoMem]>;
  1606. def int_x86_avx512_psllv_w_256 : ClangBuiltin<"__builtin_ia32_psllv16hi">,
  1607. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
  1608. [IntrNoMem]>;
  1609. def int_x86_avx512_psllv_w_512 : ClangBuiltin<"__builtin_ia32_psllv32hi">,
  1610. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
  1611. [IntrNoMem]>;
  1612. def int_x86_avx512_psrlv_w_128 : ClangBuiltin<"__builtin_ia32_psrlv8hi">,
  1613. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  1614. [IntrNoMem]>;
  1615. def int_x86_avx512_psrlv_w_256 : ClangBuiltin<"__builtin_ia32_psrlv16hi">,
  1616. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
  1617. [IntrNoMem]>;
  1618. def int_x86_avx512_psrlv_w_512 : ClangBuiltin<"__builtin_ia32_psrlv32hi">,
  1619. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
  1620. [IntrNoMem]>;
  1621. def int_x86_avx512_psrav_w_128 : ClangBuiltin<"__builtin_ia32_psrav8hi">,
  1622. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  1623. [IntrNoMem]>;
  1624. def int_x86_avx512_psrav_w_256 : ClangBuiltin<"__builtin_ia32_psrav16hi">,
  1625. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
  1626. [IntrNoMem]>;
  1627. def int_x86_avx512_psrav_w_512 : ClangBuiltin<"__builtin_ia32_psrav32hi">,
  1628. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
  1629. [IntrNoMem]>;
  1630. }
  1631. // Gather ops
  1632. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1633. // NOTE: These can't be ArgMemOnly because you can put the address completely
  1634. // in the index register.
  1635. def int_x86_avx2_gather_d_pd : ClangBuiltin<"__builtin_ia32_gatherd_pd">,
  1636. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  1637. [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i8_ty],
  1638. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1639. def int_x86_avx2_gather_d_pd_256 : ClangBuiltin<"__builtin_ia32_gatherd_pd256">,
  1640. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  1641. [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i8_ty],
  1642. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1643. def int_x86_avx2_gather_q_pd : ClangBuiltin<"__builtin_ia32_gatherq_pd">,
  1644. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  1645. [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i8_ty],
  1646. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1647. def int_x86_avx2_gather_q_pd_256 : ClangBuiltin<"__builtin_ia32_gatherq_pd256">,
  1648. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  1649. [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i8_ty],
  1650. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1651. def int_x86_avx2_gather_d_ps : ClangBuiltin<"__builtin_ia32_gatherd_ps">,
  1652. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  1653. [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i8_ty],
  1654. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1655. def int_x86_avx2_gather_d_ps_256 : ClangBuiltin<"__builtin_ia32_gatherd_ps256">,
  1656. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  1657. [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i8_ty],
  1658. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1659. def int_x86_avx2_gather_q_ps : ClangBuiltin<"__builtin_ia32_gatherq_ps">,
  1660. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  1661. [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty],
  1662. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1663. def int_x86_avx2_gather_q_ps_256 : ClangBuiltin<"__builtin_ia32_gatherq_ps256">,
  1664. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  1665. [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i8_ty],
  1666. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1667. def int_x86_avx2_gather_d_q : ClangBuiltin<"__builtin_ia32_gatherd_q">,
  1668. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  1669. [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i8_ty],
  1670. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1671. def int_x86_avx2_gather_d_q_256 : ClangBuiltin<"__builtin_ia32_gatherd_q256">,
  1672. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  1673. [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i8_ty],
  1674. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1675. def int_x86_avx2_gather_q_q : ClangBuiltin<"__builtin_ia32_gatherq_q">,
  1676. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  1677. [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
  1678. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1679. def int_x86_avx2_gather_q_q_256 : ClangBuiltin<"__builtin_ia32_gatherq_q256">,
  1680. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  1681. [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
  1682. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1683. def int_x86_avx2_gather_d_d : ClangBuiltin<"__builtin_ia32_gatherd_d">,
  1684. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1685. [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
  1686. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1687. def int_x86_avx2_gather_d_d_256 : ClangBuiltin<"__builtin_ia32_gatherd_d256">,
  1688. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  1689. [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty],
  1690. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1691. def int_x86_avx2_gather_q_d : ClangBuiltin<"__builtin_ia32_gatherq_d">,
  1692. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1693. [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
  1694. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1695. def int_x86_avx2_gather_q_d_256 : ClangBuiltin<"__builtin_ia32_gatherq_d256">,
  1696. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1697. [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
  1698. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  1699. }
  1700. // Misc.
  1701. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1702. def int_x86_avx2_pmovmskb : ClangBuiltin<"__builtin_ia32_pmovmskb256">,
  1703. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v32i8_ty], [IntrNoMem]>;
  1704. def int_x86_avx2_pshuf_b : ClangBuiltin<"__builtin_ia32_pshufb256">,
  1705. DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
  1706. llvm_v32i8_ty], [IntrNoMem]>;
  1707. def int_x86_avx2_mpsadbw : ClangBuiltin<"__builtin_ia32_mpsadbw256">,
  1708. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
  1709. llvm_i8_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1710. }
  1711. //===----------------------------------------------------------------------===//
  1712. // FMA3 and FMA4
  1713. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1714. def int_x86_fma_vfmaddsub_ps : ClangBuiltin<"__builtin_ia32_vfmaddsubps">,
  1715. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  1716. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
  1717. [IntrNoMem]>;
  1718. def int_x86_fma_vfmaddsub_pd : ClangBuiltin<"__builtin_ia32_vfmaddsubpd">,
  1719. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  1720. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
  1721. [IntrNoMem]>;
  1722. def int_x86_fma_vfmaddsub_ps_256 :
  1723. ClangBuiltin<"__builtin_ia32_vfmaddsubps256">,
  1724. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  1725. [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty],
  1726. [IntrNoMem]>;
  1727. def int_x86_fma_vfmaddsub_pd_256 :
  1728. ClangBuiltin<"__builtin_ia32_vfmaddsubpd256">,
  1729. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  1730. [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty],
  1731. [IntrNoMem]>;
  1732. def int_x86_avx512_vfmadd_pd_512 :
  1733. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  1734. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty],
  1735. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1736. def int_x86_avx512_vfmadd_ps_512 :
  1737. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  1738. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty],
  1739. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1740. def int_x86_avx512_vfmaddsub_pd_512 :
  1741. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  1742. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty],
  1743. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1744. def int_x86_avx512_vfmaddsub_ps_512 :
  1745. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  1746. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty],
  1747. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1748. def int_x86_avx512_vfmadd_f64 :
  1749. DefaultAttrsIntrinsic<[llvm_double_ty],
  1750. [llvm_double_ty, llvm_double_ty, llvm_double_ty, llvm_i32_ty],
  1751. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1752. def int_x86_avx512_vfmadd_f32 :
  1753. DefaultAttrsIntrinsic<[llvm_float_ty],
  1754. [llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_i32_ty],
  1755. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1756. def int_x86_avx512_vpmadd52h_uq_128 :
  1757. ClangBuiltin<"__builtin_ia32_vpmadd52huq128">,
  1758. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
  1759. llvm_v2i64_ty], [IntrNoMem]>;
  1760. def int_x86_avx512_vpmadd52l_uq_128 :
  1761. ClangBuiltin<"__builtin_ia32_vpmadd52luq128">,
  1762. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
  1763. llvm_v2i64_ty], [IntrNoMem]>;
  1764. def int_x86_avx512_vpmadd52h_uq_256 :
  1765. ClangBuiltin<"__builtin_ia32_vpmadd52huq256">,
  1766. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
  1767. llvm_v4i64_ty], [IntrNoMem]>;
  1768. def int_x86_avx512_vpmadd52l_uq_256 :
  1769. ClangBuiltin<"__builtin_ia32_vpmadd52luq256">,
  1770. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
  1771. llvm_v4i64_ty], [IntrNoMem]>;
  1772. def int_x86_avx512_vpmadd52h_uq_512 :
  1773. ClangBuiltin<"__builtin_ia32_vpmadd52huq512">,
  1774. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
  1775. llvm_v8i64_ty], [IntrNoMem]>;
  1776. def int_x86_avx512_vpmadd52l_uq_512 :
  1777. ClangBuiltin<"__builtin_ia32_vpmadd52luq512">,
  1778. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
  1779. llvm_v8i64_ty], [IntrNoMem]>;
  1780. }
  1781. // VNNI
  1782. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1783. def int_x86_avx512_vpdpbusd_128 :
  1784. ClangBuiltin<"__builtin_ia32_vpdpbusd128">,
  1785. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
  1786. llvm_v4i32_ty], [IntrNoMem]>;
  1787. def int_x86_avx512_vpdpbusd_256 :
  1788. ClangBuiltin<"__builtin_ia32_vpdpbusd256">,
  1789. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
  1790. llvm_v8i32_ty], [IntrNoMem]>;
  1791. def int_x86_avx512_vpdpbusd_512 :
  1792. ClangBuiltin<"__builtin_ia32_vpdpbusd512">,
  1793. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
  1794. llvm_v16i32_ty], [IntrNoMem]>;
  1795. def int_x86_avx512_vpdpbusds_128 :
  1796. ClangBuiltin<"__builtin_ia32_vpdpbusds128">,
  1797. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
  1798. llvm_v4i32_ty], [IntrNoMem]>;
  1799. def int_x86_avx512_vpdpbusds_256 :
  1800. ClangBuiltin<"__builtin_ia32_vpdpbusds256">,
  1801. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
  1802. llvm_v8i32_ty], [IntrNoMem]>;
  1803. def int_x86_avx512_vpdpbusds_512 :
  1804. ClangBuiltin<"__builtin_ia32_vpdpbusds512">,
  1805. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
  1806. llvm_v16i32_ty], [IntrNoMem]>;
  1807. def int_x86_avx512_vpdpwssd_128 :
  1808. ClangBuiltin<"__builtin_ia32_vpdpwssd128">,
  1809. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
  1810. llvm_v4i32_ty], [IntrNoMem]>;
  1811. def int_x86_avx512_vpdpwssd_256 :
  1812. ClangBuiltin<"__builtin_ia32_vpdpwssd256">,
  1813. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
  1814. llvm_v8i32_ty], [IntrNoMem]>;
  1815. def int_x86_avx512_vpdpwssd_512 :
  1816. ClangBuiltin<"__builtin_ia32_vpdpwssd512">,
  1817. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
  1818. llvm_v16i32_ty], [IntrNoMem]>;
  1819. def int_x86_avx512_vpdpwssds_128 :
  1820. ClangBuiltin<"__builtin_ia32_vpdpwssds128">,
  1821. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
  1822. llvm_v4i32_ty], [IntrNoMem]>;
  1823. def int_x86_avx512_vpdpwssds_256 :
  1824. ClangBuiltin<"__builtin_ia32_vpdpwssds256">,
  1825. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
  1826. llvm_v8i32_ty], [IntrNoMem]>;
  1827. def int_x86_avx512_vpdpwssds_512 :
  1828. ClangBuiltin<"__builtin_ia32_vpdpwssds512">,
  1829. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
  1830. llvm_v16i32_ty], [IntrNoMem]>;
  1831. def int_x86_avx2_vpdpbssd_128
  1832. : ClangBuiltin<"__builtin_ia32_vpdpbssd128">,
  1833. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1834. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  1835. [IntrNoMem]>;
  1836. def int_x86_avx2_vpdpbssd_256
  1837. : ClangBuiltin<"__builtin_ia32_vpdpbssd256">,
  1838. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  1839. [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
  1840. [IntrNoMem]>;
  1841. def int_x86_avx2_vpdpbssds_128
  1842. : ClangBuiltin<"__builtin_ia32_vpdpbssds128">,
  1843. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1844. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  1845. [IntrNoMem]>;
  1846. def int_x86_avx2_vpdpbssds_256
  1847. : ClangBuiltin<"__builtin_ia32_vpdpbssds256">,
  1848. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  1849. [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
  1850. [IntrNoMem]>;
  1851. def int_x86_avx2_vpdpbsud_128
  1852. : ClangBuiltin<"__builtin_ia32_vpdpbsud128">,
  1853. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1854. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  1855. [IntrNoMem]>;
  1856. def int_x86_avx2_vpdpbsud_256
  1857. : ClangBuiltin<"__builtin_ia32_vpdpbsud256">,
  1858. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  1859. [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
  1860. [IntrNoMem]>;
  1861. def int_x86_avx2_vpdpbsuds_128
  1862. : ClangBuiltin<"__builtin_ia32_vpdpbsuds128">,
  1863. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1864. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  1865. [IntrNoMem]>;
  1866. def int_x86_avx2_vpdpbsuds_256
  1867. : ClangBuiltin<"__builtin_ia32_vpdpbsuds256">,
  1868. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  1869. [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
  1870. [IntrNoMem]>;
  1871. def int_x86_avx2_vpdpbuud_128
  1872. : ClangBuiltin<"__builtin_ia32_vpdpbuud128">,
  1873. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1874. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  1875. [IntrNoMem]>;
  1876. def int_x86_avx2_vpdpbuud_256
  1877. : ClangBuiltin<"__builtin_ia32_vpdpbuud256">,
  1878. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  1879. [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
  1880. [IntrNoMem]>;
  1881. def int_x86_avx2_vpdpbuuds_128
  1882. : ClangBuiltin<"__builtin_ia32_vpdpbuuds128">,
  1883. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1884. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  1885. [IntrNoMem]>;
  1886. def int_x86_avx2_vpdpbuuds_256
  1887. : ClangBuiltin<"__builtin_ia32_vpdpbuuds256">,
  1888. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  1889. [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
  1890. [IntrNoMem]>;
  1891. }
  1892. //===----------------------------------------------------------------------===//
  1893. // XOP
  1894. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  1895. def int_x86_xop_vpermil2pd : ClangBuiltin<"__builtin_ia32_vpermil2pd">,
  1896. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
  1897. llvm_v2i64_ty, llvm_i8_ty],
  1898. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1899. def int_x86_xop_vpermil2pd_256 :
  1900. ClangBuiltin<"__builtin_ia32_vpermil2pd256">,
  1901. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
  1902. llvm_v4i64_ty, llvm_i8_ty],
  1903. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1904. def int_x86_xop_vpermil2ps : ClangBuiltin<"__builtin_ia32_vpermil2ps">,
  1905. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
  1906. llvm_v4i32_ty, llvm_i8_ty],
  1907. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1908. def int_x86_xop_vpermil2ps_256 :
  1909. ClangBuiltin<"__builtin_ia32_vpermil2ps256">,
  1910. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
  1911. llvm_v8i32_ty, llvm_i8_ty],
  1912. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1913. def int_x86_xop_vfrcz_pd : ClangBuiltin<"__builtin_ia32_vfrczpd">,
  1914. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  1915. def int_x86_xop_vfrcz_ps : ClangBuiltin<"__builtin_ia32_vfrczps">,
  1916. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  1917. def int_x86_xop_vfrcz_sd : ClangBuiltin<"__builtin_ia32_vfrczsd">,
  1918. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
  1919. def int_x86_xop_vfrcz_ss : ClangBuiltin<"__builtin_ia32_vfrczss">,
  1920. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  1921. def int_x86_xop_vfrcz_pd_256 : ClangBuiltin<"__builtin_ia32_vfrczpd256">,
  1922. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty], [IntrNoMem]>;
  1923. def int_x86_xop_vfrcz_ps_256 : ClangBuiltin<"__builtin_ia32_vfrczps256">,
  1924. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
  1925. def int_x86_xop_vphaddbd :
  1926. ClangBuiltin<"__builtin_ia32_vphaddbd">,
  1927. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
  1928. def int_x86_xop_vphaddbq :
  1929. ClangBuiltin<"__builtin_ia32_vphaddbq">,
  1930. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty], [IntrNoMem]>;
  1931. def int_x86_xop_vphaddbw :
  1932. ClangBuiltin<"__builtin_ia32_vphaddbw">,
  1933. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
  1934. def int_x86_xop_vphadddq :
  1935. ClangBuiltin<"__builtin_ia32_vphadddq">,
  1936. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
  1937. def int_x86_xop_vphaddubd :
  1938. ClangBuiltin<"__builtin_ia32_vphaddubd">,
  1939. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
  1940. def int_x86_xop_vphaddubq :
  1941. ClangBuiltin<"__builtin_ia32_vphaddubq">,
  1942. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty], [IntrNoMem]>;
  1943. def int_x86_xop_vphaddubw :
  1944. ClangBuiltin<"__builtin_ia32_vphaddubw">,
  1945. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
  1946. def int_x86_xop_vphaddudq :
  1947. ClangBuiltin<"__builtin_ia32_vphaddudq">,
  1948. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
  1949. def int_x86_xop_vphadduwd :
  1950. ClangBuiltin<"__builtin_ia32_vphadduwd">,
  1951. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
  1952. def int_x86_xop_vphadduwq :
  1953. ClangBuiltin<"__builtin_ia32_vphadduwq">,
  1954. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v8i16_ty], [IntrNoMem]>;
  1955. def int_x86_xop_vphaddwd :
  1956. ClangBuiltin<"__builtin_ia32_vphaddwd">,
  1957. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
  1958. def int_x86_xop_vphaddwq :
  1959. ClangBuiltin<"__builtin_ia32_vphaddwq">,
  1960. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v8i16_ty], [IntrNoMem]>;
  1961. def int_x86_xop_vphsubbw :
  1962. ClangBuiltin<"__builtin_ia32_vphsubbw">,
  1963. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
  1964. def int_x86_xop_vphsubdq :
  1965. ClangBuiltin<"__builtin_ia32_vphsubdq">,
  1966. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
  1967. def int_x86_xop_vphsubwd :
  1968. ClangBuiltin<"__builtin_ia32_vphsubwd">,
  1969. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
  1970. def int_x86_xop_vpmacsdd :
  1971. ClangBuiltin<"__builtin_ia32_vpmacsdd">,
  1972. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1973. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  1974. [IntrNoMem, Commutative]>;
  1975. def int_x86_xop_vpmacsdqh :
  1976. ClangBuiltin<"__builtin_ia32_vpmacsdqh">,
  1977. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  1978. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
  1979. [IntrNoMem, Commutative]>;
  1980. def int_x86_xop_vpmacsdql :
  1981. ClangBuiltin<"__builtin_ia32_vpmacsdql">,
  1982. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  1983. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
  1984. [IntrNoMem, Commutative]>;
  1985. def int_x86_xop_vpmacssdd :
  1986. ClangBuiltin<"__builtin_ia32_vpmacssdd">,
  1987. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  1988. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  1989. [IntrNoMem, Commutative]>;
  1990. def int_x86_xop_vpmacssdqh :
  1991. ClangBuiltin<"__builtin_ia32_vpmacssdqh">,
  1992. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  1993. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
  1994. [IntrNoMem, Commutative]>;
  1995. def int_x86_xop_vpmacssdql :
  1996. ClangBuiltin<"__builtin_ia32_vpmacssdql">,
  1997. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  1998. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
  1999. [IntrNoMem, Commutative]>;
  2000. def int_x86_xop_vpmacsswd :
  2001. ClangBuiltin<"__builtin_ia32_vpmacsswd">,
  2002. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2003. [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
  2004. [IntrNoMem, Commutative]>;
  2005. def int_x86_xop_vpmacssww :
  2006. ClangBuiltin<"__builtin_ia32_vpmacssww">,
  2007. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  2008. [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
  2009. [IntrNoMem, Commutative]>;
  2010. def int_x86_xop_vpmacswd :
  2011. ClangBuiltin<"__builtin_ia32_vpmacswd">,
  2012. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2013. [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
  2014. [IntrNoMem, Commutative]>;
  2015. def int_x86_xop_vpmacsww :
  2016. ClangBuiltin<"__builtin_ia32_vpmacsww">,
  2017. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  2018. [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
  2019. [IntrNoMem, Commutative]>;
  2020. def int_x86_xop_vpmadcsswd :
  2021. ClangBuiltin<"__builtin_ia32_vpmadcsswd">,
  2022. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2023. [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
  2024. [IntrNoMem, Commutative]>;
  2025. def int_x86_xop_vpmadcswd :
  2026. ClangBuiltin<"__builtin_ia32_vpmadcswd">,
  2027. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2028. [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
  2029. [IntrNoMem, Commutative]>;
  2030. def int_x86_xop_vpperm :
  2031. ClangBuiltin<"__builtin_ia32_vpperm">,
  2032. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  2033. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
  2034. [IntrNoMem]>;
  2035. def int_x86_xop_vpshab :
  2036. ClangBuiltin<"__builtin_ia32_vpshab">,
  2037. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
  2038. [IntrNoMem]>;
  2039. def int_x86_xop_vpshad :
  2040. ClangBuiltin<"__builtin_ia32_vpshad">,
  2041. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  2042. [IntrNoMem]>;
  2043. def int_x86_xop_vpshaq :
  2044. ClangBuiltin<"__builtin_ia32_vpshaq">,
  2045. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  2046. [IntrNoMem]>;
  2047. def int_x86_xop_vpshaw :
  2048. ClangBuiltin<"__builtin_ia32_vpshaw">,
  2049. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  2050. [IntrNoMem]>;
  2051. def int_x86_xop_vpshlb :
  2052. ClangBuiltin<"__builtin_ia32_vpshlb">,
  2053. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
  2054. [IntrNoMem]>;
  2055. def int_x86_xop_vpshld :
  2056. ClangBuiltin<"__builtin_ia32_vpshld">,
  2057. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  2058. [IntrNoMem]>;
  2059. def int_x86_xop_vpshlq :
  2060. ClangBuiltin<"__builtin_ia32_vpshlq">,
  2061. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  2062. [IntrNoMem]>;
  2063. def int_x86_xop_vpshlw :
  2064. ClangBuiltin<"__builtin_ia32_vpshlw">,
  2065. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  2066. [IntrNoMem]>;
  2067. }
  2068. //===----------------------------------------------------------------------===//
  2069. // LWP
  2070. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2071. def int_x86_llwpcb :
  2072. ClangBuiltin<"__builtin_ia32_llwpcb">,
  2073. Intrinsic<[], [llvm_ptr_ty], []>;
  2074. def int_x86_slwpcb :
  2075. ClangBuiltin<"__builtin_ia32_slwpcb">,
  2076. Intrinsic<[llvm_ptr_ty], [], []>;
  2077. def int_x86_lwpins32 :
  2078. ClangBuiltin<"__builtin_ia32_lwpins32">,
  2079. Intrinsic<[llvm_i8_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
  2080. [ImmArg<ArgIndex<2>>]>;
  2081. def int_x86_lwpins64 :
  2082. ClangBuiltin<"__builtin_ia32_lwpins64">,
  2083. Intrinsic<[llvm_i8_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
  2084. [ImmArg<ArgIndex<2>>]>;
  2085. def int_x86_lwpval32 :
  2086. ClangBuiltin<"__builtin_ia32_lwpval32">,
  2087. Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
  2088. [ImmArg<ArgIndex<2>>]>;
  2089. def int_x86_lwpval64 :
  2090. ClangBuiltin<"__builtin_ia32_lwpval64">,
  2091. Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
  2092. [ImmArg<ArgIndex<2>>]>;
  2093. }
  2094. //===----------------------------------------------------------------------===//
  2095. // MMX
  2096. // Empty MMX state op.
  2097. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2098. def int_x86_mmx_emms : ClangBuiltin<"__builtin_ia32_emms">,
  2099. Intrinsic<[], [], []>;
  2100. def int_x86_mmx_femms : ClangBuiltin<"__builtin_ia32_femms">,
  2101. Intrinsic<[], [], []>;
  2102. }
  2103. // Integer arithmetic ops.
  2104. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2105. // Addition
  2106. def int_x86_mmx_padd_b : ClangBuiltin<"__builtin_ia32_paddb">,
  2107. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2108. [IntrNoMem, Commutative]>;
  2109. def int_x86_mmx_padd_w : ClangBuiltin<"__builtin_ia32_paddw">,
  2110. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2111. [IntrNoMem, Commutative]>;
  2112. def int_x86_mmx_padd_d : ClangBuiltin<"__builtin_ia32_paddd">,
  2113. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2114. [IntrNoMem, Commutative]>;
  2115. def int_x86_mmx_padd_q : ClangBuiltin<"__builtin_ia32_paddq">,
  2116. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2117. [IntrNoMem, Commutative]>;
  2118. def int_x86_mmx_padds_b : ClangBuiltin<"__builtin_ia32_paddsb">,
  2119. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2120. [IntrNoMem, Commutative]>;
  2121. def int_x86_mmx_padds_w : ClangBuiltin<"__builtin_ia32_paddsw">,
  2122. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2123. [IntrNoMem, Commutative]>;
  2124. def int_x86_mmx_paddus_b : ClangBuiltin<"__builtin_ia32_paddusb">,
  2125. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2126. [IntrNoMem, Commutative]>;
  2127. def int_x86_mmx_paddus_w : ClangBuiltin<"__builtin_ia32_paddusw">,
  2128. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2129. [IntrNoMem, Commutative]>;
  2130. // Subtraction
  2131. def int_x86_mmx_psub_b : ClangBuiltin<"__builtin_ia32_psubb">,
  2132. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2133. [IntrNoMem]>;
  2134. def int_x86_mmx_psub_w : ClangBuiltin<"__builtin_ia32_psubw">,
  2135. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2136. [IntrNoMem]>;
  2137. def int_x86_mmx_psub_d : ClangBuiltin<"__builtin_ia32_psubd">,
  2138. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2139. [IntrNoMem]>;
  2140. def int_x86_mmx_psub_q : ClangBuiltin<"__builtin_ia32_psubq">,
  2141. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2142. [IntrNoMem]>;
  2143. def int_x86_mmx_psubs_b : ClangBuiltin<"__builtin_ia32_psubsb">,
  2144. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2145. [IntrNoMem]>;
  2146. def int_x86_mmx_psubs_w : ClangBuiltin<"__builtin_ia32_psubsw">,
  2147. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2148. [IntrNoMem]>;
  2149. def int_x86_mmx_psubus_b : ClangBuiltin<"__builtin_ia32_psubusb">,
  2150. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2151. [IntrNoMem]>;
  2152. def int_x86_mmx_psubus_w : ClangBuiltin<"__builtin_ia32_psubusw">,
  2153. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2154. [IntrNoMem]>;
  2155. // Multiplication
  2156. def int_x86_mmx_pmulh_w : ClangBuiltin<"__builtin_ia32_pmulhw">,
  2157. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2158. [IntrNoMem, Commutative]>;
  2159. def int_x86_mmx_pmull_w : ClangBuiltin<"__builtin_ia32_pmullw">,
  2160. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2161. [IntrNoMem, Commutative]>;
  2162. def int_x86_mmx_pmulhu_w : ClangBuiltin<"__builtin_ia32_pmulhuw">,
  2163. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2164. [IntrNoMem, Commutative]>;
  2165. def int_x86_mmx_pmulu_dq : ClangBuiltin<"__builtin_ia32_pmuludq">,
  2166. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2167. [IntrNoMem, Commutative]>;
  2168. def int_x86_mmx_pmadd_wd : ClangBuiltin<"__builtin_ia32_pmaddwd">,
  2169. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2170. [IntrNoMem, Commutative]>;
  2171. // Bitwise operations
  2172. def int_x86_mmx_pand : ClangBuiltin<"__builtin_ia32_pand">,
  2173. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2174. [IntrNoMem, Commutative]>;
  2175. def int_x86_mmx_pandn : ClangBuiltin<"__builtin_ia32_pandn">,
  2176. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2177. [IntrNoMem]>;
  2178. def int_x86_mmx_por : ClangBuiltin<"__builtin_ia32_por">,
  2179. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2180. [IntrNoMem, Commutative]>;
  2181. def int_x86_mmx_pxor : ClangBuiltin<"__builtin_ia32_pxor">,
  2182. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2183. [IntrNoMem, Commutative]>;
  2184. // Averages
  2185. def int_x86_mmx_pavg_b : ClangBuiltin<"__builtin_ia32_pavgb">,
  2186. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2187. [IntrNoMem, Commutative]>;
  2188. def int_x86_mmx_pavg_w : ClangBuiltin<"__builtin_ia32_pavgw">,
  2189. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2190. [IntrNoMem, Commutative]>;
  2191. // Maximum
  2192. def int_x86_mmx_pmaxu_b : ClangBuiltin<"__builtin_ia32_pmaxub">,
  2193. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2194. [IntrNoMem, Commutative]>;
  2195. def int_x86_mmx_pmaxs_w : ClangBuiltin<"__builtin_ia32_pmaxsw">,
  2196. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2197. [IntrNoMem, Commutative]>;
  2198. // Minimum
  2199. def int_x86_mmx_pminu_b : ClangBuiltin<"__builtin_ia32_pminub">,
  2200. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2201. [IntrNoMem, Commutative]>;
  2202. def int_x86_mmx_pmins_w : ClangBuiltin<"__builtin_ia32_pminsw">,
  2203. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2204. [IntrNoMem, Commutative]>;
  2205. // Packed sum of absolute differences
  2206. def int_x86_mmx_psad_bw : ClangBuiltin<"__builtin_ia32_psadbw">,
  2207. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2208. [IntrNoMem, Commutative]>;
  2209. }
  2210. // Integer shift ops.
  2211. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2212. // Shift left logical
  2213. def int_x86_mmx_psll_w : ClangBuiltin<"__builtin_ia32_psllw">,
  2214. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2215. [IntrNoMem]>;
  2216. def int_x86_mmx_psll_d : ClangBuiltin<"__builtin_ia32_pslld">,
  2217. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2218. [IntrNoMem]>;
  2219. def int_x86_mmx_psll_q : ClangBuiltin<"__builtin_ia32_psllq">,
  2220. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2221. [IntrNoMem]>;
  2222. def int_x86_mmx_psrl_w : ClangBuiltin<"__builtin_ia32_psrlw">,
  2223. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2224. [IntrNoMem]>;
  2225. def int_x86_mmx_psrl_d : ClangBuiltin<"__builtin_ia32_psrld">,
  2226. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2227. [IntrNoMem]>;
  2228. def int_x86_mmx_psrl_q : ClangBuiltin<"__builtin_ia32_psrlq">,
  2229. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2230. [IntrNoMem]>;
  2231. def int_x86_mmx_psra_w : ClangBuiltin<"__builtin_ia32_psraw">,
  2232. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2233. [IntrNoMem]>;
  2234. def int_x86_mmx_psra_d : ClangBuiltin<"__builtin_ia32_psrad">,
  2235. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2236. [IntrNoMem]>;
  2237. // Oddly these don't require an immediate due to a gcc compatibility issue.
  2238. def int_x86_mmx_pslli_w : ClangBuiltin<"__builtin_ia32_psllwi">,
  2239. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
  2240. [IntrNoMem]>;
  2241. def int_x86_mmx_pslli_d : ClangBuiltin<"__builtin_ia32_pslldi">,
  2242. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
  2243. [IntrNoMem]>;
  2244. def int_x86_mmx_pslli_q : ClangBuiltin<"__builtin_ia32_psllqi">,
  2245. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
  2246. [IntrNoMem]>;
  2247. def int_x86_mmx_psrli_w : ClangBuiltin<"__builtin_ia32_psrlwi">,
  2248. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
  2249. [IntrNoMem]>;
  2250. def int_x86_mmx_psrli_d : ClangBuiltin<"__builtin_ia32_psrldi">,
  2251. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
  2252. [IntrNoMem]>;
  2253. def int_x86_mmx_psrli_q : ClangBuiltin<"__builtin_ia32_psrlqi">,
  2254. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
  2255. [IntrNoMem]>;
  2256. def int_x86_mmx_psrai_w : ClangBuiltin<"__builtin_ia32_psrawi">,
  2257. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
  2258. [IntrNoMem]>;
  2259. def int_x86_mmx_psrai_d : ClangBuiltin<"__builtin_ia32_psradi">,
  2260. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
  2261. [IntrNoMem]>;
  2262. }
  2263. // Permute
  2264. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2265. def int_x86_avx512_permvar_df_256 : ClangBuiltin<"__builtin_ia32_permvardf256">,
  2266. DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4i64_ty],
  2267. [IntrNoMem]>;
  2268. def int_x86_avx512_permvar_df_512 : ClangBuiltin<"__builtin_ia32_permvardf512">,
  2269. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8i64_ty],
  2270. [IntrNoMem]>;
  2271. def int_x86_avx512_permvar_di_256 : ClangBuiltin<"__builtin_ia32_permvardi256">,
  2272. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
  2273. [IntrNoMem]>;
  2274. def int_x86_avx512_permvar_di_512 : ClangBuiltin<"__builtin_ia32_permvardi512">,
  2275. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
  2276. [IntrNoMem]>;
  2277. def int_x86_avx512_permvar_hi_128 : ClangBuiltin<"__builtin_ia32_permvarhi128">,
  2278. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
  2279. [IntrNoMem]>;
  2280. def int_x86_avx512_permvar_hi_256 : ClangBuiltin<"__builtin_ia32_permvarhi256">,
  2281. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
  2282. [IntrNoMem]>;
  2283. def int_x86_avx512_permvar_hi_512 : ClangBuiltin<"__builtin_ia32_permvarhi512">,
  2284. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
  2285. [IntrNoMem]>;
  2286. def int_x86_avx512_permvar_qi_128 : ClangBuiltin<"__builtin_ia32_permvarqi128">,
  2287. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
  2288. [IntrNoMem]>;
  2289. def int_x86_avx512_permvar_qi_256 : ClangBuiltin<"__builtin_ia32_permvarqi256">,
  2290. DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty],
  2291. [IntrNoMem]>;
  2292. def int_x86_avx512_permvar_qi_512 : ClangBuiltin<"__builtin_ia32_permvarqi512">,
  2293. DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
  2294. [IntrNoMem]>;
  2295. def int_x86_avx512_permvar_sf_512 : ClangBuiltin<"__builtin_ia32_permvarsf512">,
  2296. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16i32_ty],
  2297. [IntrNoMem]>;
  2298. def int_x86_avx512_permvar_si_512 : ClangBuiltin<"__builtin_ia32_permvarsi512">,
  2299. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
  2300. [IntrNoMem]>;
  2301. }
  2302. // Pack ops.
  2303. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2304. def int_x86_mmx_packsswb : ClangBuiltin<"__builtin_ia32_packsswb">,
  2305. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2306. [IntrNoMem]>;
  2307. def int_x86_mmx_packssdw : ClangBuiltin<"__builtin_ia32_packssdw">,
  2308. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2309. [IntrNoMem]>;
  2310. def int_x86_mmx_packuswb : ClangBuiltin<"__builtin_ia32_packuswb">,
  2311. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2312. [IntrNoMem]>;
  2313. }
  2314. // Unpacking ops.
  2315. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2316. def int_x86_mmx_punpckhbw : ClangBuiltin<"__builtin_ia32_punpckhbw">,
  2317. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2318. [IntrNoMem]>;
  2319. def int_x86_mmx_punpckhwd : ClangBuiltin<"__builtin_ia32_punpckhwd">,
  2320. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2321. [IntrNoMem]>;
  2322. def int_x86_mmx_punpckhdq : ClangBuiltin<"__builtin_ia32_punpckhdq">,
  2323. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2324. [IntrNoMem]>;
  2325. def int_x86_mmx_punpcklbw : ClangBuiltin<"__builtin_ia32_punpcklbw">,
  2326. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2327. [IntrNoMem]>;
  2328. def int_x86_mmx_punpcklwd : ClangBuiltin<"__builtin_ia32_punpcklwd">,
  2329. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2330. [IntrNoMem]>;
  2331. def int_x86_mmx_punpckldq : ClangBuiltin<"__builtin_ia32_punpckldq">,
  2332. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2333. [IntrNoMem]>;
  2334. }
  2335. // Integer comparison ops
  2336. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2337. def int_x86_mmx_pcmpeq_b : ClangBuiltin<"__builtin_ia32_pcmpeqb">,
  2338. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2339. [IntrNoMem, Commutative]>;
  2340. def int_x86_mmx_pcmpeq_w : ClangBuiltin<"__builtin_ia32_pcmpeqw">,
  2341. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2342. [IntrNoMem, Commutative]>;
  2343. def int_x86_mmx_pcmpeq_d : ClangBuiltin<"__builtin_ia32_pcmpeqd">,
  2344. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2345. [IntrNoMem, Commutative]>;
  2346. def int_x86_mmx_pcmpgt_b : ClangBuiltin<"__builtin_ia32_pcmpgtb">,
  2347. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2348. [IntrNoMem]>;
  2349. def int_x86_mmx_pcmpgt_w : ClangBuiltin<"__builtin_ia32_pcmpgtw">,
  2350. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2351. [IntrNoMem]>;
  2352. def int_x86_mmx_pcmpgt_d : ClangBuiltin<"__builtin_ia32_pcmpgtd">,
  2353. DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
  2354. [IntrNoMem]>;
  2355. }
  2356. // Misc.
  2357. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2358. def int_x86_mmx_maskmovq : ClangBuiltin<"__builtin_ia32_maskmovq">,
  2359. Intrinsic<[], [llvm_x86mmx_ty, llvm_x86mmx_ty, llvm_ptr_ty], []>;
  2360. def int_x86_mmx_pmovmskb : ClangBuiltin<"__builtin_ia32_pmovmskb">,
  2361. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
  2362. def int_x86_mmx_movnt_dq : ClangBuiltin<"__builtin_ia32_movntq">,
  2363. Intrinsic<[], [llvm_ptrx86mmx_ty, llvm_x86mmx_ty], []>;
  2364. def int_x86_mmx_palignr_b : ClangBuiltin<"__builtin_ia32_palignr">,
  2365. DefaultAttrsIntrinsic<[llvm_x86mmx_ty],
  2366. [llvm_x86mmx_ty, llvm_x86mmx_ty, llvm_i8_ty],
  2367. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  2368. def int_x86_mmx_pextr_w : ClangBuiltin<"__builtin_ia32_vec_ext_v4hi">,
  2369. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_x86mmx_ty, llvm_i32_ty],
  2370. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2371. def int_x86_mmx_pinsr_w : ClangBuiltin<"__builtin_ia32_vec_set_v4hi">,
  2372. DefaultAttrsIntrinsic<[llvm_x86mmx_ty],
  2373. [llvm_x86mmx_ty, llvm_i32_ty, llvm_i32_ty],
  2374. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  2375. }
  2376. //===----------------------------------------------------------------------===//
  2377. // BMI
  2378. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2379. def int_x86_bmi_bextr_32 : ClangBuiltin<"__builtin_ia32_bextr_u32">,
  2380. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  2381. [IntrNoMem]>;
  2382. def int_x86_bmi_bextr_64 : ClangBuiltin<"__builtin_ia32_bextr_u64">,
  2383. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
  2384. [IntrNoMem]>;
  2385. def int_x86_bmi_bzhi_32 : ClangBuiltin<"__builtin_ia32_bzhi_si">,
  2386. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  2387. [IntrNoMem]>;
  2388. def int_x86_bmi_bzhi_64 : ClangBuiltin<"__builtin_ia32_bzhi_di">,
  2389. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
  2390. [IntrNoMem]>;
  2391. def int_x86_bmi_pdep_32 : ClangBuiltin<"__builtin_ia32_pdep_si">,
  2392. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  2393. [IntrNoMem]>;
  2394. def int_x86_bmi_pdep_64 : ClangBuiltin<"__builtin_ia32_pdep_di">,
  2395. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
  2396. [IntrNoMem]>;
  2397. def int_x86_bmi_pext_32 : ClangBuiltin<"__builtin_ia32_pext_si">,
  2398. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  2399. [IntrNoMem]>;
  2400. def int_x86_bmi_pext_64 : ClangBuiltin<"__builtin_ia32_pext_di">,
  2401. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
  2402. [IntrNoMem]>;
  2403. }
  2404. //===----------------------------------------------------------------------===//
  2405. // FS/GS Base
  2406. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2407. def int_x86_rdfsbase_32 : ClangBuiltin<"__builtin_ia32_rdfsbase32">,
  2408. Intrinsic<[llvm_i32_ty], []>;
  2409. def int_x86_rdgsbase_32 : ClangBuiltin<"__builtin_ia32_rdgsbase32">,
  2410. Intrinsic<[llvm_i32_ty], []>;
  2411. def int_x86_rdfsbase_64 : ClangBuiltin<"__builtin_ia32_rdfsbase64">,
  2412. Intrinsic<[llvm_i64_ty], []>;
  2413. def int_x86_rdgsbase_64 : ClangBuiltin<"__builtin_ia32_rdgsbase64">,
  2414. Intrinsic<[llvm_i64_ty], []>;
  2415. def int_x86_wrfsbase_32 : ClangBuiltin<"__builtin_ia32_wrfsbase32">,
  2416. Intrinsic<[], [llvm_i32_ty]>;
  2417. def int_x86_wrgsbase_32 : ClangBuiltin<"__builtin_ia32_wrgsbase32">,
  2418. Intrinsic<[], [llvm_i32_ty]>;
  2419. def int_x86_wrfsbase_64 : ClangBuiltin<"__builtin_ia32_wrfsbase64">,
  2420. Intrinsic<[], [llvm_i64_ty]>;
  2421. def int_x86_wrgsbase_64 : ClangBuiltin<"__builtin_ia32_wrgsbase64">,
  2422. Intrinsic<[], [llvm_i64_ty]>;
  2423. }
  2424. //===----------------------------------------------------------------------===//
  2425. // FXSR
  2426. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2427. def int_x86_fxrstor : ClangBuiltin<"__builtin_ia32_fxrstor">,
  2428. Intrinsic<[], [llvm_ptr_ty], []>;
  2429. def int_x86_fxrstor64 : ClangBuiltin<"__builtin_ia32_fxrstor64">,
  2430. Intrinsic<[], [llvm_ptr_ty], []>;
  2431. def int_x86_fxsave : ClangBuiltin<"__builtin_ia32_fxsave">,
  2432. Intrinsic<[], [llvm_ptr_ty], []>;
  2433. def int_x86_fxsave64 : ClangBuiltin<"__builtin_ia32_fxsave64">,
  2434. Intrinsic<[], [llvm_ptr_ty], []>;
  2435. }
  2436. //===----------------------------------------------------------------------===//
  2437. // XSAVE
  2438. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2439. def int_x86_xsave :
  2440. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2441. def int_x86_xsave64 :
  2442. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2443. def int_x86_xrstor :
  2444. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2445. def int_x86_xrstor64 :
  2446. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2447. def int_x86_xsaveopt :
  2448. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2449. def int_x86_xsaveopt64 :
  2450. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2451. def int_x86_xrstors :
  2452. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2453. def int_x86_xrstors64 :
  2454. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2455. def int_x86_xsavec :
  2456. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2457. def int_x86_xsavec64 :
  2458. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2459. def int_x86_xsaves :
  2460. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2461. def int_x86_xsaves64 :
  2462. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2463. def int_x86_xgetbv :
  2464. Intrinsic<[llvm_i64_ty], [llvm_i32_ty], []>;
  2465. def int_x86_xsetbv :
  2466. Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
  2467. }
  2468. //===----------------------------------------------------------------------===//
  2469. // CLFLUSHOPT and CLWB
  2470. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2471. def int_x86_clflushopt : ClangBuiltin<"__builtin_ia32_clflushopt">,
  2472. Intrinsic<[], [llvm_ptr_ty], []>;
  2473. def int_x86_clwb : ClangBuiltin<"__builtin_ia32_clwb">,
  2474. Intrinsic<[], [llvm_ptr_ty], []>;
  2475. }
  2476. //===----------------------------------------------------------------------===//
  2477. // Support protection key
  2478. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2479. def int_x86_rdpkru : ClangBuiltin <"__builtin_ia32_rdpkru">,
  2480. Intrinsic<[llvm_i32_ty], [], []>;
  2481. def int_x86_wrpkru : ClangBuiltin<"__builtin_ia32_wrpkru">,
  2482. Intrinsic<[], [llvm_i32_ty], []>;
  2483. }
  2484. //===----------------------------------------------------------------------===//
  2485. // Half float conversion
  2486. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2487. def int_x86_vcvtps2ph_128 : ClangBuiltin<"__builtin_ia32_vcvtps2ph">,
  2488. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_i32_ty],
  2489. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2490. def int_x86_vcvtps2ph_256 : ClangBuiltin<"__builtin_ia32_vcvtps2ph256">,
  2491. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8f32_ty, llvm_i32_ty],
  2492. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2493. def int_x86_avx512_mask_vcvtph2ps_512 :
  2494. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16i16_ty, llvm_v16f32_ty,
  2495. llvm_i16_ty, llvm_i32_ty],
  2496. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2497. def int_x86_avx512_mask_vcvtps2ph_512 : ClangBuiltin<"__builtin_ia32_vcvtps2ph512_mask">,
  2498. DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16f32_ty, llvm_i32_ty,
  2499. llvm_v16i16_ty, llvm_i16_ty],
  2500. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2501. def int_x86_avx512_mask_vcvtps2ph_256 : ClangBuiltin<"__builtin_ia32_vcvtps2ph256_mask">,
  2502. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8f32_ty, llvm_i32_ty,
  2503. llvm_v8i16_ty, llvm_i8_ty],
  2504. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2505. def int_x86_avx512_mask_vcvtps2ph_128 : ClangBuiltin<"__builtin_ia32_vcvtps2ph_mask">,
  2506. DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_i32_ty,
  2507. llvm_v8i16_ty, llvm_i8_ty],
  2508. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2509. }
  2510. //===----------------------------------------------------------------------===//
  2511. // TBM
  2512. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2513. def int_x86_tbm_bextri_u32 : ClangBuiltin<"__builtin_ia32_bextri_u32">,
  2514. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  2515. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2516. def int_x86_tbm_bextri_u64 : ClangBuiltin<"__builtin_ia32_bextri_u64">,
  2517. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
  2518. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2519. }
  2520. //===----------------------------------------------------------------------===//
  2521. // RDRAND intrinsics - Return a random value and whether it is valid.
  2522. // RDSEED intrinsics - Return a NIST SP800-90B & C compliant random value and
  2523. // whether it is valid.
  2524. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2525. // These are declared side-effecting so they don't get eliminated by CSE or
  2526. // LICM.
  2527. def int_x86_rdrand_16 : Intrinsic<[llvm_i16_ty, llvm_i32_ty], [], []>;
  2528. def int_x86_rdrand_32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty], [], []>;
  2529. def int_x86_rdrand_64 : Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
  2530. def int_x86_rdseed_16 : Intrinsic<[llvm_i16_ty, llvm_i32_ty], [], []>;
  2531. def int_x86_rdseed_32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty], [], []>;
  2532. def int_x86_rdseed_64 : Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
  2533. }
  2534. //===----------------------------------------------------------------------===//
  2535. // ADX
  2536. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2537. def int_x86_addcarry_32:
  2538. DefaultAttrsIntrinsic<[llvm_i8_ty, llvm_i32_ty],
  2539. [llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
  2540. [IntrNoMem]>;
  2541. def int_x86_addcarry_64:
  2542. DefaultAttrsIntrinsic<[llvm_i8_ty, llvm_i64_ty],
  2543. [llvm_i8_ty, llvm_i64_ty, llvm_i64_ty],
  2544. [IntrNoMem]>;
  2545. def int_x86_subborrow_32:
  2546. DefaultAttrsIntrinsic<[llvm_i8_ty, llvm_i32_ty],
  2547. [llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
  2548. [IntrNoMem]>;
  2549. def int_x86_subborrow_64:
  2550. DefaultAttrsIntrinsic<[llvm_i8_ty, llvm_i64_ty],
  2551. [llvm_i8_ty, llvm_i64_ty, llvm_i64_ty],
  2552. [IntrNoMem]>;
  2553. }
  2554. //===----------------------------------------------------------------------===//
  2555. // RTM intrinsics. Transactional Memory support.
  2556. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2557. def int_x86_xbegin : ClangBuiltin<"__builtin_ia32_xbegin">,
  2558. Intrinsic<[llvm_i32_ty], [], []>;
  2559. def int_x86_xend : ClangBuiltin<"__builtin_ia32_xend">,
  2560. Intrinsic<[], [], []>;
  2561. def int_x86_xabort : ClangBuiltin<"__builtin_ia32_xabort">,
  2562. Intrinsic<[], [llvm_i8_ty], [ImmArg<ArgIndex<0>>]>;
  2563. def int_x86_xtest : ClangBuiltin<"__builtin_ia32_xtest">,
  2564. Intrinsic<[llvm_i32_ty], [], []>;
  2565. }
  2566. //===----------------------------------------------------------------------===//
  2567. // AVX512
  2568. // Mask ops
  2569. let TargetPrefix = "x86" in {
  2570. def int_x86_avx512_kadd_b :
  2571. DefaultAttrsIntrinsic<[llvm_v8i1_ty], [llvm_v8i1_ty, llvm_v8i1_ty],
  2572. [IntrNoMem]>;
  2573. def int_x86_avx512_kadd_w :
  2574. DefaultAttrsIntrinsic<[llvm_v16i1_ty], [llvm_v16i1_ty, llvm_v16i1_ty],
  2575. [IntrNoMem]>;
  2576. def int_x86_avx512_kadd_d :
  2577. DefaultAttrsIntrinsic<[llvm_v32i1_ty], [llvm_v32i1_ty, llvm_v32i1_ty],
  2578. [IntrNoMem]>;
  2579. def int_x86_avx512_kadd_q :
  2580. DefaultAttrsIntrinsic<[llvm_v64i1_ty], [llvm_v64i1_ty, llvm_v64i1_ty],
  2581. [IntrNoMem]>;
  2582. def int_x86_avx512_ktestc_b :
  2583. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8i1_ty, llvm_v8i1_ty],
  2584. [IntrNoMem]>;
  2585. def int_x86_avx512_ktestc_w :
  2586. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v16i1_ty, llvm_v16i1_ty],
  2587. [IntrNoMem]>;
  2588. def int_x86_avx512_ktestc_d :
  2589. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v32i1_ty, llvm_v32i1_ty],
  2590. [IntrNoMem]>;
  2591. def int_x86_avx512_ktestc_q :
  2592. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v64i1_ty, llvm_v64i1_ty],
  2593. [IntrNoMem]>;
  2594. def int_x86_avx512_ktestz_b :
  2595. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8i1_ty, llvm_v8i1_ty],
  2596. [IntrNoMem]>;
  2597. def int_x86_avx512_ktestz_w :
  2598. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v16i1_ty, llvm_v16i1_ty],
  2599. [IntrNoMem]>;
  2600. def int_x86_avx512_ktestz_d :
  2601. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v32i1_ty, llvm_v32i1_ty],
  2602. [IntrNoMem]>;
  2603. def int_x86_avx512_ktestz_q :
  2604. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v64i1_ty, llvm_v64i1_ty],
  2605. [IntrNoMem]>;
  2606. }
  2607. // Conversion ops
  2608. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2609. def int_x86_avx512_cvttss2si : ClangBuiltin<"__builtin_ia32_vcvttss2si32">,
  2610. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
  2611. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2612. def int_x86_avx512_cvttss2si64 : ClangBuiltin<"__builtin_ia32_vcvttss2si64">,
  2613. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
  2614. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2615. def int_x86_avx512_cvttss2usi : ClangBuiltin<"__builtin_ia32_vcvttss2usi32">,
  2616. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
  2617. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2618. def int_x86_avx512_cvttss2usi64 : ClangBuiltin<"__builtin_ia32_vcvttss2usi64">,
  2619. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
  2620. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2621. def int_x86_avx512_cvtusi2ss : ClangBuiltin<"__builtin_ia32_cvtusi2ss32">,
  2622. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  2623. [llvm_v4f32_ty, llvm_i32_ty, llvm_i32_ty],
  2624. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  2625. def int_x86_avx512_cvtusi642ss : ClangBuiltin<"__builtin_ia32_cvtusi2ss64">,
  2626. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  2627. [llvm_v4f32_ty, llvm_i64_ty, llvm_i32_ty],
  2628. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  2629. def int_x86_avx512_cvttsd2si : ClangBuiltin<"__builtin_ia32_vcvttsd2si32">,
  2630. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
  2631. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2632. def int_x86_avx512_cvttsd2si64 : ClangBuiltin<"__builtin_ia32_vcvttsd2si64">,
  2633. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
  2634. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2635. def int_x86_avx512_cvttsd2usi : ClangBuiltin<"__builtin_ia32_vcvttsd2usi32">,
  2636. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
  2637. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2638. def int_x86_avx512_cvttsd2usi64 : ClangBuiltin<"__builtin_ia32_vcvttsd2usi64">,
  2639. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
  2640. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2641. def int_x86_avx512_cvtusi642sd : ClangBuiltin<"__builtin_ia32_cvtusi2sd64">,
  2642. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  2643. [llvm_v2f64_ty, llvm_i64_ty, llvm_i32_ty],
  2644. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  2645. def int_x86_avx512_vcvtss2usi32 : ClangBuiltin<"__builtin_ia32_vcvtss2usi32">,
  2646. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
  2647. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2648. def int_x86_avx512_vcvtss2usi64 : ClangBuiltin<"__builtin_ia32_vcvtss2usi64">,
  2649. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
  2650. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2651. def int_x86_avx512_vcvtss2si32 : ClangBuiltin<"__builtin_ia32_vcvtss2si32">,
  2652. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
  2653. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2654. def int_x86_avx512_vcvtss2si64 : ClangBuiltin<"__builtin_ia32_vcvtss2si64">,
  2655. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
  2656. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2657. def int_x86_avx512_vcvtsd2usi32 : ClangBuiltin<"__builtin_ia32_vcvtsd2usi32">,
  2658. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
  2659. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2660. def int_x86_avx512_vcvtsd2usi64 : ClangBuiltin<"__builtin_ia32_vcvtsd2usi64">,
  2661. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
  2662. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2663. def int_x86_avx512_vcvtsd2si32 : ClangBuiltin<"__builtin_ia32_vcvtsd2si32">,
  2664. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
  2665. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2666. def int_x86_avx512_vcvtsd2si64 : ClangBuiltin<"__builtin_ia32_vcvtsd2si64">,
  2667. DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
  2668. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2669. def int_x86_avx512_cvtsi2ss32 : ClangBuiltin<"__builtin_ia32_cvtsi2ss32">,
  2670. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  2671. [llvm_v4f32_ty, llvm_i32_ty, llvm_i32_ty],
  2672. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  2673. def int_x86_avx512_cvtsi2ss64 : ClangBuiltin<"__builtin_ia32_cvtsi2ss64">,
  2674. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  2675. [llvm_v4f32_ty, llvm_i64_ty, llvm_i32_ty],
  2676. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  2677. def int_x86_avx512_cvtsi2sd64 : ClangBuiltin<"__builtin_ia32_cvtsi2sd64">,
  2678. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  2679. [llvm_v2f64_ty, llvm_i64_ty, llvm_i32_ty],
  2680. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  2681. }
  2682. // Pack ops.
  2683. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2684. def int_x86_avx512_packsswb_512 : ClangBuiltin<"__builtin_ia32_packsswb512">,
  2685. DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v32i16_ty,llvm_v32i16_ty],
  2686. [IntrNoMem]>;
  2687. def int_x86_avx512_packssdw_512 : ClangBuiltin<"__builtin_ia32_packssdw512">,
  2688. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
  2689. [IntrNoMem]>;
  2690. def int_x86_avx512_packuswb_512 : ClangBuiltin<"__builtin_ia32_packuswb512">,
  2691. DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v32i16_ty,llvm_v32i16_ty],
  2692. [IntrNoMem]>;
  2693. def int_x86_avx512_packusdw_512 : ClangBuiltin<"__builtin_ia32_packusdw512">,
  2694. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
  2695. [IntrNoMem]>;
  2696. }
  2697. // Vector convert
  2698. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  2699. def int_x86_avx512_sitofp_round :
  2700. DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty, llvm_i32_ty],
  2701. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2702. def int_x86_avx512_uitofp_round :
  2703. DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty, llvm_i32_ty],
  2704. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2705. def int_x86_avx512_mask_cvtpd2dq_128 :
  2706. ClangBuiltin<"__builtin_ia32_cvtpd2dq128_mask">,
  2707. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2708. [llvm_v2f64_ty, llvm_v4i32_ty, llvm_i8_ty],
  2709. [IntrNoMem]>;
  2710. def int_x86_avx512_mask_cvtpd2dq_512 :
  2711. ClangBuiltin<"__builtin_ia32_cvtpd2dq512_mask">,
  2712. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  2713. [llvm_v8f64_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
  2714. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2715. def int_x86_avx512_mask_cvtpd2ps_512 :
  2716. ClangBuiltin<"__builtin_ia32_cvtpd2ps512_mask">,
  2717. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  2718. [llvm_v8f64_ty, llvm_v8f32_ty, llvm_i8_ty, llvm_i32_ty],
  2719. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2720. def int_x86_avx512_mask_cvtsd2ss_round :
  2721. ClangBuiltin<"__builtin_ia32_cvtsd2ss_round_mask">,
  2722. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  2723. [llvm_v4f32_ty, llvm_v2f64_ty, llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty],
  2724. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  2725. def int_x86_avx512_mask_cvtss2sd_round :
  2726. ClangBuiltin<"__builtin_ia32_cvtss2sd_round_mask">,
  2727. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  2728. [llvm_v2f64_ty, llvm_v4f32_ty, llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty],
  2729. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  2730. def int_x86_avx512_mask_cvtpd2ps :
  2731. ClangBuiltin<"__builtin_ia32_cvtpd2ps_mask">,
  2732. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  2733. [llvm_v2f64_ty, llvm_v4f32_ty, llvm_i8_ty],
  2734. [IntrNoMem]>;
  2735. def int_x86_avx512_mask_cvtpd2qq_128 :
  2736. ClangBuiltin<"__builtin_ia32_cvtpd2qq128_mask">,
  2737. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  2738. [llvm_v2f64_ty, llvm_v2i64_ty, llvm_i8_ty],
  2739. [IntrNoMem]>;
  2740. def int_x86_avx512_mask_cvtpd2qq_256 :
  2741. ClangBuiltin<"__builtin_ia32_cvtpd2qq256_mask">,
  2742. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  2743. [llvm_v4f64_ty, llvm_v4i64_ty, llvm_i8_ty],
  2744. [IntrNoMem]>;
  2745. def int_x86_avx512_mask_cvtpd2qq_512 :
  2746. ClangBuiltin<"__builtin_ia32_cvtpd2qq512_mask">,
  2747. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  2748. [llvm_v8f64_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  2749. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2750. def int_x86_avx512_mask_cvtpd2udq_128 :
  2751. ClangBuiltin<"__builtin_ia32_cvtpd2udq128_mask">,
  2752. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2753. [llvm_v2f64_ty, llvm_v4i32_ty, llvm_i8_ty],
  2754. [IntrNoMem]>;
  2755. def int_x86_avx512_mask_cvtpd2udq_256 :
  2756. ClangBuiltin<"__builtin_ia32_cvtpd2udq256_mask">,
  2757. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2758. [llvm_v4f64_ty, llvm_v4i32_ty, llvm_i8_ty],
  2759. [IntrNoMem]>;
  2760. def int_x86_avx512_mask_cvtpd2udq_512 :
  2761. ClangBuiltin<"__builtin_ia32_cvtpd2udq512_mask">,
  2762. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  2763. [llvm_v8f64_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
  2764. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2765. def int_x86_avx512_mask_cvtpd2uqq_128 :
  2766. ClangBuiltin<"__builtin_ia32_cvtpd2uqq128_mask">,
  2767. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  2768. [llvm_v2f64_ty, llvm_v2i64_ty, llvm_i8_ty],
  2769. [IntrNoMem]>;
  2770. def int_x86_avx512_mask_cvtpd2uqq_256 :
  2771. ClangBuiltin<"__builtin_ia32_cvtpd2uqq256_mask">,
  2772. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  2773. [llvm_v4f64_ty, llvm_v4i64_ty, llvm_i8_ty],
  2774. [IntrNoMem]>;
  2775. def int_x86_avx512_mask_cvtpd2uqq_512 :
  2776. ClangBuiltin<"__builtin_ia32_cvtpd2uqq512_mask">,
  2777. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  2778. [llvm_v8f64_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  2779. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2780. def int_x86_avx512_mask_cvtps2dq_128 :
  2781. ClangBuiltin<"__builtin_ia32_cvtps2dq128_mask">,
  2782. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2783. [llvm_v4f32_ty, llvm_v4i32_ty, llvm_i8_ty],
  2784. [IntrNoMem]>;
  2785. def int_x86_avx512_mask_cvtps2dq_256 :
  2786. ClangBuiltin<"__builtin_ia32_cvtps2dq256_mask">,
  2787. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  2788. [llvm_v8f32_ty, llvm_v8i32_ty, llvm_i8_ty],
  2789. [IntrNoMem]>;
  2790. def int_x86_avx512_mask_cvtps2dq_512 :
  2791. ClangBuiltin<"__builtin_ia32_cvtps2dq512_mask">,
  2792. DefaultAttrsIntrinsic<[llvm_v16i32_ty],
  2793. [llvm_v16f32_ty, llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
  2794. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2795. def int_x86_avx512_mask_cvtps2pd_512 :
  2796. ClangBuiltin<"__builtin_ia32_cvtps2pd512_mask">,
  2797. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  2798. [llvm_v8f32_ty, llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty],
  2799. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2800. def int_x86_avx512_mask_cvtps2qq_128 :
  2801. ClangBuiltin<"__builtin_ia32_cvtps2qq128_mask">,
  2802. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  2803. [llvm_v4f32_ty, llvm_v2i64_ty, llvm_i8_ty],
  2804. [IntrNoMem]>;
  2805. def int_x86_avx512_mask_cvtps2qq_256 :
  2806. ClangBuiltin<"__builtin_ia32_cvtps2qq256_mask">,
  2807. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  2808. [llvm_v4f32_ty, llvm_v4i64_ty, llvm_i8_ty],
  2809. [IntrNoMem]>;
  2810. def int_x86_avx512_mask_cvtps2qq_512 :
  2811. ClangBuiltin<"__builtin_ia32_cvtps2qq512_mask">,
  2812. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  2813. [llvm_v8f32_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  2814. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2815. def int_x86_avx512_mask_cvtps2udq_128 :
  2816. ClangBuiltin<"__builtin_ia32_cvtps2udq128_mask">,
  2817. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2818. [llvm_v4f32_ty, llvm_v4i32_ty, llvm_i8_ty],
  2819. [IntrNoMem]>;
  2820. def int_x86_avx512_mask_cvtps2udq_256 :
  2821. ClangBuiltin<"__builtin_ia32_cvtps2udq256_mask">,
  2822. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  2823. [llvm_v8f32_ty, llvm_v8i32_ty, llvm_i8_ty],
  2824. [IntrNoMem]>;
  2825. def int_x86_avx512_mask_cvtps2udq_512 :
  2826. ClangBuiltin<"__builtin_ia32_cvtps2udq512_mask">,
  2827. DefaultAttrsIntrinsic<[llvm_v16i32_ty],
  2828. [llvm_v16f32_ty, llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
  2829. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2830. def int_x86_avx512_mask_cvtps2uqq_128 :
  2831. ClangBuiltin<"__builtin_ia32_cvtps2uqq128_mask">,
  2832. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  2833. [llvm_v4f32_ty, llvm_v2i64_ty, llvm_i8_ty],
  2834. [IntrNoMem]>;
  2835. def int_x86_avx512_mask_cvtps2uqq_256 :
  2836. ClangBuiltin<"__builtin_ia32_cvtps2uqq256_mask">,
  2837. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  2838. [llvm_v4f32_ty, llvm_v4i64_ty, llvm_i8_ty],
  2839. [IntrNoMem]>;
  2840. def int_x86_avx512_mask_cvtps2uqq_512 :
  2841. ClangBuiltin<"__builtin_ia32_cvtps2uqq512_mask">,
  2842. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  2843. [llvm_v8f32_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  2844. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2845. def int_x86_avx512_mask_cvtqq2ps_128 :
  2846. ClangBuiltin<"__builtin_ia32_cvtqq2ps128_mask">,
  2847. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  2848. [llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty],
  2849. [IntrNoMem]>;
  2850. def int_x86_avx512_mask_cvttpd2dq_128 :
  2851. ClangBuiltin<"__builtin_ia32_cvttpd2dq128_mask">,
  2852. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2853. [llvm_v2f64_ty, llvm_v4i32_ty, llvm_i8_ty],
  2854. [IntrNoMem]>;
  2855. def int_x86_avx512_mask_cvttpd2dq_512 :
  2856. ClangBuiltin<"__builtin_ia32_cvttpd2dq512_mask">,
  2857. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  2858. [llvm_v8f64_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
  2859. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2860. def int_x86_avx512_mask_cvttpd2qq_128 :
  2861. ClangBuiltin<"__builtin_ia32_cvttpd2qq128_mask">,
  2862. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  2863. [llvm_v2f64_ty, llvm_v2i64_ty, llvm_i8_ty],
  2864. [IntrNoMem]>;
  2865. def int_x86_avx512_mask_cvttpd2qq_256 :
  2866. ClangBuiltin<"__builtin_ia32_cvttpd2qq256_mask">,
  2867. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  2868. [llvm_v4f64_ty, llvm_v4i64_ty, llvm_i8_ty],
  2869. [IntrNoMem]>;
  2870. def int_x86_avx512_mask_cvttpd2qq_512 :
  2871. ClangBuiltin<"__builtin_ia32_cvttpd2qq512_mask">,
  2872. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  2873. [llvm_v8f64_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  2874. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2875. def int_x86_avx512_mask_cvttpd2udq_128 :
  2876. ClangBuiltin<"__builtin_ia32_cvttpd2udq128_mask">,
  2877. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2878. [llvm_v2f64_ty, llvm_v4i32_ty, llvm_i8_ty],
  2879. [IntrNoMem]>;
  2880. def int_x86_avx512_mask_cvttpd2udq_256 :
  2881. ClangBuiltin<"__builtin_ia32_cvttpd2udq256_mask">,
  2882. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2883. [llvm_v4f64_ty, llvm_v4i32_ty, llvm_i8_ty],
  2884. [IntrNoMem]>;
  2885. def int_x86_avx512_mask_cvttpd2udq_512 :
  2886. ClangBuiltin<"__builtin_ia32_cvttpd2udq512_mask">,
  2887. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  2888. [llvm_v8f64_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
  2889. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2890. def int_x86_avx512_mask_cvttpd2uqq_128 :
  2891. ClangBuiltin<"__builtin_ia32_cvttpd2uqq128_mask">,
  2892. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  2893. [llvm_v2f64_ty, llvm_v2i64_ty, llvm_i8_ty],
  2894. [IntrNoMem]>;
  2895. def int_x86_avx512_mask_cvttpd2uqq_256 :
  2896. ClangBuiltin<"__builtin_ia32_cvttpd2uqq256_mask">,
  2897. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  2898. [llvm_v4f64_ty, llvm_v4i64_ty, llvm_i8_ty],
  2899. [IntrNoMem]>;
  2900. def int_x86_avx512_mask_cvttpd2uqq_512 :
  2901. ClangBuiltin<"__builtin_ia32_cvttpd2uqq512_mask">,
  2902. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  2903. [llvm_v8f64_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  2904. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2905. def int_x86_avx512_mask_cvttps2dq_512 :
  2906. ClangBuiltin<"__builtin_ia32_cvttps2dq512_mask">,
  2907. DefaultAttrsIntrinsic<[llvm_v16i32_ty],
  2908. [llvm_v16f32_ty, llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
  2909. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2910. def int_x86_avx512_mask_cvttps2qq_128 :
  2911. ClangBuiltin<"__builtin_ia32_cvttps2qq128_mask">,
  2912. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  2913. [llvm_v4f32_ty, llvm_v2i64_ty, llvm_i8_ty],
  2914. [IntrNoMem]>;
  2915. def int_x86_avx512_mask_cvttps2qq_256 :
  2916. ClangBuiltin<"__builtin_ia32_cvttps2qq256_mask">,
  2917. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  2918. [llvm_v4f32_ty, llvm_v4i64_ty, llvm_i8_ty],
  2919. [IntrNoMem]>;
  2920. def int_x86_avx512_mask_cvttps2qq_512 :
  2921. ClangBuiltin<"__builtin_ia32_cvttps2qq512_mask">,
  2922. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  2923. [llvm_v8f32_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  2924. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2925. def int_x86_avx512_mask_cvttps2udq_128 :
  2926. ClangBuiltin<"__builtin_ia32_cvttps2udq128_mask">,
  2927. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  2928. [llvm_v4f32_ty, llvm_v4i32_ty, llvm_i8_ty],
  2929. [IntrNoMem]>;
  2930. def int_x86_avx512_mask_cvttps2udq_256 :
  2931. ClangBuiltin<"__builtin_ia32_cvttps2udq256_mask">,
  2932. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  2933. [llvm_v8f32_ty, llvm_v8i32_ty, llvm_i8_ty],
  2934. [IntrNoMem]>;
  2935. def int_x86_avx512_mask_cvttps2udq_512 :
  2936. ClangBuiltin<"__builtin_ia32_cvttps2udq512_mask">,
  2937. DefaultAttrsIntrinsic<[llvm_v16i32_ty],
  2938. [llvm_v16f32_ty, llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
  2939. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2940. def int_x86_avx512_mask_cvttps2uqq_128 :
  2941. ClangBuiltin<"__builtin_ia32_cvttps2uqq128_mask">,
  2942. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  2943. [llvm_v4f32_ty, llvm_v2i64_ty, llvm_i8_ty],
  2944. [IntrNoMem]>;
  2945. def int_x86_avx512_mask_cvttps2uqq_256 :
  2946. ClangBuiltin<"__builtin_ia32_cvttps2uqq256_mask">,
  2947. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  2948. [llvm_v4f32_ty, llvm_v4i64_ty, llvm_i8_ty],
  2949. [IntrNoMem]>;
  2950. def int_x86_avx512_mask_cvttps2uqq_512 :
  2951. ClangBuiltin<"__builtin_ia32_cvttps2uqq512_mask">,
  2952. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  2953. [llvm_v8f32_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  2954. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  2955. def int_x86_avx512_mask_cvtuqq2ps_128 :
  2956. ClangBuiltin<"__builtin_ia32_cvtuqq2ps128_mask">,
  2957. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  2958. [llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty],
  2959. [IntrNoMem]>;
  2960. def int_x86_avx512_mask_rndscale_pd_128 : ClangBuiltin<"__builtin_ia32_rndscalepd_128_mask">,
  2961. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  2962. [llvm_v2f64_ty, llvm_i32_ty, llvm_v2f64_ty,
  2963. llvm_i8_ty],
  2964. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2965. def int_x86_avx512_mask_rndscale_pd_256 : ClangBuiltin<"__builtin_ia32_rndscalepd_256_mask">,
  2966. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  2967. [llvm_v4f64_ty, llvm_i32_ty, llvm_v4f64_ty,
  2968. llvm_i8_ty],
  2969. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2970. def int_x86_avx512_mask_rndscale_pd_512 : ClangBuiltin<"__builtin_ia32_rndscalepd_mask">,
  2971. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  2972. [llvm_v8f64_ty, llvm_i32_ty, llvm_v8f64_ty,
  2973. llvm_i8_ty, llvm_i32_ty],
  2974. [IntrNoMem, ImmArg<ArgIndex<1>>,
  2975. ImmArg<ArgIndex<4>>]>;
  2976. def int_x86_avx512_mask_rndscale_ps_128 : ClangBuiltin<"__builtin_ia32_rndscaleps_128_mask">,
  2977. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  2978. [llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty,
  2979. llvm_i8_ty],
  2980. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2981. def int_x86_avx512_mask_rndscale_ps_256 : ClangBuiltin<"__builtin_ia32_rndscaleps_256_mask">,
  2982. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  2983. [llvm_v8f32_ty, llvm_i32_ty, llvm_v8f32_ty,
  2984. llvm_i8_ty],
  2985. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2986. def int_x86_avx512_mask_rndscale_ps_512 : ClangBuiltin<"__builtin_ia32_rndscaleps_mask">,
  2987. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  2988. [llvm_v16f32_ty, llvm_i32_ty, llvm_v16f32_ty,
  2989. llvm_i16_ty, llvm_i32_ty],
  2990. [IntrNoMem, ImmArg<ArgIndex<1>>,
  2991. ImmArg<ArgIndex<4>>]>;
  2992. def int_x86_avx512_mask_reduce_pd_128 : ClangBuiltin<"__builtin_ia32_reducepd128_mask">,
  2993. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  2994. [llvm_v2f64_ty, llvm_i32_ty, llvm_v2f64_ty,
  2995. llvm_i8_ty],
  2996. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  2997. def int_x86_avx512_mask_reduce_pd_256 : ClangBuiltin<"__builtin_ia32_reducepd256_mask">,
  2998. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  2999. [llvm_v4f64_ty, llvm_i32_ty, llvm_v4f64_ty,
  3000. llvm_i8_ty],
  3001. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  3002. def int_x86_avx512_mask_reduce_pd_512 : ClangBuiltin<"__builtin_ia32_reducepd512_mask">,
  3003. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3004. [llvm_v8f64_ty, llvm_i32_ty, llvm_v8f64_ty,
  3005. llvm_i8_ty, llvm_i32_ty],
  3006. [IntrNoMem, ImmArg<ArgIndex<1>>,
  3007. ImmArg<ArgIndex<4>>]>;
  3008. def int_x86_avx512_mask_reduce_ps_128 : ClangBuiltin<"__builtin_ia32_reduceps128_mask">,
  3009. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3010. [llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty,
  3011. llvm_i8_ty],
  3012. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  3013. def int_x86_avx512_mask_reduce_ps_256 : ClangBuiltin<"__builtin_ia32_reduceps256_mask">,
  3014. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  3015. [llvm_v8f32_ty, llvm_i32_ty, llvm_v8f32_ty,
  3016. llvm_i8_ty],
  3017. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  3018. def int_x86_avx512_mask_reduce_ps_512 : ClangBuiltin<"__builtin_ia32_reduceps512_mask">,
  3019. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3020. [llvm_v16f32_ty, llvm_i32_ty, llvm_v16f32_ty,
  3021. llvm_i16_ty, llvm_i32_ty],
  3022. [IntrNoMem, ImmArg<ArgIndex<1>>,
  3023. ImmArg<ArgIndex<4>>]>;
  3024. def int_x86_avx512_mask_range_pd_128 : ClangBuiltin<"__builtin_ia32_rangepd128_mask">,
  3025. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3026. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty,
  3027. llvm_v2f64_ty, llvm_i8_ty],
  3028. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3029. def int_x86_avx512_mask_range_pd_256 : ClangBuiltin<"__builtin_ia32_rangepd256_mask">,
  3030. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3031. [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i32_ty,
  3032. llvm_v4f64_ty, llvm_i8_ty],
  3033. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3034. def int_x86_avx512_mask_range_pd_512 : ClangBuiltin<"__builtin_ia32_rangepd512_mask">,
  3035. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3036. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty,
  3037. llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty],
  3038. [IntrNoMem, ImmArg<ArgIndex<2>>,
  3039. ImmArg<ArgIndex<5>>]>;
  3040. def int_x86_avx512_mask_range_ps_128 : ClangBuiltin<"__builtin_ia32_rangeps128_mask">,
  3041. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3042. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty,
  3043. llvm_v4f32_ty, llvm_i8_ty],
  3044. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3045. def int_x86_avx512_mask_range_ps_256 : ClangBuiltin<"__builtin_ia32_rangeps256_mask">,
  3046. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  3047. [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i32_ty,
  3048. llvm_v8f32_ty, llvm_i8_ty],
  3049. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3050. def int_x86_avx512_mask_range_ps_512 : ClangBuiltin<"__builtin_ia32_rangeps512_mask">,
  3051. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3052. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty,
  3053. llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty],
  3054. [IntrNoMem, ImmArg<ArgIndex<2>>,
  3055. ImmArg<ArgIndex<5>>]>;
  3056. }
  3057. // Vector broadcast from mask
  3058. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  3059. def int_x86_avx512_broadcastmw_512 :
  3060. ClangBuiltin<"__builtin_ia32_broadcastmw512">,
  3061. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_i16_ty], [IntrNoMem]>;
  3062. def int_x86_avx512_broadcastmw_256 :
  3063. ClangBuiltin<"__builtin_ia32_broadcastmw256">,
  3064. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_i16_ty], [IntrNoMem]>;
  3065. def int_x86_avx512_broadcastmw_128 :
  3066. ClangBuiltin<"__builtin_ia32_broadcastmw128">,
  3067. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_i16_ty], [IntrNoMem]>;
  3068. def int_x86_avx512_broadcastmb_512 :
  3069. ClangBuiltin<"__builtin_ia32_broadcastmb512">,
  3070. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_i8_ty], [IntrNoMem]>;
  3071. def int_x86_avx512_broadcastmb_256 :
  3072. ClangBuiltin<"__builtin_ia32_broadcastmb256">,
  3073. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_i8_ty], [IntrNoMem]>;
  3074. def int_x86_avx512_broadcastmb_128 :
  3075. ClangBuiltin<"__builtin_ia32_broadcastmb128">,
  3076. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_i8_ty], [IntrNoMem]>;
  3077. }
  3078. // Arithmetic ops
  3079. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
  3080. def int_x86_avx512_add_ps_512 : ClangBuiltin<"__builtin_ia32_addps512">,
  3081. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
  3082. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3083. def int_x86_avx512_add_pd_512 : ClangBuiltin<"__builtin_ia32_addpd512">,
  3084. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
  3085. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3086. def int_x86_avx512_sub_ps_512 : ClangBuiltin<"__builtin_ia32_subps512">,
  3087. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
  3088. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3089. def int_x86_avx512_sub_pd_512 : ClangBuiltin<"__builtin_ia32_subpd512">,
  3090. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
  3091. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3092. def int_x86_avx512_mul_ps_512 : ClangBuiltin<"__builtin_ia32_mulps512">,
  3093. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
  3094. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3095. def int_x86_avx512_mul_pd_512 : ClangBuiltin<"__builtin_ia32_mulpd512">,
  3096. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
  3097. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3098. def int_x86_avx512_div_ps_512 : ClangBuiltin<"__builtin_ia32_divps512">,
  3099. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
  3100. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3101. def int_x86_avx512_div_pd_512 : ClangBuiltin<"__builtin_ia32_divpd512">,
  3102. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
  3103. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3104. def int_x86_avx512_max_ps_512 : ClangBuiltin<"__builtin_ia32_maxps512">,
  3105. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
  3106. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3107. def int_x86_avx512_max_pd_512 : ClangBuiltin<"__builtin_ia32_maxpd512">,
  3108. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
  3109. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3110. def int_x86_avx512_min_ps_512 : ClangBuiltin<"__builtin_ia32_minps512">,
  3111. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
  3112. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3113. def int_x86_avx512_min_pd_512 : ClangBuiltin<"__builtin_ia32_minpd512">,
  3114. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
  3115. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3116. def int_x86_avx512_mask_add_ss_round : ClangBuiltin<"__builtin_ia32_addss_round_mask">,
  3117. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3118. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3119. llvm_i8_ty, llvm_i32_ty],
  3120. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3121. def int_x86_avx512_mask_div_ss_round : ClangBuiltin<"__builtin_ia32_divss_round_mask">,
  3122. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3123. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3124. llvm_i8_ty, llvm_i32_ty],
  3125. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3126. def int_x86_avx512_mask_mul_ss_round : ClangBuiltin<"__builtin_ia32_mulss_round_mask">,
  3127. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3128. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3129. llvm_i8_ty, llvm_i32_ty],
  3130. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3131. def int_x86_avx512_mask_sub_ss_round : ClangBuiltin<"__builtin_ia32_subss_round_mask">,
  3132. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3133. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3134. llvm_i8_ty, llvm_i32_ty],
  3135. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3136. def int_x86_avx512_mask_max_ss_round : ClangBuiltin<"__builtin_ia32_maxss_round_mask">,
  3137. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3138. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3139. llvm_i8_ty, llvm_i32_ty],
  3140. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3141. def int_x86_avx512_mask_min_ss_round : ClangBuiltin<"__builtin_ia32_minss_round_mask">,
  3142. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3143. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3144. llvm_i8_ty, llvm_i32_ty],
  3145. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3146. def int_x86_avx512_mask_add_sd_round : ClangBuiltin<"__builtin_ia32_addsd_round_mask">,
  3147. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3148. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3149. llvm_i8_ty, llvm_i32_ty],
  3150. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3151. def int_x86_avx512_mask_div_sd_round : ClangBuiltin<"__builtin_ia32_divsd_round_mask">,
  3152. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3153. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3154. llvm_i8_ty, llvm_i32_ty],
  3155. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3156. def int_x86_avx512_mask_mul_sd_round : ClangBuiltin<"__builtin_ia32_mulsd_round_mask">,
  3157. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3158. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3159. llvm_i8_ty, llvm_i32_ty],
  3160. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3161. def int_x86_avx512_mask_sub_sd_round : ClangBuiltin<"__builtin_ia32_subsd_round_mask">,
  3162. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3163. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3164. llvm_i8_ty, llvm_i32_ty],
  3165. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3166. def int_x86_avx512_mask_max_sd_round : ClangBuiltin<"__builtin_ia32_maxsd_round_mask">,
  3167. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3168. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3169. llvm_i8_ty, llvm_i32_ty],
  3170. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3171. def int_x86_avx512_mask_min_sd_round : ClangBuiltin<"__builtin_ia32_minsd_round_mask">,
  3172. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3173. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3174. llvm_i8_ty, llvm_i32_ty],
  3175. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3176. def int_x86_avx512_mask_rndscale_ss : ClangBuiltin<"__builtin_ia32_rndscaless_round_mask">,
  3177. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3178. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3179. llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
  3180. [IntrNoMem, ImmArg<ArgIndex<4>>,
  3181. ImmArg<ArgIndex<5>>]>;
  3182. def int_x86_avx512_mask_rndscale_sd : ClangBuiltin<"__builtin_ia32_rndscalesd_round_mask">,
  3183. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3184. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3185. llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
  3186. [IntrNoMem, ImmArg<ArgIndex<4>>,
  3187. ImmArg<ArgIndex<5>>]>;
  3188. def int_x86_avx512_mask_range_ss : ClangBuiltin<"__builtin_ia32_rangess128_round_mask">,
  3189. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3190. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3191. llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
  3192. [IntrNoMem, ImmArg<ArgIndex<4>>,
  3193. ImmArg<ArgIndex<5>>]>;
  3194. def int_x86_avx512_mask_range_sd : ClangBuiltin<"__builtin_ia32_rangesd128_round_mask">,
  3195. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3196. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3197. llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
  3198. [IntrNoMem, ImmArg<ArgIndex<4>>,
  3199. ImmArg<ArgIndex<5>>]>;
  3200. def int_x86_avx512_mask_reduce_ss : ClangBuiltin<"__builtin_ia32_reducess_mask">,
  3201. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3202. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3203. llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
  3204. [IntrNoMem, ImmArg<ArgIndex<4>>,
  3205. ImmArg<ArgIndex<5>>]>;
  3206. def int_x86_avx512_mask_reduce_sd : ClangBuiltin<"__builtin_ia32_reducesd_mask">,
  3207. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3208. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3209. llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
  3210. [IntrNoMem, ImmArg<ArgIndex<4>>,
  3211. ImmArg<ArgIndex<5>>]>;
  3212. def int_x86_avx512_mask_scalef_sd : ClangBuiltin<"__builtin_ia32_scalefsd_round_mask">,
  3213. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3214. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3215. llvm_i8_ty, llvm_i32_ty],
  3216. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3217. def int_x86_avx512_mask_scalef_ss : ClangBuiltin<"__builtin_ia32_scalefss_round_mask">,
  3218. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3219. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3220. llvm_i8_ty, llvm_i32_ty],
  3221. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3222. def int_x86_avx512_mask_scalef_pd_128 : ClangBuiltin<"__builtin_ia32_scalefpd128_mask">,
  3223. DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
  3224. llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
  3225. def int_x86_avx512_mask_scalef_pd_256 : ClangBuiltin<"__builtin_ia32_scalefpd256_mask">,
  3226. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3227. [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,
  3228. llvm_i8_ty],
  3229. [IntrNoMem]>;
  3230. def int_x86_avx512_mask_scalef_pd_512 : ClangBuiltin<"__builtin_ia32_scalefpd512_mask">,
  3231. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3232. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,
  3233. llvm_i8_ty, llvm_i32_ty],
  3234. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3235. def int_x86_avx512_mask_scalef_ps_128 : ClangBuiltin<"__builtin_ia32_scalefps128_mask">,
  3236. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
  3237. llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
  3238. def int_x86_avx512_mask_scalef_ps_256 : ClangBuiltin<"__builtin_ia32_scalefps256_mask">,
  3239. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
  3240. llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>;
  3241. def int_x86_avx512_mask_scalef_ps_512 : ClangBuiltin<"__builtin_ia32_scalefps512_mask">,
  3242. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3243. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
  3244. llvm_i16_ty, llvm_i32_ty],
  3245. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3246. def int_x86_avx512_mask_sqrt_ss :
  3247. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3248. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3249. llvm_i8_ty, llvm_i32_ty],
  3250. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3251. def int_x86_avx512_mask_sqrt_sd :
  3252. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3253. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3254. llvm_i8_ty, llvm_i32_ty],
  3255. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3256. def int_x86_avx512_sqrt_pd_512 :
  3257. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i32_ty],
  3258. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  3259. def int_x86_avx512_sqrt_ps_512 :
  3260. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_i32_ty],
  3261. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  3262. def int_x86_avx512_mask_fixupimm_pd_128 :
  3263. ClangBuiltin<"__builtin_ia32_fixupimmpd128_mask">,
  3264. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3265. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty],
  3266. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3267. def int_x86_avx512_maskz_fixupimm_pd_128 :
  3268. ClangBuiltin<"__builtin_ia32_fixupimmpd128_maskz">,
  3269. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3270. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty],
  3271. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3272. def int_x86_avx512_mask_fixupimm_pd_256 :
  3273. ClangBuiltin<"__builtin_ia32_fixupimmpd256_mask">,
  3274. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3275. [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4i64_ty, llvm_i32_ty, llvm_i8_ty],
  3276. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3277. def int_x86_avx512_maskz_fixupimm_pd_256 :
  3278. ClangBuiltin<"__builtin_ia32_fixupimmpd256_maskz">,
  3279. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3280. [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4i64_ty, llvm_i32_ty, llvm_i8_ty],
  3281. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3282. def int_x86_avx512_mask_fixupimm_pd_512 :
  3283. ClangBuiltin<"__builtin_ia32_fixupimmpd512_mask">,
  3284. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3285. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8i64_ty, llvm_i32_ty, llvm_i8_ty,
  3286. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
  3287. def int_x86_avx512_maskz_fixupimm_pd_512 :
  3288. ClangBuiltin<"__builtin_ia32_fixupimmpd512_maskz">,
  3289. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3290. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8i64_ty, llvm_i32_ty, llvm_i8_ty,
  3291. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
  3292. def int_x86_avx512_mask_fixupimm_ps_128 :
  3293. ClangBuiltin<"__builtin_ia32_fixupimmps128_mask">,
  3294. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3295. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty],
  3296. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3297. def int_x86_avx512_maskz_fixupimm_ps_128 :
  3298. ClangBuiltin<"__builtin_ia32_fixupimmps128_maskz">,
  3299. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3300. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty],
  3301. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3302. def int_x86_avx512_mask_fixupimm_ps_256 :
  3303. ClangBuiltin<"__builtin_ia32_fixupimmps256_mask">,
  3304. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  3305. [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8i32_ty, llvm_i32_ty, llvm_i8_ty],
  3306. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3307. def int_x86_avx512_maskz_fixupimm_ps_256 :
  3308. ClangBuiltin<"__builtin_ia32_fixupimmps256_maskz">,
  3309. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  3310. [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8i32_ty, llvm_i32_ty, llvm_i8_ty],
  3311. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3312. def int_x86_avx512_mask_fixupimm_ps_512 :
  3313. ClangBuiltin<"__builtin_ia32_fixupimmps512_mask">,
  3314. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3315. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16i32_ty, llvm_i32_ty,
  3316. llvm_i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
  3317. def int_x86_avx512_maskz_fixupimm_ps_512 :
  3318. ClangBuiltin<"__builtin_ia32_fixupimmps512_maskz">,
  3319. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3320. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16i32_ty, llvm_i32_ty,
  3321. llvm_i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
  3322. def int_x86_avx512_mask_fixupimm_sd :
  3323. ClangBuiltin<"__builtin_ia32_fixupimmsd_mask">,
  3324. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3325. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty,
  3326. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
  3327. def int_x86_avx512_maskz_fixupimm_sd :
  3328. ClangBuiltin<"__builtin_ia32_fixupimmsd_maskz">,
  3329. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3330. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty,
  3331. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
  3332. def int_x86_avx512_mask_fixupimm_ss :
  3333. ClangBuiltin<"__builtin_ia32_fixupimmss_mask">,
  3334. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3335. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty,
  3336. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
  3337. def int_x86_avx512_maskz_fixupimm_ss :
  3338. ClangBuiltin<"__builtin_ia32_fixupimmss_maskz">,
  3339. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3340. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty,
  3341. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
  3342. def int_x86_avx512_mask_getexp_pd_128 : ClangBuiltin<"__builtin_ia32_getexppd128_mask">,
  3343. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3344. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
  3345. [IntrNoMem]>;
  3346. def int_x86_avx512_mask_getexp_pd_256 : ClangBuiltin<"__builtin_ia32_getexppd256_mask">,
  3347. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3348. [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i8_ty],
  3349. [IntrNoMem]>;
  3350. def int_x86_avx512_mask_getexp_pd_512 : ClangBuiltin<"__builtin_ia32_getexppd512_mask">,
  3351. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3352. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty,
  3353. llvm_i32_ty],
  3354. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3355. def int_x86_avx512_mask_getexp_ps_128 : ClangBuiltin<"__builtin_ia32_getexpps128_mask">,
  3356. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3357. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
  3358. [IntrNoMem]>;
  3359. def int_x86_avx512_mask_getexp_ps_256 : ClangBuiltin<"__builtin_ia32_getexpps256_mask">,
  3360. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  3361. [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
  3362. [IntrNoMem]>;
  3363. def int_x86_avx512_mask_getexp_ps_512 : ClangBuiltin<"__builtin_ia32_getexpps512_mask">,
  3364. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3365. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty,
  3366. llvm_i32_ty],
  3367. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3368. def int_x86_avx512_mask_getexp_ss : ClangBuiltin<"__builtin_ia32_getexpss128_round_mask">,
  3369. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3370. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3371. llvm_i8_ty, llvm_i32_ty],
  3372. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3373. def int_x86_avx512_mask_getexp_sd : ClangBuiltin<"__builtin_ia32_getexpsd128_round_mask">,
  3374. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3375. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3376. llvm_i8_ty, llvm_i32_ty],
  3377. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3378. def int_x86_avx512_mask_getmant_pd_128 :
  3379. ClangBuiltin<"__builtin_ia32_getmantpd128_mask">,
  3380. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3381. [llvm_v2f64_ty,llvm_i32_ty, llvm_v2f64_ty, llvm_i8_ty],
  3382. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  3383. def int_x86_avx512_mask_getmant_pd_256 :
  3384. ClangBuiltin<"__builtin_ia32_getmantpd256_mask">,
  3385. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3386. [llvm_v4f64_ty,llvm_i32_ty, llvm_v4f64_ty, llvm_i8_ty],
  3387. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  3388. def int_x86_avx512_mask_getmant_pd_512 :
  3389. ClangBuiltin<"__builtin_ia32_getmantpd512_mask">,
  3390. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3391. [llvm_v8f64_ty,llvm_i32_ty, llvm_v8f64_ty, llvm_i8_ty,llvm_i32_ty ],
  3392. [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<4>>]>;
  3393. def int_x86_avx512_mask_getmant_ps_128 :
  3394. ClangBuiltin<"__builtin_ia32_getmantps128_mask">,
  3395. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3396. [llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty, llvm_i8_ty],
  3397. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  3398. def int_x86_avx512_mask_getmant_ps_256 :
  3399. ClangBuiltin<"__builtin_ia32_getmantps256_mask">,
  3400. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  3401. [llvm_v8f32_ty, llvm_i32_ty, llvm_v8f32_ty, llvm_i8_ty],
  3402. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  3403. def int_x86_avx512_mask_getmant_ps_512 :
  3404. ClangBuiltin<"__builtin_ia32_getmantps512_mask">,
  3405. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3406. [llvm_v16f32_ty,llvm_i32_ty, llvm_v16f32_ty,llvm_i16_ty,llvm_i32_ty],
  3407. [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<4>>]>;
  3408. def int_x86_avx512_mask_getmant_ss :
  3409. ClangBuiltin<"__builtin_ia32_getmantss_round_mask">,
  3410. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3411. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty,
  3412. llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<5>>]>;
  3413. def int_x86_avx512_mask_getmant_sd :
  3414. ClangBuiltin<"__builtin_ia32_getmantsd_round_mask">,
  3415. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3416. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty, llvm_v2f64_ty,
  3417. llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<5>>]>;
  3418. def int_x86_avx512_rsqrt14_ss : ClangBuiltin<"__builtin_ia32_rsqrt14ss_mask">,
  3419. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3420. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3421. llvm_i8_ty],
  3422. [IntrNoMem]>;
  3423. def int_x86_avx512_rsqrt14_sd : ClangBuiltin<"__builtin_ia32_rsqrt14sd_mask">,
  3424. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3425. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3426. llvm_i8_ty],
  3427. [IntrNoMem]>;
  3428. def int_x86_avx512_rsqrt14_pd_128 : ClangBuiltin<"__builtin_ia32_rsqrt14pd128_mask">,
  3429. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3430. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
  3431. [IntrNoMem]>;
  3432. def int_x86_avx512_rsqrt14_pd_256 : ClangBuiltin<"__builtin_ia32_rsqrt14pd256_mask">,
  3433. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3434. [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i8_ty],
  3435. [IntrNoMem]>;
  3436. def int_x86_avx512_rsqrt14_pd_512 : ClangBuiltin<"__builtin_ia32_rsqrt14pd512_mask">,
  3437. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3438. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty],
  3439. [IntrNoMem]>;
  3440. def int_x86_avx512_rsqrt14_ps_128 : ClangBuiltin<"__builtin_ia32_rsqrt14ps128_mask">,
  3441. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3442. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
  3443. [IntrNoMem]>;
  3444. def int_x86_avx512_rsqrt14_ps_256 : ClangBuiltin<"__builtin_ia32_rsqrt14ps256_mask">,
  3445. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  3446. [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
  3447. [IntrNoMem]>;
  3448. def int_x86_avx512_rsqrt14_ps_512 : ClangBuiltin<"__builtin_ia32_rsqrt14ps512_mask">,
  3449. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3450. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty],
  3451. [IntrNoMem]>;
  3452. def int_x86_avx512_rcp14_ss : ClangBuiltin<"__builtin_ia32_rcp14ss_mask">,
  3453. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3454. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3455. llvm_i8_ty],
  3456. [IntrNoMem]>;
  3457. def int_x86_avx512_rcp14_sd : ClangBuiltin<"__builtin_ia32_rcp14sd_mask">,
  3458. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3459. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3460. llvm_i8_ty],
  3461. [IntrNoMem]>;
  3462. def int_x86_avx512_rcp14_pd_128 : ClangBuiltin<"__builtin_ia32_rcp14pd128_mask">,
  3463. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3464. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
  3465. [IntrNoMem]>;
  3466. def int_x86_avx512_rcp14_pd_256 : ClangBuiltin<"__builtin_ia32_rcp14pd256_mask">,
  3467. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3468. [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i8_ty],
  3469. [IntrNoMem]>;
  3470. def int_x86_avx512_rcp14_pd_512 : ClangBuiltin<"__builtin_ia32_rcp14pd512_mask">,
  3471. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3472. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty],
  3473. [IntrNoMem]>;
  3474. def int_x86_avx512_rcp14_ps_128 : ClangBuiltin<"__builtin_ia32_rcp14ps128_mask">,
  3475. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3476. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
  3477. [IntrNoMem]>;
  3478. def int_x86_avx512_rcp14_ps_256 : ClangBuiltin<"__builtin_ia32_rcp14ps256_mask">,
  3479. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  3480. [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
  3481. [IntrNoMem]>;
  3482. def int_x86_avx512_rcp14_ps_512 : ClangBuiltin<"__builtin_ia32_rcp14ps512_mask">,
  3483. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3484. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty],
  3485. [IntrNoMem]>;
  3486. def int_x86_avx512_rcp28_ps : ClangBuiltin<"__builtin_ia32_rcp28ps_mask">,
  3487. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3488. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty,
  3489. llvm_i32_ty],
  3490. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3491. def int_x86_avx512_rcp28_pd : ClangBuiltin<"__builtin_ia32_rcp28pd_mask">,
  3492. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3493. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty,
  3494. llvm_i32_ty],
  3495. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3496. def int_x86_avx512_exp2_ps : ClangBuiltin<"__builtin_ia32_exp2ps_mask">,
  3497. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3498. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty,
  3499. llvm_i32_ty],
  3500. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3501. def int_x86_avx512_exp2_pd : ClangBuiltin<"__builtin_ia32_exp2pd_mask">,
  3502. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3503. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty,
  3504. llvm_i32_ty],
  3505. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3506. def int_x86_avx512_rcp28_ss : ClangBuiltin<"__builtin_ia32_rcp28ss_round_mask">,
  3507. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3508. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3509. llvm_i8_ty, llvm_i32_ty],
  3510. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3511. def int_x86_avx512_rcp28_sd : ClangBuiltin<"__builtin_ia32_rcp28sd_round_mask">,
  3512. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3513. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3514. llvm_i8_ty, llvm_i32_ty],
  3515. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3516. def int_x86_avx512_rsqrt28_ps : ClangBuiltin<"__builtin_ia32_rsqrt28ps_mask">,
  3517. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  3518. [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty,
  3519. llvm_i32_ty],
  3520. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3521. def int_x86_avx512_rsqrt28_pd : ClangBuiltin<"__builtin_ia32_rsqrt28pd_mask">,
  3522. DefaultAttrsIntrinsic<[llvm_v8f64_ty],
  3523. [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty,
  3524. llvm_i32_ty],
  3525. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  3526. def int_x86_avx512_rsqrt28_ss : ClangBuiltin<"__builtin_ia32_rsqrt28ss_round_mask">,
  3527. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3528. [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  3529. llvm_i8_ty, llvm_i32_ty],
  3530. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3531. def int_x86_avx512_rsqrt28_sd : ClangBuiltin<"__builtin_ia32_rsqrt28sd_round_mask">,
  3532. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3533. [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
  3534. llvm_i8_ty, llvm_i32_ty],
  3535. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  3536. def int_x86_avx512_psad_bw_512 : ClangBuiltin<"__builtin_ia32_psadbw512">,
  3537. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
  3538. [IntrNoMem, Commutative]>;
  3539. }
  3540. // Integer arithmetic ops
  3541. let TargetPrefix = "x86" in {
  3542. def int_x86_avx512_pmulhu_w_512 : ClangBuiltin<"__builtin_ia32_pmulhuw512">,
  3543. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
  3544. [IntrNoMem, Commutative]>;
  3545. def int_x86_avx512_pmulh_w_512 : ClangBuiltin<"__builtin_ia32_pmulhw512">,
  3546. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
  3547. [IntrNoMem, Commutative]>;
  3548. def int_x86_avx512_pavg_b_512 : ClangBuiltin<"__builtin_ia32_pavgb512">,
  3549. DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
  3550. [IntrNoMem]>;
  3551. def int_x86_avx512_pavg_w_512 : ClangBuiltin<"__builtin_ia32_pavgw512">,
  3552. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
  3553. [IntrNoMem]>;
  3554. def int_x86_avx512_pmaddw_d_512 : ClangBuiltin<"__builtin_ia32_pmaddwd512">,
  3555. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
  3556. [IntrNoMem, Commutative]>;
  3557. def int_x86_avx512_pmaddubs_w_512 : ClangBuiltin<"__builtin_ia32_pmaddubsw512">,
  3558. DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
  3559. [IntrNoMem]>;
  3560. def int_x86_avx512_dbpsadbw_128 :
  3561. ClangBuiltin<"__builtin_ia32_dbpsadbw128">,
  3562. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  3563. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
  3564. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3565. def int_x86_avx512_dbpsadbw_256 :
  3566. ClangBuiltin<"__builtin_ia32_dbpsadbw256">,
  3567. DefaultAttrsIntrinsic<[llvm_v16i16_ty],
  3568. [llvm_v32i8_ty, llvm_v32i8_ty, llvm_i32_ty],
  3569. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3570. def int_x86_avx512_dbpsadbw_512 :
  3571. ClangBuiltin<"__builtin_ia32_dbpsadbw512">,
  3572. DefaultAttrsIntrinsic<[llvm_v32i16_ty],
  3573. [llvm_v64i8_ty, llvm_v64i8_ty, llvm_i32_ty],
  3574. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  3575. }
  3576. // Gather and Scatter ops
  3577. let TargetPrefix = "x86" in {
  3578. // NOTE: These are deprecated in favor of the versions that take a vXi1 mask.
  3579. // NOTE: These can't be ArgMemOnly because you can put the address completely
  3580. // in the index register.
  3581. def int_x86_avx512_gather_dpd_512 :
  3582. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
  3583. llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
  3584. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3585. def int_x86_avx512_gather_dps_512 :
  3586. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_ptr_ty,
  3587. llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
  3588. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3589. def int_x86_avx512_gather_qpd_512 :
  3590. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
  3591. llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  3592. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3593. def int_x86_avx512_gather_qps_512 :
  3594. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty,
  3595. llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  3596. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3597. def int_x86_avx512_gather_dpq_512 :
  3598. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
  3599. llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
  3600. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3601. def int_x86_avx512_gather_dpi_512 :
  3602. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_ptr_ty,
  3603. llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
  3604. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3605. def int_x86_avx512_gather_qpq_512 :
  3606. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
  3607. llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  3608. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3609. def int_x86_avx512_gather_qpi_512 :
  3610. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty,
  3611. llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
  3612. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3613. def int_x86_avx512_gather3div2_df :
  3614. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3615. [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
  3616. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3617. def int_x86_avx512_gather3div2_di :
  3618. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  3619. [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
  3620. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3621. def int_x86_avx512_gather3div4_df :
  3622. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3623. [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
  3624. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3625. def int_x86_avx512_gather3div4_di :
  3626. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  3627. [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
  3628. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3629. def int_x86_avx512_gather3div4_sf :
  3630. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3631. [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
  3632. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3633. def int_x86_avx512_gather3div4_si :
  3634. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  3635. [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
  3636. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3637. def int_x86_avx512_gather3div8_sf :
  3638. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3639. [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
  3640. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3641. def int_x86_avx512_gather3div8_si :
  3642. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  3643. [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
  3644. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3645. def int_x86_avx512_gather3siv2_df :
  3646. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3647. [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
  3648. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3649. def int_x86_avx512_gather3siv2_di:
  3650. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  3651. [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
  3652. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3653. def int_x86_avx512_gather3siv4_df :
  3654. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3655. [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
  3656. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3657. def int_x86_avx512_gather3siv4_di :
  3658. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  3659. [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
  3660. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3661. def int_x86_avx512_gather3siv4_sf :
  3662. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3663. [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
  3664. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3665. def int_x86_avx512_gather3siv4_si :
  3666. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  3667. [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
  3668. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3669. def int_x86_avx512_gather3siv8_sf :
  3670. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  3671. [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
  3672. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3673. def int_x86_avx512_gather3siv8_si :
  3674. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  3675. [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
  3676. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3677. // scatter
  3678. // NOTE: These are deprecated in favor of the versions that take a vXi1 mask.
  3679. // NOTE: These can't be ArgMemOnly because you can put the address completely
  3680. // in the index register.
  3681. def int_x86_avx512_scatter_dpd_512 :
  3682. Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
  3683. llvm_v8i32_ty, llvm_v8f64_ty, llvm_i32_ty],
  3684. [ImmArg<ArgIndex<4>>]>;
  3685. def int_x86_avx512_scatter_dps_512 :
  3686. Intrinsic<[], [llvm_ptr_ty, llvm_i16_ty,
  3687. llvm_v16i32_ty, llvm_v16f32_ty, llvm_i32_ty],
  3688. [ImmArg<ArgIndex<4>>]>;
  3689. def int_x86_avx512_scatter_qpd_512 :
  3690. Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
  3691. llvm_v8i64_ty, llvm_v8f64_ty, llvm_i32_ty],
  3692. [ImmArg<ArgIndex<4>>]>;
  3693. def int_x86_avx512_scatter_qps_512 :
  3694. Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
  3695. llvm_v8i64_ty, llvm_v8f32_ty, llvm_i32_ty],
  3696. [ImmArg<ArgIndex<4>>]>;
  3697. def int_x86_avx512_scatter_dpq_512 :
  3698. Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
  3699. llvm_v8i32_ty, llvm_v8i64_ty, llvm_i32_ty],
  3700. [ImmArg<ArgIndex<4>>]>;
  3701. def int_x86_avx512_scatter_dpi_512 :
  3702. Intrinsic<[], [llvm_ptr_ty, llvm_i16_ty,
  3703. llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty],
  3704. [ImmArg<ArgIndex<4>>]>;
  3705. def int_x86_avx512_scatter_qpq_512 :
  3706. Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,llvm_v8i64_ty, llvm_v8i64_ty,
  3707. llvm_i32_ty],
  3708. [ImmArg<ArgIndex<4>>]>;
  3709. def int_x86_avx512_scatter_qpi_512 :
  3710. Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_v8i32_ty,
  3711. llvm_i32_ty],
  3712. [ImmArg<ArgIndex<4>>]>;
  3713. def int_x86_avx512_scatterdiv2_df :
  3714. Intrinsic<[],
  3715. [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i32_ty],
  3716. [ImmArg<ArgIndex<4>>]>;
  3717. def int_x86_avx512_scatterdiv2_di :
  3718. Intrinsic<[],
  3719. [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
  3720. [ImmArg<ArgIndex<4>>]>;
  3721. def int_x86_avx512_scatterdiv4_df :
  3722. Intrinsic<[],
  3723. [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i32_ty],
  3724. [ImmArg<ArgIndex<4>>]>;
  3725. def int_x86_avx512_scatterdiv4_di :
  3726. Intrinsic<[],
  3727. [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty],
  3728. [ImmArg<ArgIndex<4>>]>;
  3729. def int_x86_avx512_scatterdiv4_sf :
  3730. Intrinsic<[],
  3731. [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i32_ty],
  3732. [ImmArg<ArgIndex<4>>]>;
  3733. def int_x86_avx512_scatterdiv4_si :
  3734. Intrinsic<[],
  3735. [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i32_ty],
  3736. [ImmArg<ArgIndex<4>>]>;
  3737. def int_x86_avx512_scatterdiv8_sf :
  3738. Intrinsic<[],
  3739. [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i32_ty],
  3740. [ImmArg<ArgIndex<4>>]>;
  3741. def int_x86_avx512_scatterdiv8_si :
  3742. Intrinsic<[],
  3743. [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i32_ty],
  3744. [ImmArg<ArgIndex<4>>]>;
  3745. def int_x86_avx512_scattersiv2_df :
  3746. Intrinsic<[],
  3747. [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i32_ty],
  3748. [ImmArg<ArgIndex<4>>]>;
  3749. def int_x86_avx512_scattersiv2_di :
  3750. Intrinsic<[],
  3751. [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i32_ty],
  3752. [ImmArg<ArgIndex<4>>]>;
  3753. def int_x86_avx512_scattersiv4_df :
  3754. Intrinsic<[],
  3755. [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i32_ty],
  3756. [ImmArg<ArgIndex<4>>]>;
  3757. def int_x86_avx512_scattersiv4_di :
  3758. Intrinsic<[],
  3759. [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i32_ty],
  3760. [ImmArg<ArgIndex<4>>]>;
  3761. def int_x86_avx512_scattersiv4_sf :
  3762. Intrinsic<[],
  3763. [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
  3764. [ImmArg<ArgIndex<4>>]>;
  3765. def int_x86_avx512_scattersiv4_si :
  3766. Intrinsic<[],
  3767. [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
  3768. [ImmArg<ArgIndex<4>>]>;
  3769. def int_x86_avx512_scattersiv8_sf :
  3770. Intrinsic<[],
  3771. [llvm_ptr_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i32_ty],
  3772. [ImmArg<ArgIndex<4>>]>;
  3773. def int_x86_avx512_scattersiv8_si :
  3774. Intrinsic<[],
  3775. [llvm_ptr_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty],
  3776. [ImmArg<ArgIndex<4>>]>;
  3777. // gather prefetch
  3778. // NOTE: These can't be ArgMemOnly because you can put the address completely
  3779. // in the index register.
  3780. def int_x86_avx512_gatherpf_dpd_512 : ClangBuiltin<"__builtin_ia32_gatherpfdpd">,
  3781. Intrinsic<[], [llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty,
  3782. llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
  3783. def int_x86_avx512_gatherpf_dps_512 : ClangBuiltin<"__builtin_ia32_gatherpfdps">,
  3784. Intrinsic<[], [llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty,
  3785. llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
  3786. def int_x86_avx512_gatherpf_qpd_512 : ClangBuiltin<"__builtin_ia32_gatherpfqpd">,
  3787. Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
  3788. llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
  3789. def int_x86_avx512_gatherpf_qps_512 : ClangBuiltin<"__builtin_ia32_gatherpfqps">,
  3790. Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
  3791. llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
  3792. // scatter prefetch
  3793. // NOTE: These can't be ArgMemOnly because you can put the address completely
  3794. // in the index register.
  3795. def int_x86_avx512_scatterpf_dpd_512 : ClangBuiltin<"__builtin_ia32_scatterpfdpd">,
  3796. Intrinsic<[], [llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty,
  3797. llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
  3798. def int_x86_avx512_scatterpf_dps_512 : ClangBuiltin<"__builtin_ia32_scatterpfdps">,
  3799. Intrinsic<[], [llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty,
  3800. llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
  3801. def int_x86_avx512_scatterpf_qpd_512 : ClangBuiltin<"__builtin_ia32_scatterpfqpd">,
  3802. Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
  3803. llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
  3804. def int_x86_avx512_scatterpf_qps_512 : ClangBuiltin<"__builtin_ia32_scatterpfqps">,
  3805. Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
  3806. llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
  3807. }
  3808. // AVX512 gather/scatter intrinsics that use vXi1 masks.
  3809. let TargetPrefix = "x86" in {
  3810. // NOTE: These can't be ArgMemOnly because you can put the address completely
  3811. // in the index register.
  3812. def int_x86_avx512_mask_gather_dpd_512 :
  3813. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
  3814. llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
  3815. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3816. def int_x86_avx512_mask_gather_dps_512 :
  3817. DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_ptr_ty,
  3818. llvm_v16i32_ty, llvm_v16i1_ty, llvm_i32_ty],
  3819. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3820. def int_x86_avx512_mask_gather_qpd_512 :
  3821. DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
  3822. llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
  3823. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3824. def int_x86_avx512_mask_gather_qps_512 :
  3825. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty,
  3826. llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
  3827. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3828. def int_x86_avx512_mask_gather_dpq_512 :
  3829. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
  3830. llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
  3831. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3832. def int_x86_avx512_mask_gather_dpi_512 :
  3833. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_ptr_ty,
  3834. llvm_v16i32_ty, llvm_v16i1_ty, llvm_i32_ty],
  3835. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3836. def int_x86_avx512_mask_gather_qpq_512 :
  3837. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
  3838. llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
  3839. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3840. def int_x86_avx512_mask_gather_qpi_512 :
  3841. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty,
  3842. llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
  3843. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3844. def int_x86_avx512_mask_gather3div2_df :
  3845. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3846. [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
  3847. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3848. def int_x86_avx512_mask_gather3div2_di :
  3849. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  3850. [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
  3851. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3852. def int_x86_avx512_mask_gather3div4_df :
  3853. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3854. [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
  3855. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3856. def int_x86_avx512_mask_gather3div4_di :
  3857. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  3858. [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
  3859. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3860. def int_x86_avx512_mask_gather3div4_sf :
  3861. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3862. [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
  3863. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3864. def int_x86_avx512_mask_gather3div4_si :
  3865. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  3866. [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
  3867. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3868. def int_x86_avx512_mask_gather3div8_sf :
  3869. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3870. [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
  3871. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3872. def int_x86_avx512_mask_gather3div8_si :
  3873. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  3874. [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
  3875. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3876. def int_x86_avx512_mask_gather3siv2_df :
  3877. DefaultAttrsIntrinsic<[llvm_v2f64_ty],
  3878. [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i1_ty, llvm_i32_ty],
  3879. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3880. def int_x86_avx512_mask_gather3siv2_di :
  3881. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  3882. [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i1_ty, llvm_i32_ty],
  3883. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3884. def int_x86_avx512_mask_gather3siv4_df :
  3885. DefaultAttrsIntrinsic<[llvm_v4f64_ty],
  3886. [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
  3887. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3888. def int_x86_avx512_mask_gather3siv4_di :
  3889. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  3890. [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
  3891. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3892. def int_x86_avx512_mask_gather3siv4_sf :
  3893. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  3894. [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
  3895. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3896. def int_x86_avx512_mask_gather3siv4_si :
  3897. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  3898. [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
  3899. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3900. def int_x86_avx512_mask_gather3siv8_sf :
  3901. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  3902. [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
  3903. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3904. def int_x86_avx512_mask_gather3siv8_si :
  3905. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  3906. [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
  3907. [IntrReadMem, ImmArg<ArgIndex<4>>]>;
  3908. def int_x86_avx512_mask_scatter_dpd_512 :
  3909. Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
  3910. llvm_v8i32_ty, llvm_v8f64_ty, llvm_i32_ty],
  3911. [ImmArg<ArgIndex<4>>]>;
  3912. def int_x86_avx512_mask_scatter_dps_512 :
  3913. Intrinsic<[], [llvm_ptr_ty, llvm_v16i1_ty,
  3914. llvm_v16i32_ty, llvm_v16f32_ty, llvm_i32_ty],
  3915. [ImmArg<ArgIndex<4>>]>;
  3916. def int_x86_avx512_mask_scatter_qpd_512 :
  3917. Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
  3918. llvm_v8i64_ty, llvm_v8f64_ty, llvm_i32_ty],
  3919. [ImmArg<ArgIndex<4>>]>;
  3920. def int_x86_avx512_mask_scatter_qps_512 :
  3921. Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
  3922. llvm_v8i64_ty, llvm_v8f32_ty, llvm_i32_ty],
  3923. [ImmArg<ArgIndex<4>>]>;
  3924. // NOTE: These can't be ArgMemOnly because you can put the address completely
  3925. // in the index register.
  3926. def int_x86_avx512_mask_scatter_dpq_512 :
  3927. Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
  3928. llvm_v8i32_ty, llvm_v8i64_ty, llvm_i32_ty],
  3929. [ImmArg<ArgIndex<4>>]>;
  3930. def int_x86_avx512_mask_scatter_dpi_512 :
  3931. Intrinsic<[], [llvm_ptr_ty, llvm_v16i1_ty,
  3932. llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty],
  3933. [ImmArg<ArgIndex<4>>]>;
  3934. def int_x86_avx512_mask_scatter_qpq_512 :
  3935. Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,llvm_v8i64_ty, llvm_v8i64_ty,
  3936. llvm_i32_ty],
  3937. [ImmArg<ArgIndex<4>>]>;
  3938. def int_x86_avx512_mask_scatter_qpi_512 :
  3939. Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i64_ty, llvm_v8i32_ty,
  3940. llvm_i32_ty],
  3941. [ImmArg<ArgIndex<4>>]>;
  3942. def int_x86_avx512_mask_scatterdiv2_df :
  3943. Intrinsic<[],
  3944. [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i32_ty],
  3945. [ImmArg<ArgIndex<4>>]>;
  3946. def int_x86_avx512_mask_scatterdiv2_di :
  3947. Intrinsic<[],
  3948. [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
  3949. [ImmArg<ArgIndex<4>>]>;
  3950. def int_x86_avx512_mask_scatterdiv4_df :
  3951. Intrinsic<[],
  3952. [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i32_ty],
  3953. [ImmArg<ArgIndex<4>>]>;
  3954. def int_x86_avx512_mask_scatterdiv4_di :
  3955. Intrinsic<[],
  3956. [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty],
  3957. [ImmArg<ArgIndex<4>>]>;
  3958. def int_x86_avx512_mask_scatterdiv4_sf :
  3959. Intrinsic<[],
  3960. [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i32_ty],
  3961. [ImmArg<ArgIndex<4>>]>;
  3962. def int_x86_avx512_mask_scatterdiv4_si :
  3963. Intrinsic<[],
  3964. [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i32_ty],
  3965. [ImmArg<ArgIndex<4>>]>;
  3966. def int_x86_avx512_mask_scatterdiv8_sf :
  3967. Intrinsic<[],
  3968. [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i32_ty],
  3969. [ImmArg<ArgIndex<4>>]>;
  3970. def int_x86_avx512_mask_scatterdiv8_si :
  3971. Intrinsic<[],
  3972. [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i32_ty],
  3973. [ImmArg<ArgIndex<4>>]>;
  3974. def int_x86_avx512_mask_scattersiv2_df :
  3975. Intrinsic<[],
  3976. [llvm_ptr_ty, llvm_v2i1_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i32_ty],
  3977. [ImmArg<ArgIndex<4>>]>;
  3978. def int_x86_avx512_mask_scattersiv2_di :
  3979. Intrinsic<[],
  3980. [llvm_ptr_ty, llvm_v2i1_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i32_ty],
  3981. [ImmArg<ArgIndex<4>>]>;
  3982. def int_x86_avx512_mask_scattersiv4_df :
  3983. Intrinsic<[],
  3984. [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i32_ty],
  3985. [ImmArg<ArgIndex<4>>]>;
  3986. def int_x86_avx512_mask_scattersiv4_di :
  3987. Intrinsic<[],
  3988. [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i32_ty],
  3989. [ImmArg<ArgIndex<4>>]>;
  3990. def int_x86_avx512_mask_scattersiv4_sf :
  3991. Intrinsic<[],
  3992. [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
  3993. [ImmArg<ArgIndex<4>>]>;
  3994. def int_x86_avx512_mask_scattersiv4_si :
  3995. Intrinsic<[],
  3996. [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
  3997. [ImmArg<ArgIndex<4>>]>;
  3998. def int_x86_avx512_mask_scattersiv8_sf :
  3999. Intrinsic<[],
  4000. [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i32_ty],
  4001. [ImmArg<ArgIndex<4>>]>;
  4002. def int_x86_avx512_mask_scattersiv8_si :
  4003. Intrinsic<[],
  4004. [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty],
  4005. [ImmArg<ArgIndex<4>>]>;
  4006. }
  4007. // AVX-512 conflict detection instruction
  4008. // Instructions that count the number of leading zero bits
  4009. let TargetPrefix = "x86" in {
  4010. def int_x86_avx512_conflict_d_128 :
  4011. ClangBuiltin<"__builtin_ia32_vpconflictsi_128">,
  4012. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
  4013. def int_x86_avx512_conflict_d_256 :
  4014. ClangBuiltin<"__builtin_ia32_vpconflictsi_256">,
  4015. DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty], [IntrNoMem]>;
  4016. def int_x86_avx512_conflict_d_512 :
  4017. ClangBuiltin<"__builtin_ia32_vpconflictsi_512">,
  4018. DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty],
  4019. [IntrNoMem]>;
  4020. def int_x86_avx512_conflict_q_128 :
  4021. ClangBuiltin<"__builtin_ia32_vpconflictdi_128">,
  4022. DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
  4023. def int_x86_avx512_conflict_q_256 :
  4024. ClangBuiltin<"__builtin_ia32_vpconflictdi_256">,
  4025. DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty], [IntrNoMem]>;
  4026. def int_x86_avx512_conflict_q_512 :
  4027. ClangBuiltin<"__builtin_ia32_vpconflictdi_512">,
  4028. DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty], [IntrNoMem]>;
  4029. }
  4030. // Compares
  4031. let TargetPrefix = "x86" in {
  4032. // 512-bit
  4033. def int_x86_avx512_vcomi_sd : ClangBuiltin<"__builtin_ia32_vcomisd">,
  4034. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
  4035. llvm_v2f64_ty, llvm_i32_ty, llvm_i32_ty],
  4036. [IntrNoMem, ImmArg<ArgIndex<2>>,
  4037. ImmArg<ArgIndex<3>>]>;
  4038. def int_x86_avx512_vcomi_ss : ClangBuiltin<"__builtin_ia32_vcomiss">,
  4039. DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
  4040. llvm_v4f32_ty, llvm_i32_ty, llvm_i32_ty],
  4041. [IntrNoMem, ImmArg<ArgIndex<2>>,
  4042. ImmArg<ArgIndex<3>>]>;
  4043. }
  4044. // Compress, Expand
  4045. let TargetPrefix = "x86" in {
  4046. def int_x86_avx512_mask_compress :
  4047. DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  4048. [LLVMMatchType<0>, LLVMMatchType<0>,
  4049. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
  4050. [IntrNoMem]>;
  4051. def int_x86_avx512_mask_expand :
  4052. DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  4053. [LLVMMatchType<0>, LLVMMatchType<0>,
  4054. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
  4055. [IntrNoMem]>;
  4056. }
  4057. // truncate
  4058. let TargetPrefix = "x86" in {
  4059. def int_x86_avx512_mask_pmov_qb_128 :
  4060. ClangBuiltin<"__builtin_ia32_pmovqb128_mask">,
  4061. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4062. [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
  4063. [IntrNoMem]>;
  4064. def int_x86_avx512_mask_pmov_qb_mem_128 :
  4065. ClangBuiltin<"__builtin_ia32_pmovqb128mem_mask">,
  4066. DefaultAttrsIntrinsic<[],
  4067. [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
  4068. [IntrArgMemOnly]>;
  4069. def int_x86_avx512_mask_pmovs_qb_128 :
  4070. ClangBuiltin<"__builtin_ia32_pmovsqb128_mask">,
  4071. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4072. [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
  4073. [IntrNoMem]>;
  4074. def int_x86_avx512_mask_pmovs_qb_mem_128 :
  4075. ClangBuiltin<"__builtin_ia32_pmovsqb128mem_mask">,
  4076. DefaultAttrsIntrinsic<[],
  4077. [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
  4078. [IntrArgMemOnly]>;
  4079. def int_x86_avx512_mask_pmovus_qb_128 :
  4080. ClangBuiltin<"__builtin_ia32_pmovusqb128_mask">,
  4081. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4082. [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
  4083. [IntrNoMem]>;
  4084. def int_x86_avx512_mask_pmovus_qb_mem_128 :
  4085. ClangBuiltin<"__builtin_ia32_pmovusqb128mem_mask">,
  4086. DefaultAttrsIntrinsic<[],
  4087. [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
  4088. [IntrArgMemOnly]>;
  4089. def int_x86_avx512_mask_pmov_qb_256 :
  4090. ClangBuiltin<"__builtin_ia32_pmovqb256_mask">,
  4091. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4092. [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
  4093. [IntrNoMem]>;
  4094. def int_x86_avx512_mask_pmov_qb_mem_256 :
  4095. ClangBuiltin<"__builtin_ia32_pmovqb256mem_mask">,
  4096. DefaultAttrsIntrinsic<[],
  4097. [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
  4098. [IntrArgMemOnly]>;
  4099. def int_x86_avx512_mask_pmovs_qb_256 :
  4100. ClangBuiltin<"__builtin_ia32_pmovsqb256_mask">,
  4101. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4102. [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
  4103. [IntrNoMem]>;
  4104. def int_x86_avx512_mask_pmovs_qb_mem_256 :
  4105. ClangBuiltin<"__builtin_ia32_pmovsqb256mem_mask">,
  4106. DefaultAttrsIntrinsic<[],
  4107. [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
  4108. [IntrArgMemOnly]>;
  4109. def int_x86_avx512_mask_pmovus_qb_256 :
  4110. ClangBuiltin<"__builtin_ia32_pmovusqb256_mask">,
  4111. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4112. [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
  4113. [IntrNoMem]>;
  4114. def int_x86_avx512_mask_pmovus_qb_mem_256 :
  4115. ClangBuiltin<"__builtin_ia32_pmovusqb256mem_mask">,
  4116. DefaultAttrsIntrinsic<[],
  4117. [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
  4118. [IntrArgMemOnly]>;
  4119. def int_x86_avx512_mask_pmov_qb_512 :
  4120. ClangBuiltin<"__builtin_ia32_pmovqb512_mask">,
  4121. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4122. [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
  4123. [IntrNoMem]>;
  4124. def int_x86_avx512_mask_pmov_qb_mem_512 :
  4125. ClangBuiltin<"__builtin_ia32_pmovqb512mem_mask">,
  4126. DefaultAttrsIntrinsic<[],
  4127. [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
  4128. [IntrArgMemOnly]>;
  4129. def int_x86_avx512_mask_pmovs_qb_512 :
  4130. ClangBuiltin<"__builtin_ia32_pmovsqb512_mask">,
  4131. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4132. [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
  4133. [IntrNoMem]>;
  4134. def int_x86_avx512_mask_pmovs_qb_mem_512 :
  4135. ClangBuiltin<"__builtin_ia32_pmovsqb512mem_mask">,
  4136. DefaultAttrsIntrinsic<[],
  4137. [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
  4138. [IntrArgMemOnly]>;
  4139. def int_x86_avx512_mask_pmovus_qb_512 :
  4140. ClangBuiltin<"__builtin_ia32_pmovusqb512_mask">,
  4141. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4142. [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
  4143. [IntrNoMem]>;
  4144. def int_x86_avx512_mask_pmovus_qb_mem_512 :
  4145. ClangBuiltin<"__builtin_ia32_pmovusqb512mem_mask">,
  4146. DefaultAttrsIntrinsic<[],
  4147. [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
  4148. [IntrArgMemOnly]>;
  4149. def int_x86_avx512_mask_pmov_qw_128 :
  4150. ClangBuiltin<"__builtin_ia32_pmovqw128_mask">,
  4151. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4152. [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
  4153. [IntrNoMem]>;
  4154. def int_x86_avx512_mask_pmov_qw_mem_128 :
  4155. ClangBuiltin<"__builtin_ia32_pmovqw128mem_mask">,
  4156. DefaultAttrsIntrinsic<[],
  4157. [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
  4158. [IntrArgMemOnly]>;
  4159. def int_x86_avx512_mask_pmovs_qw_128 :
  4160. ClangBuiltin<"__builtin_ia32_pmovsqw128_mask">,
  4161. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4162. [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
  4163. [IntrNoMem]>;
  4164. def int_x86_avx512_mask_pmovs_qw_mem_128 :
  4165. ClangBuiltin<"__builtin_ia32_pmovsqw128mem_mask">,
  4166. DefaultAttrsIntrinsic<[],
  4167. [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
  4168. [IntrArgMemOnly]>;
  4169. def int_x86_avx512_mask_pmovus_qw_128 :
  4170. ClangBuiltin<"__builtin_ia32_pmovusqw128_mask">,
  4171. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4172. [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
  4173. [IntrNoMem]>;
  4174. def int_x86_avx512_mask_pmovus_qw_mem_128 :
  4175. ClangBuiltin<"__builtin_ia32_pmovusqw128mem_mask">,
  4176. DefaultAttrsIntrinsic<[],
  4177. [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
  4178. [IntrArgMemOnly]>;
  4179. def int_x86_avx512_mask_pmov_qw_256 :
  4180. ClangBuiltin<"__builtin_ia32_pmovqw256_mask">,
  4181. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4182. [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
  4183. [IntrNoMem]>;
  4184. def int_x86_avx512_mask_pmov_qw_mem_256 :
  4185. ClangBuiltin<"__builtin_ia32_pmovqw256mem_mask">,
  4186. DefaultAttrsIntrinsic<[],
  4187. [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
  4188. [IntrArgMemOnly]>;
  4189. def int_x86_avx512_mask_pmovs_qw_256 :
  4190. ClangBuiltin<"__builtin_ia32_pmovsqw256_mask">,
  4191. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4192. [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
  4193. [IntrNoMem]>;
  4194. def int_x86_avx512_mask_pmovs_qw_mem_256 :
  4195. ClangBuiltin<"__builtin_ia32_pmovsqw256mem_mask">,
  4196. DefaultAttrsIntrinsic<[],
  4197. [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
  4198. [IntrArgMemOnly]>;
  4199. def int_x86_avx512_mask_pmovus_qw_256 :
  4200. ClangBuiltin<"__builtin_ia32_pmovusqw256_mask">,
  4201. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4202. [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
  4203. [IntrNoMem]>;
  4204. def int_x86_avx512_mask_pmovus_qw_mem_256 :
  4205. ClangBuiltin<"__builtin_ia32_pmovusqw256mem_mask">,
  4206. DefaultAttrsIntrinsic<[],
  4207. [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
  4208. [IntrArgMemOnly]>;
  4209. def int_x86_avx512_mask_pmov_qw_512 :
  4210. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4211. [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
  4212. [IntrNoMem]>;
  4213. def int_x86_avx512_mask_pmov_qw_mem_512 :
  4214. ClangBuiltin<"__builtin_ia32_pmovqw512mem_mask">,
  4215. DefaultAttrsIntrinsic<[],
  4216. [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
  4217. [IntrArgMemOnly]>;
  4218. def int_x86_avx512_mask_pmovs_qw_512 :
  4219. ClangBuiltin<"__builtin_ia32_pmovsqw512_mask">,
  4220. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4221. [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
  4222. [IntrNoMem]>;
  4223. def int_x86_avx512_mask_pmovs_qw_mem_512 :
  4224. ClangBuiltin<"__builtin_ia32_pmovsqw512mem_mask">,
  4225. DefaultAttrsIntrinsic<[],
  4226. [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
  4227. [IntrArgMemOnly]>;
  4228. def int_x86_avx512_mask_pmovus_qw_512 :
  4229. ClangBuiltin<"__builtin_ia32_pmovusqw512_mask">,
  4230. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4231. [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
  4232. [IntrNoMem]>;
  4233. def int_x86_avx512_mask_pmovus_qw_mem_512 :
  4234. ClangBuiltin<"__builtin_ia32_pmovusqw512mem_mask">,
  4235. DefaultAttrsIntrinsic<[],
  4236. [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
  4237. [IntrArgMemOnly]>;
  4238. def int_x86_avx512_mask_pmov_qd_128 :
  4239. ClangBuiltin<"__builtin_ia32_pmovqd128_mask">,
  4240. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  4241. [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
  4242. [IntrNoMem]>;
  4243. def int_x86_avx512_mask_pmov_qd_mem_128 :
  4244. ClangBuiltin<"__builtin_ia32_pmovqd128mem_mask">,
  4245. DefaultAttrsIntrinsic<[],
  4246. [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
  4247. [IntrArgMemOnly]>;
  4248. def int_x86_avx512_mask_pmovs_qd_128 :
  4249. ClangBuiltin<"__builtin_ia32_pmovsqd128_mask">,
  4250. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  4251. [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
  4252. [IntrNoMem]>;
  4253. def int_x86_avx512_mask_pmovs_qd_mem_128 :
  4254. ClangBuiltin<"__builtin_ia32_pmovsqd128mem_mask">,
  4255. DefaultAttrsIntrinsic<[],
  4256. [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
  4257. [IntrArgMemOnly]>;
  4258. def int_x86_avx512_mask_pmovus_qd_128 :
  4259. ClangBuiltin<"__builtin_ia32_pmovusqd128_mask">,
  4260. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  4261. [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
  4262. [IntrNoMem]>;
  4263. def int_x86_avx512_mask_pmovus_qd_mem_128 :
  4264. ClangBuiltin<"__builtin_ia32_pmovusqd128mem_mask">,
  4265. DefaultAttrsIntrinsic<[],
  4266. [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
  4267. [IntrArgMemOnly]>;
  4268. def int_x86_avx512_mask_pmov_qd_mem_256 :
  4269. ClangBuiltin<"__builtin_ia32_pmovqd256mem_mask">,
  4270. DefaultAttrsIntrinsic<[],
  4271. [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
  4272. [IntrArgMemOnly]>;
  4273. def int_x86_avx512_mask_pmovs_qd_256 :
  4274. ClangBuiltin<"__builtin_ia32_pmovsqd256_mask">,
  4275. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  4276. [llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
  4277. [IntrNoMem]>;
  4278. def int_x86_avx512_mask_pmovs_qd_mem_256 :
  4279. ClangBuiltin<"__builtin_ia32_pmovsqd256mem_mask">,
  4280. DefaultAttrsIntrinsic<[],
  4281. [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
  4282. [IntrArgMemOnly]>;
  4283. def int_x86_avx512_mask_pmovus_qd_256 :
  4284. ClangBuiltin<"__builtin_ia32_pmovusqd256_mask">,
  4285. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  4286. [llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
  4287. [IntrNoMem]>;
  4288. def int_x86_avx512_mask_pmovus_qd_mem_256 :
  4289. ClangBuiltin<"__builtin_ia32_pmovusqd256mem_mask">,
  4290. DefaultAttrsIntrinsic<[],
  4291. [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
  4292. [IntrArgMemOnly]>;
  4293. def int_x86_avx512_mask_pmov_qd_mem_512 :
  4294. ClangBuiltin<"__builtin_ia32_pmovqd512mem_mask">,
  4295. DefaultAttrsIntrinsic<[],
  4296. [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
  4297. [IntrArgMemOnly]>;
  4298. def int_x86_avx512_mask_pmovs_qd_512 :
  4299. ClangBuiltin<"__builtin_ia32_pmovsqd512_mask">,
  4300. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  4301. [llvm_v8i64_ty, llvm_v8i32_ty, llvm_i8_ty],
  4302. [IntrNoMem]>;
  4303. def int_x86_avx512_mask_pmovs_qd_mem_512 :
  4304. ClangBuiltin<"__builtin_ia32_pmovsqd512mem_mask">,
  4305. DefaultAttrsIntrinsic<[],
  4306. [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
  4307. [IntrArgMemOnly]>;
  4308. def int_x86_avx512_mask_pmovus_qd_512 :
  4309. ClangBuiltin<"__builtin_ia32_pmovusqd512_mask">,
  4310. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  4311. [llvm_v8i64_ty, llvm_v8i32_ty, llvm_i8_ty],
  4312. [IntrNoMem]>;
  4313. def int_x86_avx512_mask_pmovus_qd_mem_512 :
  4314. ClangBuiltin<"__builtin_ia32_pmovusqd512mem_mask">,
  4315. DefaultAttrsIntrinsic<[],
  4316. [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
  4317. [IntrArgMemOnly]>;
  4318. def int_x86_avx512_mask_pmov_db_128 :
  4319. ClangBuiltin<"__builtin_ia32_pmovdb128_mask">,
  4320. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4321. [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
  4322. [IntrNoMem]>;
  4323. def int_x86_avx512_mask_pmov_db_mem_128 :
  4324. ClangBuiltin<"__builtin_ia32_pmovdb128mem_mask">,
  4325. DefaultAttrsIntrinsic<[],
  4326. [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
  4327. [IntrArgMemOnly]>;
  4328. def int_x86_avx512_mask_pmovs_db_128 :
  4329. ClangBuiltin<"__builtin_ia32_pmovsdb128_mask">,
  4330. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4331. [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
  4332. [IntrNoMem]>;
  4333. def int_x86_avx512_mask_pmovs_db_mem_128 :
  4334. ClangBuiltin<"__builtin_ia32_pmovsdb128mem_mask">,
  4335. DefaultAttrsIntrinsic<[],
  4336. [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
  4337. [IntrArgMemOnly]>;
  4338. def int_x86_avx512_mask_pmovus_db_128 :
  4339. ClangBuiltin<"__builtin_ia32_pmovusdb128_mask">,
  4340. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4341. [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
  4342. [IntrNoMem]>;
  4343. def int_x86_avx512_mask_pmovus_db_mem_128 :
  4344. ClangBuiltin<"__builtin_ia32_pmovusdb128mem_mask">,
  4345. DefaultAttrsIntrinsic<[],
  4346. [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
  4347. [IntrArgMemOnly]>;
  4348. def int_x86_avx512_mask_pmov_db_256 :
  4349. ClangBuiltin<"__builtin_ia32_pmovdb256_mask">,
  4350. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4351. [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
  4352. [IntrNoMem]>;
  4353. def int_x86_avx512_mask_pmov_db_mem_256 :
  4354. ClangBuiltin<"__builtin_ia32_pmovdb256mem_mask">,
  4355. DefaultAttrsIntrinsic<[],
  4356. [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
  4357. [IntrArgMemOnly]>;
  4358. def int_x86_avx512_mask_pmovs_db_256 :
  4359. ClangBuiltin<"__builtin_ia32_pmovsdb256_mask">,
  4360. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4361. [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
  4362. [IntrNoMem]>;
  4363. def int_x86_avx512_mask_pmovs_db_mem_256 :
  4364. ClangBuiltin<"__builtin_ia32_pmovsdb256mem_mask">,
  4365. DefaultAttrsIntrinsic<[],
  4366. [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
  4367. [IntrArgMemOnly]>;
  4368. def int_x86_avx512_mask_pmovus_db_256 :
  4369. ClangBuiltin<"__builtin_ia32_pmovusdb256_mask">,
  4370. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4371. [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
  4372. [IntrNoMem]>;
  4373. def int_x86_avx512_mask_pmovus_db_mem_256 :
  4374. ClangBuiltin<"__builtin_ia32_pmovusdb256mem_mask">,
  4375. DefaultAttrsIntrinsic<[],
  4376. [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
  4377. [IntrArgMemOnly]>;
  4378. def int_x86_avx512_mask_pmov_db_512 :
  4379. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4380. [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
  4381. [IntrNoMem]>;
  4382. def int_x86_avx512_mask_pmov_db_mem_512 :
  4383. ClangBuiltin<"__builtin_ia32_pmovdb512mem_mask">,
  4384. DefaultAttrsIntrinsic<[],
  4385. [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
  4386. [IntrArgMemOnly]>;
  4387. def int_x86_avx512_mask_pmovs_db_512 :
  4388. ClangBuiltin<"__builtin_ia32_pmovsdb512_mask">,
  4389. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4390. [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
  4391. [IntrNoMem]>;
  4392. def int_x86_avx512_mask_pmovs_db_mem_512 :
  4393. ClangBuiltin<"__builtin_ia32_pmovsdb512mem_mask">,
  4394. DefaultAttrsIntrinsic<[],
  4395. [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
  4396. [IntrArgMemOnly]>;
  4397. def int_x86_avx512_mask_pmovus_db_512 :
  4398. ClangBuiltin<"__builtin_ia32_pmovusdb512_mask">,
  4399. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4400. [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
  4401. [IntrNoMem]>;
  4402. def int_x86_avx512_mask_pmovus_db_mem_512 :
  4403. ClangBuiltin<"__builtin_ia32_pmovusdb512mem_mask">,
  4404. DefaultAttrsIntrinsic<[],
  4405. [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
  4406. [IntrArgMemOnly]>;
  4407. def int_x86_avx512_mask_pmov_dw_128 :
  4408. ClangBuiltin<"__builtin_ia32_pmovdw128_mask">,
  4409. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4410. [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
  4411. [IntrNoMem]>;
  4412. def int_x86_avx512_mask_pmov_dw_mem_128 :
  4413. ClangBuiltin<"__builtin_ia32_pmovdw128mem_mask">,
  4414. DefaultAttrsIntrinsic<[],
  4415. [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
  4416. [IntrArgMemOnly]>;
  4417. def int_x86_avx512_mask_pmovs_dw_128 :
  4418. ClangBuiltin<"__builtin_ia32_pmovsdw128_mask">,
  4419. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4420. [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
  4421. [IntrNoMem]>;
  4422. def int_x86_avx512_mask_pmovs_dw_mem_128 :
  4423. ClangBuiltin<"__builtin_ia32_pmovsdw128mem_mask">,
  4424. DefaultAttrsIntrinsic<[],
  4425. [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
  4426. [IntrArgMemOnly]>;
  4427. def int_x86_avx512_mask_pmovus_dw_128 :
  4428. ClangBuiltin<"__builtin_ia32_pmovusdw128_mask">,
  4429. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4430. [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
  4431. [IntrNoMem]>;
  4432. def int_x86_avx512_mask_pmovus_dw_mem_128 :
  4433. ClangBuiltin<"__builtin_ia32_pmovusdw128mem_mask">,
  4434. DefaultAttrsIntrinsic<[],
  4435. [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
  4436. [IntrArgMemOnly]>;
  4437. def int_x86_avx512_mask_pmov_dw_256 :
  4438. ClangBuiltin<"__builtin_ia32_pmovdw256_mask">,
  4439. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4440. [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
  4441. [IntrNoMem]>;
  4442. def int_x86_avx512_mask_pmov_dw_mem_256 :
  4443. ClangBuiltin<"__builtin_ia32_pmovdw256mem_mask">,
  4444. DefaultAttrsIntrinsic<[],
  4445. [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
  4446. [IntrArgMemOnly]>;
  4447. def int_x86_avx512_mask_pmovs_dw_256 :
  4448. ClangBuiltin<"__builtin_ia32_pmovsdw256_mask">,
  4449. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4450. [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
  4451. [IntrNoMem]>;
  4452. def int_x86_avx512_mask_pmovs_dw_mem_256 :
  4453. ClangBuiltin<"__builtin_ia32_pmovsdw256mem_mask">,
  4454. DefaultAttrsIntrinsic<[],
  4455. [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
  4456. [IntrArgMemOnly]>;
  4457. def int_x86_avx512_mask_pmovus_dw_256 :
  4458. ClangBuiltin<"__builtin_ia32_pmovusdw256_mask">,
  4459. DefaultAttrsIntrinsic<[llvm_v8i16_ty],
  4460. [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
  4461. [IntrNoMem]>;
  4462. def int_x86_avx512_mask_pmovus_dw_mem_256 :
  4463. ClangBuiltin<"__builtin_ia32_pmovusdw256mem_mask">,
  4464. DefaultAttrsIntrinsic<[],
  4465. [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
  4466. [IntrArgMemOnly]>;
  4467. def int_x86_avx512_mask_pmov_dw_512 :
  4468. DefaultAttrsIntrinsic<[llvm_v16i16_ty],
  4469. [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
  4470. [IntrNoMem]>;
  4471. def int_x86_avx512_mask_pmov_dw_mem_512 :
  4472. ClangBuiltin<"__builtin_ia32_pmovdw512mem_mask">,
  4473. DefaultAttrsIntrinsic<[],
  4474. [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
  4475. [IntrArgMemOnly]>;
  4476. def int_x86_avx512_mask_pmovs_dw_512 :
  4477. ClangBuiltin<"__builtin_ia32_pmovsdw512_mask">,
  4478. DefaultAttrsIntrinsic<[llvm_v16i16_ty],
  4479. [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
  4480. [IntrNoMem]>;
  4481. def int_x86_avx512_mask_pmovs_dw_mem_512 :
  4482. ClangBuiltin<"__builtin_ia32_pmovsdw512mem_mask">,
  4483. DefaultAttrsIntrinsic<[],
  4484. [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
  4485. [IntrArgMemOnly]>;
  4486. def int_x86_avx512_mask_pmovus_dw_512 :
  4487. ClangBuiltin<"__builtin_ia32_pmovusdw512_mask">,
  4488. DefaultAttrsIntrinsic<[llvm_v16i16_ty],
  4489. [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
  4490. [IntrNoMem]>;
  4491. def int_x86_avx512_mask_pmovus_dw_mem_512 :
  4492. ClangBuiltin<"__builtin_ia32_pmovusdw512mem_mask">,
  4493. DefaultAttrsIntrinsic<[],
  4494. [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
  4495. [IntrArgMemOnly]>;
  4496. def int_x86_avx512_mask_pmov_wb_128 :
  4497. ClangBuiltin<"__builtin_ia32_pmovwb128_mask">,
  4498. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4499. [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
  4500. [IntrNoMem]>;
  4501. def int_x86_avx512_mask_pmov_wb_mem_128 :
  4502. ClangBuiltin<"__builtin_ia32_pmovwb128mem_mask">,
  4503. DefaultAttrsIntrinsic<[],
  4504. [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
  4505. [IntrArgMemOnly]>;
  4506. def int_x86_avx512_mask_pmovs_wb_128 :
  4507. ClangBuiltin<"__builtin_ia32_pmovswb128_mask">,
  4508. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4509. [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
  4510. [IntrNoMem]>;
  4511. def int_x86_avx512_mask_pmovs_wb_mem_128 :
  4512. ClangBuiltin<"__builtin_ia32_pmovswb128mem_mask">,
  4513. DefaultAttrsIntrinsic<[],
  4514. [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
  4515. [IntrArgMemOnly]>;
  4516. def int_x86_avx512_mask_pmovus_wb_128 :
  4517. ClangBuiltin<"__builtin_ia32_pmovuswb128_mask">,
  4518. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4519. [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
  4520. [IntrNoMem]>;
  4521. def int_x86_avx512_mask_pmovus_wb_mem_128 :
  4522. ClangBuiltin<"__builtin_ia32_pmovuswb128mem_mask">,
  4523. DefaultAttrsIntrinsic<[],
  4524. [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
  4525. [IntrArgMemOnly]>;
  4526. def int_x86_avx512_mask_pmov_wb_mem_256 :
  4527. ClangBuiltin<"__builtin_ia32_pmovwb256mem_mask">,
  4528. DefaultAttrsIntrinsic<[],
  4529. [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
  4530. [IntrArgMemOnly]>;
  4531. def int_x86_avx512_mask_pmovs_wb_256 :
  4532. ClangBuiltin<"__builtin_ia32_pmovswb256_mask">,
  4533. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4534. [llvm_v16i16_ty, llvm_v16i8_ty, llvm_i16_ty],
  4535. [IntrNoMem]>;
  4536. def int_x86_avx512_mask_pmovs_wb_mem_256 :
  4537. ClangBuiltin<"__builtin_ia32_pmovswb256mem_mask">,
  4538. DefaultAttrsIntrinsic<[],
  4539. [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
  4540. [IntrArgMemOnly]>;
  4541. def int_x86_avx512_mask_pmovus_wb_256 :
  4542. ClangBuiltin<"__builtin_ia32_pmovuswb256_mask">,
  4543. DefaultAttrsIntrinsic<[llvm_v16i8_ty],
  4544. [llvm_v16i16_ty, llvm_v16i8_ty, llvm_i16_ty],
  4545. [IntrNoMem]>;
  4546. def int_x86_avx512_mask_pmovus_wb_mem_256 :
  4547. ClangBuiltin<"__builtin_ia32_pmovuswb256mem_mask">,
  4548. DefaultAttrsIntrinsic<[],
  4549. [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
  4550. [IntrArgMemOnly]>;
  4551. def int_x86_avx512_mask_pmov_wb_mem_512 :
  4552. ClangBuiltin<"__builtin_ia32_pmovwb512mem_mask">,
  4553. DefaultAttrsIntrinsic<[],
  4554. [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
  4555. [IntrArgMemOnly]>;
  4556. def int_x86_avx512_mask_pmovs_wb_512 :
  4557. ClangBuiltin<"__builtin_ia32_pmovswb512_mask">,
  4558. DefaultAttrsIntrinsic<[llvm_v32i8_ty],
  4559. [llvm_v32i16_ty, llvm_v32i8_ty, llvm_i32_ty],
  4560. [IntrNoMem]>;
  4561. def int_x86_avx512_mask_pmovs_wb_mem_512 :
  4562. ClangBuiltin<"__builtin_ia32_pmovswb512mem_mask">,
  4563. DefaultAttrsIntrinsic<[],
  4564. [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
  4565. [IntrArgMemOnly]>;
  4566. def int_x86_avx512_mask_pmovus_wb_512 :
  4567. ClangBuiltin<"__builtin_ia32_pmovuswb512_mask">,
  4568. DefaultAttrsIntrinsic<[llvm_v32i8_ty],
  4569. [llvm_v32i16_ty, llvm_v32i8_ty, llvm_i32_ty],
  4570. [IntrNoMem]>;
  4571. def int_x86_avx512_mask_pmovus_wb_mem_512 :
  4572. ClangBuiltin<"__builtin_ia32_pmovuswb512mem_mask">,
  4573. DefaultAttrsIntrinsic<[],
  4574. [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
  4575. [IntrArgMemOnly]>;
  4576. }
  4577. // Bitwise ternary logic
  4578. let TargetPrefix = "x86" in {
  4579. def int_x86_avx512_pternlog_d_128 :
  4580. ClangBuiltin<"__builtin_ia32_pternlogd128">,
  4581. DefaultAttrsIntrinsic<[llvm_v4i32_ty],
  4582. [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty,
  4583. llvm_i32_ty],
  4584. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  4585. def int_x86_avx512_pternlog_d_256 :
  4586. ClangBuiltin<"__builtin_ia32_pternlogd256">,
  4587. DefaultAttrsIntrinsic<[llvm_v8i32_ty],
  4588. [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty,
  4589. llvm_i32_ty],
  4590. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  4591. def int_x86_avx512_pternlog_d_512 :
  4592. ClangBuiltin<"__builtin_ia32_pternlogd512">,
  4593. DefaultAttrsIntrinsic<[llvm_v16i32_ty],
  4594. [llvm_v16i32_ty, llvm_v16i32_ty, llvm_v16i32_ty,
  4595. llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  4596. def int_x86_avx512_pternlog_q_128 :
  4597. ClangBuiltin<"__builtin_ia32_pternlogq128">,
  4598. DefaultAttrsIntrinsic<[llvm_v2i64_ty],
  4599. [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4600. llvm_i32_ty],
  4601. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  4602. def int_x86_avx512_pternlog_q_256 :
  4603. ClangBuiltin<"__builtin_ia32_pternlogq256">,
  4604. DefaultAttrsIntrinsic<[llvm_v4i64_ty],
  4605. [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty,
  4606. llvm_i32_ty],
  4607. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  4608. def int_x86_avx512_pternlog_q_512 :
  4609. ClangBuiltin<"__builtin_ia32_pternlogq512">,
  4610. DefaultAttrsIntrinsic<[llvm_v8i64_ty],
  4611. [llvm_v8i64_ty, llvm_v8i64_ty, llvm_v8i64_ty,
  4612. llvm_i32_ty],
  4613. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  4614. }
  4615. // vp2intersect
  4616. let TargetPrefix = "x86" in {
  4617. def int_x86_avx512_vp2intersect_q_512 :
  4618. DefaultAttrsIntrinsic<[llvm_v8i1_ty, llvm_v8i1_ty],
  4619. [llvm_v8i64_ty, llvm_v8i64_ty],
  4620. [IntrNoMem]>;
  4621. def int_x86_avx512_vp2intersect_q_256 :
  4622. DefaultAttrsIntrinsic<[llvm_v4i1_ty, llvm_v4i1_ty],
  4623. [llvm_v4i64_ty, llvm_v4i64_ty],
  4624. [IntrNoMem]>;
  4625. def int_x86_avx512_vp2intersect_q_128 :
  4626. DefaultAttrsIntrinsic<[llvm_v2i1_ty, llvm_v2i1_ty],
  4627. [llvm_v2i64_ty, llvm_v2i64_ty],
  4628. [IntrNoMem]>;
  4629. def int_x86_avx512_vp2intersect_d_512 :
  4630. DefaultAttrsIntrinsic<[llvm_v16i1_ty, llvm_v16i1_ty],
  4631. [llvm_v16i32_ty, llvm_v16i32_ty],
  4632. [IntrNoMem]>;
  4633. def int_x86_avx512_vp2intersect_d_256 :
  4634. DefaultAttrsIntrinsic<[llvm_v8i1_ty, llvm_v8i1_ty],
  4635. [llvm_v8i32_ty, llvm_v8i32_ty],
  4636. [IntrNoMem]>;
  4637. def int_x86_avx512_vp2intersect_d_128 :
  4638. DefaultAttrsIntrinsic<[llvm_v4i1_ty, llvm_v4i1_ty],
  4639. [llvm_v4i32_ty, llvm_v4i32_ty],
  4640. [IntrNoMem]>;
  4641. }
  4642. // Misc.
  4643. let TargetPrefix = "x86" in {
  4644. // NOTE: These comparison intrinsics are not used by clang as long as the
  4645. // distinction in signaling behaviour is not implemented.
  4646. def int_x86_avx512_mask_cmp_ps_512 :
  4647. DefaultAttrsIntrinsic<[llvm_v16i1_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
  4648. llvm_i32_ty, llvm_v16i1_ty, llvm_i32_ty],
  4649. [IntrNoMem, ImmArg<ArgIndex<2>>,
  4650. ImmArg<ArgIndex<4>>]>;
  4651. def int_x86_avx512_mask_cmp_pd_512 :
  4652. DefaultAttrsIntrinsic<[llvm_v8i1_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
  4653. llvm_i32_ty, llvm_v8i1_ty, llvm_i32_ty],
  4654. [IntrNoMem, ImmArg<ArgIndex<2>>,
  4655. ImmArg<ArgIndex<4>>]>;
  4656. def int_x86_avx512_mask_cmp_ps_256 :
  4657. DefaultAttrsIntrinsic<[llvm_v8i1_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
  4658. llvm_i32_ty, llvm_v8i1_ty],
  4659. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  4660. def int_x86_avx512_mask_cmp_pd_256 :
  4661. DefaultAttrsIntrinsic<[llvm_v4i1_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
  4662. llvm_i32_ty, llvm_v4i1_ty],
  4663. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  4664. def int_x86_avx512_mask_cmp_ps_128 :
  4665. DefaultAttrsIntrinsic<[llvm_v4i1_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
  4666. llvm_i32_ty, llvm_v4i1_ty],
  4667. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  4668. def int_x86_avx512_mask_cmp_pd_128 :
  4669. DefaultAttrsIntrinsic<[llvm_v2i1_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
  4670. llvm_i32_ty, llvm_v2i1_ty],
  4671. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  4672. def int_x86_avx512_mask_cmp_ss :
  4673. ClangBuiltin<"__builtin_ia32_cmpss_mask">,
  4674. DefaultAttrsIntrinsic<[llvm_i8_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
  4675. llvm_i32_ty, llvm_i8_ty, llvm_i32_ty],
  4676. [IntrNoMem, ImmArg<ArgIndex<2>>,
  4677. ImmArg<ArgIndex<4>>]>;
  4678. def int_x86_avx512_mask_cmp_sd :
  4679. ClangBuiltin<"__builtin_ia32_cmpsd_mask">,
  4680. DefaultAttrsIntrinsic<[llvm_i8_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
  4681. llvm_i32_ty, llvm_i8_ty, llvm_i32_ty],
  4682. [IntrNoMem, ImmArg<ArgIndex<2>>,
  4683. ImmArg<ArgIndex<4>>]>;
  4684. }
  4685. //===----------------------------------------------------------------------===//
  4686. // SHA intrinsics
  4687. let TargetPrefix = "x86" in {
  4688. def int_x86_sha1rnds4 : ClangBuiltin<"__builtin_ia32_sha1rnds4">,
  4689. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
  4690. llvm_i8_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  4691. def int_x86_sha1nexte : ClangBuiltin<"__builtin_ia32_sha1nexte">,
  4692. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  4693. [IntrNoMem]>;
  4694. def int_x86_sha1msg1 : ClangBuiltin<"__builtin_ia32_sha1msg1">,
  4695. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  4696. [IntrNoMem]>;
  4697. def int_x86_sha1msg2 : ClangBuiltin<"__builtin_ia32_sha1msg2">,
  4698. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  4699. [IntrNoMem]>;
  4700. def int_x86_sha256rnds2 : ClangBuiltin<"__builtin_ia32_sha256rnds2">,
  4701. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
  4702. llvm_v4i32_ty], [IntrNoMem]>;
  4703. def int_x86_sha256msg1 : ClangBuiltin<"__builtin_ia32_sha256msg1">,
  4704. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  4705. [IntrNoMem]>;
  4706. def int_x86_sha256msg2 : ClangBuiltin<"__builtin_ia32_sha256msg2">,
  4707. DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
  4708. [IntrNoMem]>;
  4709. }
  4710. //===----------------------------------------------------------------------===//
  4711. // Thread synchronization ops with timer.
  4712. let TargetPrefix = "x86" in {
  4713. def int_x86_monitorx
  4714. : ClangBuiltin<"__builtin_ia32_monitorx">,
  4715. Intrinsic<[], [ llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty ], []>;
  4716. def int_x86_mwaitx
  4717. : ClangBuiltin<"__builtin_ia32_mwaitx">,
  4718. Intrinsic<[], [ llvm_i32_ty, llvm_i32_ty, llvm_i32_ty ], []>;
  4719. }
  4720. //===----------------------------------------------------------------------===//
  4721. // Cache-line zero
  4722. let TargetPrefix = "x86" in {
  4723. def int_x86_clzero : ClangBuiltin<"__builtin_ia32_clzero">,
  4724. Intrinsic<[], [llvm_ptr_ty], []>;
  4725. }
  4726. //===----------------------------------------------------------------------===//
  4727. // Cache write back intrinsics
  4728. let TargetPrefix = "x86" in {
  4729. // Write back and invalidate
  4730. def int_x86_wbinvd : ClangBuiltin<"__builtin_ia32_wbinvd">,
  4731. Intrinsic<[], [], []>;
  4732. // Write back no-invalidate
  4733. def int_x86_wbnoinvd : ClangBuiltin<"__builtin_ia32_wbnoinvd">,
  4734. Intrinsic<[], [], []>;
  4735. }
  4736. //===----------------------------------------------------------------------===//
  4737. // Cache-line demote
  4738. let TargetPrefix = "x86" in {
  4739. def int_x86_cldemote : ClangBuiltin<"__builtin_ia32_cldemote">,
  4740. Intrinsic<[], [llvm_ptr_ty], []>;
  4741. }
  4742. //===----------------------------------------------------------------------===//
  4743. // Wait and pause enhancements
  4744. let TargetPrefix = "x86" in {
  4745. def int_x86_umonitor : ClangBuiltin<"__builtin_ia32_umonitor">,
  4746. Intrinsic<[], [llvm_ptr_ty], []>;
  4747. def int_x86_umwait : ClangBuiltin<"__builtin_ia32_umwait">,
  4748. Intrinsic<[llvm_i8_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
  4749. def int_x86_tpause : ClangBuiltin<"__builtin_ia32_tpause">,
  4750. Intrinsic<[llvm_i8_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
  4751. }
  4752. //===----------------------------------------------------------------------===//
  4753. // Direct Move Instructions
  4754. let TargetPrefix = "x86" in {
  4755. def int_x86_directstore32 : ClangBuiltin<"__builtin_ia32_directstore_u32">,
  4756. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], []>;
  4757. def int_x86_directstore64 : ClangBuiltin<"__builtin_ia32_directstore_u64">,
  4758. Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], []>;
  4759. def int_x86_movdir64b : ClangBuiltin<"__builtin_ia32_movdir64b">,
  4760. Intrinsic<[], [llvm_ptr_ty, llvm_ptr_ty], []>;
  4761. }
  4762. //===----------------------------------------------------------------------===//
  4763. // PTWrite - Write data to processor trace pocket
  4764. let TargetPrefix = "x86" in {
  4765. def int_x86_ptwrite32 : ClangBuiltin<"__builtin_ia32_ptwrite32">,
  4766. Intrinsic<[], [llvm_i32_ty], []>;
  4767. def int_x86_ptwrite64 : ClangBuiltin<"__builtin_ia32_ptwrite64">,
  4768. Intrinsic<[], [llvm_i64_ty], []>;
  4769. }
  4770. //===----------------------------------------------------------------------===//
  4771. // INVPCID - Invalidate Process-Context Identifier
  4772. let TargetPrefix = "x86" in {
  4773. def int_x86_invpcid : ClangBuiltin<"__builtin_ia32_invpcid">,
  4774. Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>;
  4775. }
  4776. let TargetPrefix = "x86" in {
  4777. def int_x86_avx512bf16_cvtne2ps2bf16_128:
  4778. ClangBuiltin<"__builtin_ia32_cvtne2ps2bf16_128">,
  4779. DefaultAttrsIntrinsic<[llvm_v8bf16_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
  4780. [IntrNoMem]>;
  4781. def int_x86_avx512bf16_cvtne2ps2bf16_256:
  4782. ClangBuiltin<"__builtin_ia32_cvtne2ps2bf16_256">,
  4783. DefaultAttrsIntrinsic<[llvm_v16bf16_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
  4784. [IntrNoMem]>;
  4785. def int_x86_avx512bf16_cvtne2ps2bf16_512:
  4786. ClangBuiltin<"__builtin_ia32_cvtne2ps2bf16_512">,
  4787. DefaultAttrsIntrinsic<[llvm_v32bf16_ty], [llvm_v16f32_ty, llvm_v16f32_ty],
  4788. [IntrNoMem]>;
  4789. // Intrinsic must be masked due to it producing less than 128 bits of results.
  4790. def int_x86_avx512bf16_mask_cvtneps2bf16_128:
  4791. DefaultAttrsIntrinsic<[llvm_v8bf16_ty],
  4792. [llvm_v4f32_ty, llvm_v8bf16_ty, llvm_v4i1_ty],
  4793. [IntrNoMem]>;
  4794. def int_x86_avx512bf16_cvtneps2bf16_256:
  4795. ClangBuiltin<"__builtin_ia32_cvtneps2bf16_256">,
  4796. DefaultAttrsIntrinsic<[llvm_v8bf16_ty], [llvm_v8f32_ty], [IntrNoMem]>;
  4797. def int_x86_avx512bf16_cvtneps2bf16_512:
  4798. ClangBuiltin<"__builtin_ia32_cvtneps2bf16_512">,
  4799. DefaultAttrsIntrinsic<[llvm_v16bf16_ty], [llvm_v16f32_ty], [IntrNoMem]>;
  4800. def int_x86_avx512bf16_dpbf16ps_128:
  4801. ClangBuiltin<"__builtin_ia32_dpbf16ps_128">,
  4802. DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  4803. [llvm_v4f32_ty, llvm_v8bf16_ty, llvm_v8bf16_ty],
  4804. [IntrNoMem]>;
  4805. def int_x86_avx512bf16_dpbf16ps_256:
  4806. ClangBuiltin<"__builtin_ia32_dpbf16ps_256">,
  4807. DefaultAttrsIntrinsic<[llvm_v8f32_ty],
  4808. [llvm_v8f32_ty, llvm_v16bf16_ty, llvm_v16bf16_ty],
  4809. [IntrNoMem]>;
  4810. def int_x86_avx512bf16_dpbf16ps_512:
  4811. ClangBuiltin<"__builtin_ia32_dpbf16ps_512">,
  4812. DefaultAttrsIntrinsic<[llvm_v16f32_ty],
  4813. [llvm_v16f32_ty, llvm_v32bf16_ty, llvm_v32bf16_ty],
  4814. [IntrNoMem]>;
  4815. }
  4816. //===----------------------------------------------------------------------===//
  4817. // ENQCMD - Enqueue Stores Instructions
  4818. let TargetPrefix = "x86" in {
  4819. def int_x86_enqcmd : ClangBuiltin<"__builtin_ia32_enqcmd">,
  4820. Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_ptr_ty], []>;
  4821. def int_x86_enqcmds : ClangBuiltin<"__builtin_ia32_enqcmds">,
  4822. Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_ptr_ty], []>;
  4823. }
  4824. //===----------------------------------------------------------------------===//
  4825. // SERIALIZE - Serialize instruction fetch and execution
  4826. let TargetPrefix = "x86" in {
  4827. def int_x86_serialize : ClangBuiltin<"__builtin_ia32_serialize">,
  4828. Intrinsic<[], [], []>;
  4829. }
  4830. //===----------------------------------------------------------------------===//
  4831. // TSXLDTRK - TSX Suspend Load Address Tracking
  4832. let TargetPrefix = "x86" in {
  4833. def int_x86_xsusldtrk : ClangBuiltin<"__builtin_ia32_xsusldtrk">,
  4834. Intrinsic<[], [], []>;
  4835. def int_x86_xresldtrk : ClangBuiltin<"__builtin_ia32_xresldtrk">,
  4836. Intrinsic<[], [], []>;
  4837. }
  4838. //===----------------------------------------------------------------------===//
  4839. // Key Locker
  4840. let TargetPrefix = "x86" in {
  4841. def int_x86_loadiwkey : ClangBuiltin<"__builtin_ia32_loadiwkey">,
  4842. Intrinsic<[], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
  4843. []>;
  4844. def int_x86_encodekey128 :
  4845. Intrinsic<[llvm_i32_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4846. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
  4847. [llvm_i32_ty, llvm_v2i64_ty], []>;
  4848. def int_x86_encodekey256 :
  4849. Intrinsic<[llvm_i32_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4850. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
  4851. [llvm_i32_ty, llvm_v2i64_ty, llvm_v2i64_ty], []>;
  4852. def int_x86_aesenc128kl :
  4853. Intrinsic<[llvm_i8_ty, llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty], []>;
  4854. def int_x86_aesdec128kl :
  4855. Intrinsic<[llvm_i8_ty, llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty], []>;
  4856. def int_x86_aesenc256kl :
  4857. Intrinsic<[llvm_i8_ty, llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty], []>;
  4858. def int_x86_aesdec256kl :
  4859. Intrinsic<[llvm_i8_ty, llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty], []>;
  4860. def int_x86_aesencwide128kl :
  4861. Intrinsic<[llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4862. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4863. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
  4864. [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4865. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4866. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], []>;
  4867. def int_x86_aesdecwide128kl :
  4868. Intrinsic<[llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4869. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4870. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
  4871. [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4872. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4873. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], []>;
  4874. def int_x86_aesencwide256kl :
  4875. Intrinsic<[llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4876. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4877. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
  4878. [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4879. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4880. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], []>;
  4881. def int_x86_aesdecwide256kl :
  4882. Intrinsic<[llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4883. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4884. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
  4885. [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4886. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
  4887. llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], []>;
  4888. }
  4889. //===----------------------------------------------------------------------===//
  4890. // AMX - Intel AMX extensions
  4891. let TargetPrefix = "x86" in {
  4892. def int_x86_ldtilecfg : ClangBuiltin<"__builtin_ia32_tile_loadconfig">,
  4893. Intrinsic<[], [llvm_ptr_ty], []>;
  4894. def int_x86_sttilecfg : ClangBuiltin<"__builtin_ia32_tile_storeconfig">,
  4895. Intrinsic<[], [llvm_ptr_ty], []>;
  4896. def int_x86_tilerelease : ClangBuiltin<"__builtin_ia32_tilerelease">,
  4897. Intrinsic<[], [], []>;
  4898. def int_x86_tilezero : ClangBuiltin<"__builtin_ia32_tilezero">,
  4899. Intrinsic<[], [llvm_i8_ty], [ImmArg<ArgIndex<0>>]>;
  4900. def int_x86_tileloadd64 : ClangBuiltin<"__builtin_ia32_tileloadd64">,
  4901. Intrinsic<[], [llvm_i8_ty, llvm_ptr_ty, llvm_i64_ty],
  4902. [ImmArg<ArgIndex<0>>]>;
  4903. def int_x86_tileloaddt164 : ClangBuiltin<"__builtin_ia32_tileloaddt164">,
  4904. Intrinsic<[], [llvm_i8_ty, llvm_ptr_ty, llvm_i64_ty],
  4905. [ImmArg<ArgIndex<0>>]>;
  4906. def int_x86_tilestored64 : ClangBuiltin<"__builtin_ia32_tilestored64">,
  4907. Intrinsic<[], [llvm_i8_ty, llvm_ptr_ty, llvm_i64_ty],
  4908. [ImmArg<ArgIndex<0>>]>;
  4909. def int_x86_tdpbssd : ClangBuiltin<"__builtin_ia32_tdpbssd">,
  4910. Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
  4911. [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
  4912. ImmArg<ArgIndex<2>>]>;
  4913. def int_x86_tdpbsud : ClangBuiltin<"__builtin_ia32_tdpbsud">,
  4914. Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
  4915. [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
  4916. ImmArg<ArgIndex<2>>]>;
  4917. def int_x86_tdpbusd : ClangBuiltin<"__builtin_ia32_tdpbusd">,
  4918. Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
  4919. [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
  4920. ImmArg<ArgIndex<2>>]>;
  4921. def int_x86_tdpbuud : ClangBuiltin<"__builtin_ia32_tdpbuud">,
  4922. Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
  4923. [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
  4924. ImmArg<ArgIndex<2>>]>;
  4925. def int_x86_tdpbf16ps : ClangBuiltin<"__builtin_ia32_tdpbf16ps">,
  4926. Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
  4927. [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
  4928. ImmArg<ArgIndex<2>>]>;
  4929. // AMX-FP16 - Intel FP16 AMX extensions
  4930. def int_x86_tdpfp16ps : ClangBuiltin<"__builtin_ia32_tdpfp16ps">,
  4931. Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
  4932. [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
  4933. ImmArg<ArgIndex<2>>]>;
  4934. // AMX - internal intrinsics
  4935. def int_x86_ldtilecfg_internal :
  4936. ClangBuiltin<"__builtin_ia32_tile_loadconfig_internal">,
  4937. Intrinsic<[], [llvm_ptr_ty], []>;
  4938. def int_x86_tileloadd64_internal :
  4939. ClangBuiltin<"__builtin_ia32_tileloadd64_internal">,
  4940. Intrinsic<[llvm_x86amx_ty],
  4941. [llvm_i16_ty, llvm_i16_ty, llvm_ptr_ty, llvm_i64_ty],
  4942. []>;
  4943. def int_x86_tileloaddt164_internal :
  4944. ClangBuiltin<"__builtin_ia32_tileloaddt164_internal">,
  4945. Intrinsic<[llvm_x86amx_ty],
  4946. [llvm_i16_ty, llvm_i16_ty, llvm_ptr_ty, llvm_i64_ty],
  4947. []>;
  4948. def int_x86_tdpbssd_internal :
  4949. ClangBuiltin<"__builtin_ia32_tdpbssd_internal">,
  4950. Intrinsic<[llvm_x86amx_ty],
  4951. [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
  4952. llvm_x86amx_ty, llvm_x86amx_ty,
  4953. llvm_x86amx_ty], []>;
  4954. def int_x86_tdpbsud_internal :
  4955. ClangBuiltin<"__builtin_ia32_tdpbsud_internal">,
  4956. Intrinsic<[llvm_x86amx_ty],
  4957. [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
  4958. llvm_x86amx_ty, llvm_x86amx_ty,
  4959. llvm_x86amx_ty], []>;
  4960. def int_x86_tdpbusd_internal :
  4961. ClangBuiltin<"__builtin_ia32_tdpbusd_internal">,
  4962. Intrinsic<[llvm_x86amx_ty],
  4963. [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
  4964. llvm_x86amx_ty, llvm_x86amx_ty,
  4965. llvm_x86amx_ty], []>;
  4966. def int_x86_tdpbuud_internal :
  4967. ClangBuiltin<"__builtin_ia32_tdpbuud_internal">,
  4968. Intrinsic<[llvm_x86amx_ty],
  4969. [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
  4970. llvm_x86amx_ty, llvm_x86amx_ty,
  4971. llvm_x86amx_ty], []>;
  4972. def int_x86_tilestored64_internal :
  4973. ClangBuiltin<"__builtin_ia32_tilestored64_internal">,
  4974. Intrinsic<[], [llvm_i16_ty, llvm_i16_ty, llvm_ptr_ty,
  4975. llvm_i64_ty, llvm_x86amx_ty], []>;
  4976. def int_x86_tilezero_internal :
  4977. ClangBuiltin<"__builtin_ia32_tilezero_internal">,
  4978. Intrinsic<[llvm_x86amx_ty], [llvm_i16_ty, llvm_i16_ty],
  4979. []>;
  4980. def int_x86_tdpbf16ps_internal :
  4981. ClangBuiltin<"__builtin_ia32_tdpbf16ps_internal">,
  4982. Intrinsic<[llvm_x86amx_ty],
  4983. [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
  4984. llvm_x86amx_ty, llvm_x86amx_ty,
  4985. llvm_x86amx_ty], []>;
  4986. def int_x86_tdpfp16ps_internal :
  4987. ClangBuiltin<"__builtin_ia32_tdpfp16ps_internal">,
  4988. Intrinsic<[llvm_x86amx_ty],
  4989. [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
  4990. llvm_x86amx_ty, llvm_x86amx_ty,
  4991. llvm_x86amx_ty], []>;
  4992. def int_x86_cast_vector_to_tile:
  4993. DefaultAttrsIntrinsic<[llvm_x86amx_ty], [llvm_anyvector_ty], [IntrNoMem]>;
  4994. def int_x86_cast_tile_to_vector:
  4995. DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_x86amx_ty], [IntrNoMem]>;
  4996. }
  4997. //===----------------------------------------------------------------------===//
  4998. let TargetPrefix = "x86" in {
  4999. // CMPCCXADD
  5000. def int_x86_cmpccxadd32
  5001. : ClangBuiltin<"__builtin_ia32_cmpccxadd32">,
  5002. Intrinsic<[llvm_i32_ty],
  5003. [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
  5004. [IntrArgMemOnly, ImmArg<ArgIndex<3>>]>;
  5005. def int_x86_cmpccxadd64
  5006. : ClangBuiltin<"__builtin_ia32_cmpccxadd64">,
  5007. Intrinsic<[llvm_i64_ty],
  5008. [llvm_ptr_ty, llvm_i64_ty, llvm_i64_ty, llvm_i32_ty],
  5009. [IntrArgMemOnly, ImmArg<ArgIndex<3>>]>;
  5010. // AVX-NE-CONVERT
  5011. def int_x86_vbcstnebf162ps128
  5012. : ClangBuiltin<"__builtin_ia32_vbcstnebf162ps128">,
  5013. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
  5014. [IntrReadMem, IntrArgMemOnly]>;
  5015. def int_x86_vbcstnebf162ps256
  5016. : ClangBuiltin<"__builtin_ia32_vbcstnebf162ps256">,
  5017. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
  5018. [IntrReadMem, IntrArgMemOnly]>;
  5019. def int_x86_vbcstnesh2ps128
  5020. : ClangBuiltin<"__builtin_ia32_vbcstnesh2ps128">,
  5021. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
  5022. [IntrReadMem, IntrArgMemOnly]>;
  5023. def int_x86_vbcstnesh2ps256
  5024. : ClangBuiltin<"__builtin_ia32_vbcstnesh2ps256">,
  5025. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
  5026. [IntrReadMem, IntrArgMemOnly]>;
  5027. def int_x86_vcvtneebf162ps128
  5028. : ClangBuiltin<"__builtin_ia32_vcvtneebf162ps128">,
  5029. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
  5030. [IntrReadMem, IntrArgMemOnly]>;
  5031. def int_x86_vcvtneebf162ps256
  5032. : ClangBuiltin<"__builtin_ia32_vcvtneebf162ps256">,
  5033. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
  5034. [IntrReadMem, IntrArgMemOnly]>;
  5035. def int_x86_vcvtneeph2ps128
  5036. : ClangBuiltin<"__builtin_ia32_vcvtneeph2ps128">,
  5037. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
  5038. [IntrReadMem, IntrArgMemOnly]>;
  5039. def int_x86_vcvtneeph2ps256
  5040. : ClangBuiltin<"__builtin_ia32_vcvtneeph2ps256">,
  5041. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
  5042. [IntrReadMem, IntrArgMemOnly]>;
  5043. def int_x86_vcvtneobf162ps128
  5044. : ClangBuiltin<"__builtin_ia32_vcvtneobf162ps128">,
  5045. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
  5046. [IntrReadMem, IntrArgMemOnly]>;
  5047. def int_x86_vcvtneobf162ps256
  5048. : ClangBuiltin<"__builtin_ia32_vcvtneobf162ps256">,
  5049. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
  5050. [IntrReadMem, IntrArgMemOnly]>;
  5051. def int_x86_vcvtneoph2ps128
  5052. : ClangBuiltin<"__builtin_ia32_vcvtneoph2ps128">,
  5053. DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
  5054. [IntrReadMem, IntrArgMemOnly]>;
  5055. def int_x86_vcvtneoph2ps256
  5056. : ClangBuiltin<"__builtin_ia32_vcvtneoph2ps256">,
  5057. DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
  5058. [IntrReadMem, IntrArgMemOnly]>;
  5059. def int_x86_vcvtneps2bf16128
  5060. : ClangBuiltin<"__builtin_ia32_vcvtneps2bf16128">,
  5061. DefaultAttrsIntrinsic<[llvm_v8bf16_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  5062. def int_x86_vcvtneps2bf16256
  5063. : ClangBuiltin<"__builtin_ia32_vcvtneps2bf16256">,
  5064. DefaultAttrsIntrinsic<[llvm_v8bf16_ty], [llvm_v8f32_ty], [IntrNoMem]>;
  5065. }
  5066. //===----------------------------------------------------------------------===//
  5067. // RAO-INT intrinsics
  5068. let TargetPrefix = "x86" in {
  5069. def int_x86_aadd32
  5070. : ClangBuiltin<"__builtin_ia32_aadd32">,
  5071. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrArgMemOnly]>;
  5072. def int_x86_aadd64
  5073. : ClangBuiltin<"__builtin_ia32_aadd64">,
  5074. Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], [IntrArgMemOnly]>;
  5075. def int_x86_aand32
  5076. : ClangBuiltin<"__builtin_ia32_aand32">,
  5077. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrArgMemOnly]>;
  5078. def int_x86_aand64
  5079. : ClangBuiltin<"__builtin_ia32_aand64">,
  5080. Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], [IntrArgMemOnly]>;
  5081. def int_x86_aor32
  5082. : ClangBuiltin<"__builtin_ia32_aor32">,
  5083. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrArgMemOnly]>;
  5084. def int_x86_aor64
  5085. : ClangBuiltin<"__builtin_ia32_aor64">,
  5086. Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], [IntrArgMemOnly]>;
  5087. def int_x86_axor32
  5088. : ClangBuiltin<"__builtin_ia32_axor32">,
  5089. Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrArgMemOnly]>;
  5090. def int_x86_axor64
  5091. : ClangBuiltin<"__builtin_ia32_axor64">,
  5092. Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], [IntrArgMemOnly]>;
  5093. }
  5094. //===----------------------------------------------------------------------===//
  5095. // UINTR - User Level Interrupt
  5096. let TargetPrefix = "x86" in {
  5097. def int_x86_clui : ClangBuiltin<"__builtin_ia32_clui">,
  5098. Intrinsic<[], [], []>;
  5099. def int_x86_stui : ClangBuiltin<"__builtin_ia32_stui">,
  5100. Intrinsic<[], [], []>;
  5101. def int_x86_testui : ClangBuiltin<"__builtin_ia32_testui">,
  5102. Intrinsic<[llvm_i8_ty], [], []>;
  5103. def int_x86_senduipi : ClangBuiltin<"__builtin_ia32_senduipi">,
  5104. Intrinsic<[], [llvm_i64_ty], []>;
  5105. }
  5106. //===----------------------------------------------------------------------===//
  5107. // avx512_fp16: vaddph
  5108. let TargetPrefix = "x86" in {
  5109. def int_x86_avx512fp16_add_ph_512
  5110. : ClangBuiltin<"__builtin_ia32_addph512">,
  5111. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5112. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
  5113. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5114. def int_x86_avx512fp16_sub_ph_512
  5115. : ClangBuiltin<"__builtin_ia32_subph512">,
  5116. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5117. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
  5118. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5119. def int_x86_avx512fp16_mul_ph_512
  5120. : ClangBuiltin<"__builtin_ia32_mulph512">,
  5121. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5122. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
  5123. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5124. def int_x86_avx512fp16_div_ph_512
  5125. : ClangBuiltin<"__builtin_ia32_divph512">,
  5126. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5127. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
  5128. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5129. def int_x86_avx512fp16_max_ph_128
  5130. : ClangBuiltin<"__builtin_ia32_maxph128">,
  5131. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5132. [ llvm_v8f16_ty, llvm_v8f16_ty ], [ IntrNoMem ]>;
  5133. def int_x86_avx512fp16_max_ph_256
  5134. : ClangBuiltin<"__builtin_ia32_maxph256">,
  5135. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5136. [ llvm_v16f16_ty, llvm_v16f16_ty ],
  5137. [ IntrNoMem ]>;
  5138. def int_x86_avx512fp16_max_ph_512
  5139. : ClangBuiltin<"__builtin_ia32_maxph512">,
  5140. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5141. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
  5142. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5143. def int_x86_avx512fp16_min_ph_128
  5144. : ClangBuiltin<"__builtin_ia32_minph128">,
  5145. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5146. [ llvm_v8f16_ty, llvm_v8f16_ty ], [ IntrNoMem ]>;
  5147. def int_x86_avx512fp16_min_ph_256
  5148. : ClangBuiltin<"__builtin_ia32_minph256">,
  5149. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5150. [ llvm_v16f16_ty, llvm_v16f16_ty ],
  5151. [ IntrNoMem ]>;
  5152. def int_x86_avx512fp16_min_ph_512
  5153. : ClangBuiltin<"__builtin_ia32_minph512">,
  5154. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5155. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
  5156. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5157. def int_x86_avx512fp16_mask_cmp_ph_512
  5158. : DefaultAttrsIntrinsic<[ llvm_v32i1_ty ],
  5159. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty,
  5160. llvm_v32i1_ty, llvm_i32_ty ],
  5161. [ IntrNoMem, ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<4>> ]>;
  5162. def int_x86_avx512fp16_mask_cmp_ph_256
  5163. : DefaultAttrsIntrinsic<[ llvm_v16i1_ty ],
  5164. [ llvm_v16f16_ty, llvm_v16f16_ty, llvm_i32_ty,
  5165. llvm_v16i1_ty ],
  5166. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5167. def int_x86_avx512fp16_mask_cmp_ph_128
  5168. : DefaultAttrsIntrinsic<[ llvm_v8i1_ty ],
  5169. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i32_ty,
  5170. llvm_v8i1_ty ],
  5171. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5172. def int_x86_avx512fp16_mask_add_sh_round
  5173. : ClangBuiltin<"__builtin_ia32_addsh_round_mask">,
  5174. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5175. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5176. llvm_i8_ty, llvm_i32_ty ],
  5177. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5178. def int_x86_avx512fp16_mask_sub_sh_round
  5179. : ClangBuiltin<"__builtin_ia32_subsh_round_mask">,
  5180. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5181. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5182. llvm_i8_ty, llvm_i32_ty ],
  5183. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5184. def int_x86_avx512fp16_mask_mul_sh_round
  5185. : ClangBuiltin<"__builtin_ia32_mulsh_round_mask">,
  5186. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5187. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5188. llvm_i8_ty, llvm_i32_ty ],
  5189. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5190. def int_x86_avx512fp16_mask_div_sh_round
  5191. : ClangBuiltin<"__builtin_ia32_divsh_round_mask">,
  5192. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5193. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5194. llvm_i8_ty, llvm_i32_ty ],
  5195. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5196. def int_x86_avx512fp16_mask_min_sh_round
  5197. : ClangBuiltin<"__builtin_ia32_minsh_round_mask">,
  5198. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5199. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5200. llvm_i8_ty, llvm_i32_ty ],
  5201. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5202. def int_x86_avx512fp16_mask_max_sh_round
  5203. : ClangBuiltin<"__builtin_ia32_maxsh_round_mask">,
  5204. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5205. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5206. llvm_i8_ty, llvm_i32_ty ],
  5207. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5208. def int_x86_avx512fp16_mask_cmp_sh
  5209. : ClangBuiltin<"__builtin_ia32_cmpsh_mask">,
  5210. DefaultAttrsIntrinsic<[ llvm_i8_ty ],
  5211. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i32_ty,
  5212. llvm_i8_ty, llvm_i32_ty ],
  5213. [ IntrNoMem, ImmArg<ArgIndex<2>>,
  5214. ImmArg<ArgIndex<4>> ]>;
  5215. def int_x86_avx512fp16_vcomi_sh
  5216. : ClangBuiltin<"__builtin_ia32_vcomish">,
  5217. DefaultAttrsIntrinsic<[ llvm_i32_ty ],
  5218. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i32_ty,
  5219. llvm_i32_ty ],
  5220. [ IntrNoMem, ImmArg<ArgIndex<2>>,
  5221. ImmArg<ArgIndex<3>> ]>;
  5222. def int_x86_avx512fp16_mask_vcvtph2psx_128
  5223. : ClangBuiltin<"__builtin_ia32_vcvtph2psx128_mask">,
  5224. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5225. [ llvm_v8f16_ty, llvm_v4f32_ty, llvm_i8_ty ],
  5226. [ IntrNoMem ]>;
  5227. def int_x86_avx512fp16_mask_vcvtph2psx_256
  5228. : ClangBuiltin<"__builtin_ia32_vcvtph2psx256_mask">,
  5229. DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
  5230. [ llvm_v8f16_ty, llvm_v8f32_ty, llvm_i8_ty ],
  5231. [ IntrNoMem ]>;
  5232. def int_x86_avx512fp16_mask_vcvtph2psx_512
  5233. : ClangBuiltin<"__builtin_ia32_vcvtph2psx512_mask">,
  5234. DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
  5235. [ llvm_v16f16_ty, llvm_v16f32_ty, llvm_i16_ty,
  5236. llvm_i32_ty ],
  5237. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5238. def int_x86_avx512fp16_mask_vcvtps2phx_128
  5239. : ClangBuiltin<"__builtin_ia32_vcvtps2phx128_mask">,
  5240. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5241. [ llvm_v4f32_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5242. [ IntrNoMem ]>;
  5243. def int_x86_avx512fp16_mask_vcvtps2phx_256
  5244. : ClangBuiltin<"__builtin_ia32_vcvtps2phx256_mask">,
  5245. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5246. [ llvm_v8f32_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5247. [ IntrNoMem ]>;
  5248. def int_x86_avx512fp16_mask_vcvtps2phx_512
  5249. : ClangBuiltin<"__builtin_ia32_vcvtps2phx512_mask">,
  5250. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5251. [ llvm_v16f32_ty, llvm_v16f16_ty, llvm_i16_ty,
  5252. llvm_i32_ty ],
  5253. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5254. def int_x86_avx512fp16_mask_vcvtpd2ph_128
  5255. : ClangBuiltin<"__builtin_ia32_vcvtpd2ph128_mask">,
  5256. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5257. [ llvm_v2f64_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5258. [ IntrNoMem ]>;
  5259. def int_x86_avx512fp16_mask_vcvtpd2ph_256
  5260. : ClangBuiltin<"__builtin_ia32_vcvtpd2ph256_mask">,
  5261. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5262. [ llvm_v4f64_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5263. [ IntrNoMem ]>;
  5264. def int_x86_avx512fp16_mask_vcvtpd2ph_512
  5265. : ClangBuiltin<"__builtin_ia32_vcvtpd2ph512_mask">,
  5266. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5267. [ llvm_v8f64_ty, llvm_v8f16_ty, llvm_i8_ty,
  5268. llvm_i32_ty ],
  5269. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5270. def int_x86_avx512fp16_mask_vcvtph2pd_128
  5271. : ClangBuiltin<"__builtin_ia32_vcvtph2pd128_mask">,
  5272. DefaultAttrsIntrinsic<[ llvm_v2f64_ty ],
  5273. [ llvm_v8f16_ty, llvm_v2f64_ty, llvm_i8_ty ],
  5274. [ IntrNoMem ]>;
  5275. def int_x86_avx512fp16_mask_vcvtph2pd_256
  5276. : ClangBuiltin<"__builtin_ia32_vcvtph2pd256_mask">,
  5277. DefaultAttrsIntrinsic<[ llvm_v4f64_ty ],
  5278. [ llvm_v8f16_ty, llvm_v4f64_ty, llvm_i8_ty ],
  5279. [ IntrNoMem ]>;
  5280. def int_x86_avx512fp16_mask_vcvtph2pd_512
  5281. : ClangBuiltin<"__builtin_ia32_vcvtph2pd512_mask">,
  5282. DefaultAttrsIntrinsic<[ llvm_v8f64_ty ],
  5283. [ llvm_v8f16_ty, llvm_v8f64_ty, llvm_i8_ty,
  5284. llvm_i32_ty ],
  5285. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5286. def int_x86_avx512fp16_mask_vcvtsh2ss_round
  5287. : ClangBuiltin<"__builtin_ia32_vcvtsh2ss_round_mask">,
  5288. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5289. [ llvm_v4f32_ty, llvm_v8f16_ty, llvm_v4f32_ty,
  5290. llvm_i8_ty, llvm_i32_ty ],
  5291. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5292. def int_x86_avx512fp16_mask_vcvtss2sh_round
  5293. : ClangBuiltin<"__builtin_ia32_vcvtss2sh_round_mask">,
  5294. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5295. [ llvm_v8f16_ty, llvm_v4f32_ty, llvm_v8f16_ty,
  5296. llvm_i8_ty, llvm_i32_ty ],
  5297. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5298. def int_x86_avx512fp16_mask_vcvtsd2sh_round
  5299. : ClangBuiltin<"__builtin_ia32_vcvtsd2sh_round_mask">,
  5300. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5301. [ llvm_v8f16_ty, llvm_v2f64_ty, llvm_v8f16_ty,
  5302. llvm_i8_ty, llvm_i32_ty ],
  5303. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5304. def int_x86_avx512fp16_mask_vcvtsh2sd_round
  5305. : ClangBuiltin<"__builtin_ia32_vcvtsh2sd_round_mask">,
  5306. DefaultAttrsIntrinsic<[ llvm_v2f64_ty ],
  5307. [ llvm_v2f64_ty, llvm_v8f16_ty, llvm_v2f64_ty,
  5308. llvm_i8_ty, llvm_i32_ty ],
  5309. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5310. def int_x86_avx512fp16_mask_vcvtph2w_128
  5311. : ClangBuiltin<"__builtin_ia32_vcvtph2w128_mask">,
  5312. DefaultAttrsIntrinsic<[ llvm_v8i16_ty ],
  5313. [ llvm_v8f16_ty, llvm_v8i16_ty, llvm_i8_ty ],
  5314. [ IntrNoMem ]>;
  5315. def int_x86_avx512fp16_mask_vcvtph2w_256
  5316. : ClangBuiltin<"__builtin_ia32_vcvtph2w256_mask">,
  5317. DefaultAttrsIntrinsic<[ llvm_v16i16_ty ],
  5318. [ llvm_v16f16_ty, llvm_v16i16_ty, llvm_i16_ty ],
  5319. [ IntrNoMem ]>;
  5320. def int_x86_avx512fp16_mask_vcvtph2w_512
  5321. : ClangBuiltin<"__builtin_ia32_vcvtph2w512_mask">,
  5322. DefaultAttrsIntrinsic<[ llvm_v32i16_ty ],
  5323. [ llvm_v32f16_ty, llvm_v32i16_ty, llvm_i32_ty,
  5324. llvm_i32_ty ],
  5325. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5326. def int_x86_avx512fp16_mask_vcvttph2w_128
  5327. : ClangBuiltin<"__builtin_ia32_vcvttph2w128_mask">,
  5328. DefaultAttrsIntrinsic<[ llvm_v8i16_ty ],
  5329. [ llvm_v8f16_ty, llvm_v8i16_ty, llvm_i8_ty ],
  5330. [ IntrNoMem ]>;
  5331. def int_x86_avx512fp16_mask_vcvttph2w_256
  5332. : ClangBuiltin<"__builtin_ia32_vcvttph2w256_mask">,
  5333. DefaultAttrsIntrinsic<[ llvm_v16i16_ty ],
  5334. [ llvm_v16f16_ty, llvm_v16i16_ty, llvm_i16_ty ],
  5335. [ IntrNoMem ]>;
  5336. def int_x86_avx512fp16_mask_vcvttph2w_512
  5337. : ClangBuiltin<"__builtin_ia32_vcvttph2w512_mask">,
  5338. DefaultAttrsIntrinsic<[ llvm_v32i16_ty ],
  5339. [ llvm_v32f16_ty, llvm_v32i16_ty, llvm_i32_ty,
  5340. llvm_i32_ty ],
  5341. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5342. def int_x86_avx512fp16_mask_vcvtph2uw_128
  5343. : ClangBuiltin<"__builtin_ia32_vcvtph2uw128_mask">,
  5344. DefaultAttrsIntrinsic<[ llvm_v8i16_ty ],
  5345. [ llvm_v8f16_ty, llvm_v8i16_ty, llvm_i8_ty ],
  5346. [ IntrNoMem ]>;
  5347. def int_x86_avx512fp16_mask_vcvtph2uw_256
  5348. : ClangBuiltin<"__builtin_ia32_vcvtph2uw256_mask">,
  5349. DefaultAttrsIntrinsic<[ llvm_v16i16_ty ],
  5350. [ llvm_v16f16_ty, llvm_v16i16_ty, llvm_i16_ty ],
  5351. [ IntrNoMem ]>;
  5352. def int_x86_avx512fp16_mask_vcvtph2uw_512
  5353. : ClangBuiltin<"__builtin_ia32_vcvtph2uw512_mask">,
  5354. DefaultAttrsIntrinsic<[ llvm_v32i16_ty ],
  5355. [ llvm_v32f16_ty, llvm_v32i16_ty, llvm_i32_ty,
  5356. llvm_i32_ty ],
  5357. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5358. def int_x86_avx512fp16_mask_vcvttph2uw_128
  5359. : ClangBuiltin<"__builtin_ia32_vcvttph2uw128_mask">,
  5360. DefaultAttrsIntrinsic<[ llvm_v8i16_ty ],
  5361. [ llvm_v8f16_ty, llvm_v8i16_ty, llvm_i8_ty ],
  5362. [ IntrNoMem ]>;
  5363. def int_x86_avx512fp16_mask_vcvttph2uw_256
  5364. : ClangBuiltin<"__builtin_ia32_vcvttph2uw256_mask">,
  5365. DefaultAttrsIntrinsic<[ llvm_v16i16_ty ],
  5366. [ llvm_v16f16_ty, llvm_v16i16_ty, llvm_i16_ty ],
  5367. [ IntrNoMem ]>;
  5368. def int_x86_avx512fp16_mask_vcvttph2uw_512
  5369. : ClangBuiltin<"__builtin_ia32_vcvttph2uw512_mask">,
  5370. DefaultAttrsIntrinsic<[ llvm_v32i16_ty ],
  5371. [ llvm_v32f16_ty, llvm_v32i16_ty, llvm_i32_ty,
  5372. llvm_i32_ty ],
  5373. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5374. def int_x86_avx512fp16_mask_vcvtph2dq_128
  5375. : ClangBuiltin<"__builtin_ia32_vcvtph2dq128_mask">,
  5376. DefaultAttrsIntrinsic<[ llvm_v4i32_ty ],
  5377. [ llvm_v8f16_ty, llvm_v4i32_ty, llvm_i8_ty ],
  5378. [ IntrNoMem ]>;
  5379. def int_x86_avx512fp16_mask_vcvtph2dq_256
  5380. : ClangBuiltin<"__builtin_ia32_vcvtph2dq256_mask">,
  5381. DefaultAttrsIntrinsic<[ llvm_v8i32_ty ],
  5382. [ llvm_v8f16_ty, llvm_v8i32_ty, llvm_i8_ty ],
  5383. [ IntrNoMem ]>;
  5384. def int_x86_avx512fp16_mask_vcvtph2dq_512
  5385. : ClangBuiltin<"__builtin_ia32_vcvtph2dq512_mask">,
  5386. DefaultAttrsIntrinsic<[ llvm_v16i32_ty ],
  5387. [ llvm_v16f16_ty, llvm_v16i32_ty, llvm_i16_ty,
  5388. llvm_i32_ty ],
  5389. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5390. def int_x86_avx512fp16_mask_vcvtph2udq_128
  5391. : ClangBuiltin<"__builtin_ia32_vcvtph2udq128_mask">,
  5392. DefaultAttrsIntrinsic<[ llvm_v4i32_ty ],
  5393. [ llvm_v8f16_ty, llvm_v4i32_ty, llvm_i8_ty ],
  5394. [ IntrNoMem ]>;
  5395. def int_x86_avx512fp16_mask_vcvtph2udq_256
  5396. : ClangBuiltin<"__builtin_ia32_vcvtph2udq256_mask">,
  5397. DefaultAttrsIntrinsic<[ llvm_v8i32_ty ],
  5398. [ llvm_v8f16_ty, llvm_v8i32_ty, llvm_i8_ty ],
  5399. [ IntrNoMem ]>;
  5400. def int_x86_avx512fp16_mask_vcvtph2udq_512
  5401. : ClangBuiltin<"__builtin_ia32_vcvtph2udq512_mask">,
  5402. DefaultAttrsIntrinsic<[ llvm_v16i32_ty ],
  5403. [ llvm_v16f16_ty, llvm_v16i32_ty, llvm_i16_ty,
  5404. llvm_i32_ty ],
  5405. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5406. def int_x86_avx512fp16_mask_vcvtdq2ph_128
  5407. : ClangBuiltin<"__builtin_ia32_vcvtdq2ph128_mask">,
  5408. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5409. [ llvm_v4i32_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5410. [ IntrNoMem ]>;
  5411. def int_x86_avx512fp16_mask_vcvtudq2ph_128
  5412. : ClangBuiltin<"__builtin_ia32_vcvtudq2ph128_mask">,
  5413. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5414. [ llvm_v4i32_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5415. [ IntrNoMem ]>;
  5416. def int_x86_avx512fp16_mask_vcvttph2dq_128
  5417. : ClangBuiltin<"__builtin_ia32_vcvttph2dq128_mask">,
  5418. DefaultAttrsIntrinsic<[ llvm_v4i32_ty ],
  5419. [ llvm_v8f16_ty, llvm_v4i32_ty, llvm_i8_ty ],
  5420. [ IntrNoMem ]>;
  5421. def int_x86_avx512fp16_mask_vcvttph2dq_256
  5422. : ClangBuiltin<"__builtin_ia32_vcvttph2dq256_mask">,
  5423. DefaultAttrsIntrinsic<[ llvm_v8i32_ty ],
  5424. [ llvm_v8f16_ty, llvm_v8i32_ty, llvm_i8_ty ],
  5425. [ IntrNoMem ]>;
  5426. def int_x86_avx512fp16_mask_vcvttph2dq_512
  5427. : ClangBuiltin<"__builtin_ia32_vcvttph2dq512_mask">,
  5428. DefaultAttrsIntrinsic<[ llvm_v16i32_ty ],
  5429. [ llvm_v16f16_ty, llvm_v16i32_ty, llvm_i16_ty,
  5430. llvm_i32_ty ],
  5431. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5432. def int_x86_avx512fp16_mask_vcvttph2udq_128
  5433. : ClangBuiltin<"__builtin_ia32_vcvttph2udq128_mask">,
  5434. DefaultAttrsIntrinsic<[ llvm_v4i32_ty ],
  5435. [ llvm_v8f16_ty, llvm_v4i32_ty, llvm_i8_ty ],
  5436. [ IntrNoMem ]>;
  5437. def int_x86_avx512fp16_mask_vcvttph2udq_256
  5438. : ClangBuiltin<"__builtin_ia32_vcvttph2udq256_mask">,
  5439. DefaultAttrsIntrinsic<[ llvm_v8i32_ty ],
  5440. [ llvm_v8f16_ty, llvm_v8i32_ty, llvm_i8_ty ],
  5441. [ IntrNoMem ]>;
  5442. def int_x86_avx512fp16_mask_vcvttph2udq_512
  5443. : ClangBuiltin<"__builtin_ia32_vcvttph2udq512_mask">,
  5444. DefaultAttrsIntrinsic<[ llvm_v16i32_ty ],
  5445. [ llvm_v16f16_ty, llvm_v16i32_ty, llvm_i16_ty,
  5446. llvm_i32_ty ],
  5447. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5448. def int_x86_avx512fp16_mask_vcvtqq2ph_128
  5449. : ClangBuiltin<"__builtin_ia32_vcvtqq2ph128_mask">,
  5450. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5451. [ llvm_v2i64_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5452. [ IntrNoMem ]>;
  5453. def int_x86_avx512fp16_mask_vcvtqq2ph_256
  5454. : ClangBuiltin<"__builtin_ia32_vcvtqq2ph256_mask">,
  5455. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5456. [ llvm_v4i64_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5457. [ IntrNoMem ]>;
  5458. def int_x86_avx512fp16_mask_vcvtph2qq_128
  5459. : ClangBuiltin<"__builtin_ia32_vcvtph2qq128_mask">,
  5460. DefaultAttrsIntrinsic<[ llvm_v2i64_ty ],
  5461. [ llvm_v8f16_ty, llvm_v2i64_ty, llvm_i8_ty ],
  5462. [ IntrNoMem ]>;
  5463. def int_x86_avx512fp16_mask_vcvtph2qq_256
  5464. : ClangBuiltin<"__builtin_ia32_vcvtph2qq256_mask">,
  5465. DefaultAttrsIntrinsic<[ llvm_v4i64_ty ],
  5466. [ llvm_v8f16_ty, llvm_v4i64_ty, llvm_i8_ty ],
  5467. [ IntrNoMem ]>;
  5468. def int_x86_avx512fp16_mask_vcvtph2qq_512
  5469. : ClangBuiltin<"__builtin_ia32_vcvtph2qq512_mask">,
  5470. DefaultAttrsIntrinsic<[ llvm_v8i64_ty ],
  5471. [ llvm_v8f16_ty, llvm_v8i64_ty, llvm_i8_ty,
  5472. llvm_i32_ty ],
  5473. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5474. def int_x86_avx512fp16_mask_vcvtuqq2ph_128
  5475. : ClangBuiltin<"__builtin_ia32_vcvtuqq2ph128_mask">,
  5476. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5477. [ llvm_v2i64_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5478. [ IntrNoMem ]>;
  5479. def int_x86_avx512fp16_mask_vcvtuqq2ph_256
  5480. : ClangBuiltin<"__builtin_ia32_vcvtuqq2ph256_mask">,
  5481. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5482. [ llvm_v4i64_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5483. [ IntrNoMem ]>;
  5484. def int_x86_avx512fp16_mask_vcvtph2uqq_128
  5485. : ClangBuiltin<"__builtin_ia32_vcvtph2uqq128_mask">,
  5486. DefaultAttrsIntrinsic<[ llvm_v2i64_ty ],
  5487. [ llvm_v8f16_ty, llvm_v2i64_ty, llvm_i8_ty ],
  5488. [ IntrNoMem ]>;
  5489. def int_x86_avx512fp16_mask_vcvtph2uqq_256
  5490. : ClangBuiltin<"__builtin_ia32_vcvtph2uqq256_mask">,
  5491. DefaultAttrsIntrinsic<[ llvm_v4i64_ty ],
  5492. [ llvm_v8f16_ty, llvm_v4i64_ty, llvm_i8_ty ],
  5493. [ IntrNoMem ]>;
  5494. def int_x86_avx512fp16_mask_vcvtph2uqq_512
  5495. : ClangBuiltin<"__builtin_ia32_vcvtph2uqq512_mask">,
  5496. DefaultAttrsIntrinsic<[ llvm_v8i64_ty ],
  5497. [ llvm_v8f16_ty, llvm_v8i64_ty, llvm_i8_ty,
  5498. llvm_i32_ty ],
  5499. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5500. def int_x86_avx512fp16_mask_vcvttph2qq_128
  5501. : ClangBuiltin<"__builtin_ia32_vcvttph2qq128_mask">,
  5502. DefaultAttrsIntrinsic<[ llvm_v2i64_ty ],
  5503. [ llvm_v8f16_ty, llvm_v2i64_ty, llvm_i8_ty ],
  5504. [ IntrNoMem ]>;
  5505. def int_x86_avx512fp16_mask_vcvttph2qq_256
  5506. : ClangBuiltin<"__builtin_ia32_vcvttph2qq256_mask">,
  5507. DefaultAttrsIntrinsic<[ llvm_v4i64_ty ],
  5508. [ llvm_v8f16_ty, llvm_v4i64_ty, llvm_i8_ty ],
  5509. [ IntrNoMem ]>;
  5510. def int_x86_avx512fp16_mask_vcvttph2qq_512
  5511. : ClangBuiltin<"__builtin_ia32_vcvttph2qq512_mask">,
  5512. DefaultAttrsIntrinsic<[ llvm_v8i64_ty ],
  5513. [ llvm_v8f16_ty, llvm_v8i64_ty, llvm_i8_ty,
  5514. llvm_i32_ty ],
  5515. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5516. def int_x86_avx512fp16_mask_vcvttph2uqq_128
  5517. : ClangBuiltin<"__builtin_ia32_vcvttph2uqq128_mask">,
  5518. DefaultAttrsIntrinsic<[ llvm_v2i64_ty ],
  5519. [ llvm_v8f16_ty, llvm_v2i64_ty, llvm_i8_ty ],
  5520. [ IntrNoMem ]>;
  5521. def int_x86_avx512fp16_mask_vcvttph2uqq_256
  5522. : ClangBuiltin<"__builtin_ia32_vcvttph2uqq256_mask">,
  5523. DefaultAttrsIntrinsic<[ llvm_v4i64_ty ],
  5524. [ llvm_v8f16_ty, llvm_v4i64_ty, llvm_i8_ty ],
  5525. [ IntrNoMem ]>;
  5526. def int_x86_avx512fp16_mask_vcvttph2uqq_512
  5527. : ClangBuiltin<"__builtin_ia32_vcvttph2uqq512_mask">,
  5528. DefaultAttrsIntrinsic<[ llvm_v8i64_ty ],
  5529. [ llvm_v8f16_ty, llvm_v8i64_ty, llvm_i8_ty,
  5530. llvm_i32_ty ],
  5531. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5532. def int_x86_avx512fp16_vcvtsh2si32
  5533. : ClangBuiltin<"__builtin_ia32_vcvtsh2si32">,
  5534. DefaultAttrsIntrinsic<[ llvm_i32_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
  5535. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5536. def int_x86_avx512fp16_vcvtsh2usi32
  5537. : ClangBuiltin<"__builtin_ia32_vcvtsh2usi32">,
  5538. DefaultAttrsIntrinsic<[ llvm_i32_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
  5539. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5540. def int_x86_avx512fp16_vcvtsh2si64
  5541. : ClangBuiltin<"__builtin_ia32_vcvtsh2si64">,
  5542. DefaultAttrsIntrinsic<[ llvm_i64_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
  5543. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5544. def int_x86_avx512fp16_vcvtsh2usi64
  5545. : ClangBuiltin<"__builtin_ia32_vcvtsh2usi64">,
  5546. DefaultAttrsIntrinsic<[ llvm_i64_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
  5547. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5548. def int_x86_avx512fp16_vcvtusi2sh
  5549. : ClangBuiltin<"__builtin_ia32_vcvtusi2sh">,
  5550. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5551. [ llvm_v8f16_ty, llvm_i32_ty, llvm_i32_ty ],
  5552. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5553. def int_x86_avx512fp16_vcvtusi642sh
  5554. : ClangBuiltin<"__builtin_ia32_vcvtusi642sh">,
  5555. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5556. [ llvm_v8f16_ty, llvm_i64_ty, llvm_i32_ty ],
  5557. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5558. def int_x86_avx512fp16_vcvtsi2sh
  5559. : ClangBuiltin<"__builtin_ia32_vcvtsi2sh">,
  5560. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5561. [ llvm_v8f16_ty, llvm_i32_ty, llvm_i32_ty ],
  5562. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5563. def int_x86_avx512fp16_vcvtsi642sh
  5564. : ClangBuiltin<"__builtin_ia32_vcvtsi642sh">,
  5565. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5566. [ llvm_v8f16_ty, llvm_i64_ty, llvm_i32_ty ],
  5567. [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
  5568. def int_x86_avx512fp16_vcvttsh2si32
  5569. : ClangBuiltin<"__builtin_ia32_vcvttsh2si32">,
  5570. DefaultAttrsIntrinsic<[ llvm_i32_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
  5571. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5572. def int_x86_avx512fp16_vcvttsh2si64
  5573. : ClangBuiltin<"__builtin_ia32_vcvttsh2si64">,
  5574. DefaultAttrsIntrinsic<[ llvm_i64_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
  5575. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5576. def int_x86_avx512fp16_vcvttsh2usi32
  5577. : ClangBuiltin<"__builtin_ia32_vcvttsh2usi32">,
  5578. DefaultAttrsIntrinsic<[ llvm_i32_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
  5579. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5580. def int_x86_avx512fp16_vcvttsh2usi64
  5581. : ClangBuiltin<"__builtin_ia32_vcvttsh2usi64">,
  5582. DefaultAttrsIntrinsic<[ llvm_i64_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
  5583. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5584. def int_x86_avx512fp16_sqrt_ph_512
  5585. : DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5586. [ llvm_v32f16_ty, llvm_i32_ty ],
  5587. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5588. def int_x86_avx512fp16_mask_sqrt_sh
  5589. : DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5590. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5591. llvm_i8_ty, llvm_i32_ty ],
  5592. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5593. def int_x86_avx512fp16_mask_rsqrt_ph_128
  5594. : ClangBuiltin<"__builtin_ia32_rsqrtph128_mask">,
  5595. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5596. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5597. [ IntrNoMem ]>;
  5598. def int_x86_avx512fp16_mask_rsqrt_ph_256
  5599. : ClangBuiltin<"__builtin_ia32_rsqrtph256_mask">,
  5600. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5601. [ llvm_v16f16_ty, llvm_v16f16_ty, llvm_i16_ty ],
  5602. [ IntrNoMem ]>;
  5603. def int_x86_avx512fp16_mask_rsqrt_ph_512
  5604. : ClangBuiltin<"__builtin_ia32_rsqrtph512_mask">,
  5605. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5606. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
  5607. [ IntrNoMem ]>;
  5608. def int_x86_avx512fp16_mask_rsqrt_sh
  5609. : ClangBuiltin<"__builtin_ia32_rsqrtsh_mask">,
  5610. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5611. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5612. llvm_i8_ty ],
  5613. [ IntrNoMem ]>;
  5614. def int_x86_avx512fp16_mask_rcp_ph_128
  5615. : ClangBuiltin<"__builtin_ia32_rcpph128_mask">,
  5616. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5617. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5618. [ IntrNoMem ]>;
  5619. def int_x86_avx512fp16_mask_rcp_ph_256
  5620. : ClangBuiltin<"__builtin_ia32_rcpph256_mask">,
  5621. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5622. [ llvm_v16f16_ty, llvm_v16f16_ty, llvm_i16_ty ],
  5623. [ IntrNoMem ]>;
  5624. def int_x86_avx512fp16_mask_rcp_ph_512
  5625. : ClangBuiltin<"__builtin_ia32_rcpph512_mask">,
  5626. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5627. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
  5628. [ IntrNoMem ]>;
  5629. def int_x86_avx512fp16_mask_rcp_sh
  5630. : ClangBuiltin<"__builtin_ia32_rcpsh_mask">,
  5631. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5632. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5633. llvm_i8_ty ],
  5634. [ IntrNoMem ]>;
  5635. def int_x86_avx512fp16_mask_reduce_ph_128
  5636. : ClangBuiltin<"__builtin_ia32_reduceph128_mask">,
  5637. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5638. [ llvm_v8f16_ty, llvm_i32_ty, llvm_v8f16_ty,
  5639. llvm_i8_ty ],
  5640. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5641. def int_x86_avx512fp16_mask_reduce_ph_256
  5642. : ClangBuiltin<"__builtin_ia32_reduceph256_mask">,
  5643. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5644. [ llvm_v16f16_ty, llvm_i32_ty, llvm_v16f16_ty,
  5645. llvm_i16_ty ],
  5646. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5647. def int_x86_avx512fp16_mask_reduce_ph_512
  5648. : ClangBuiltin<"__builtin_ia32_reduceph512_mask">,
  5649. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5650. [ llvm_v32f16_ty, llvm_i32_ty, llvm_v32f16_ty,
  5651. llvm_i32_ty, llvm_i32_ty ],
  5652. [ IntrNoMem, ImmArg<ArgIndex<1>>,
  5653. ImmArg<ArgIndex<4>> ]>;
  5654. def int_x86_avx512fp16_mask_reduce_sh
  5655. : ClangBuiltin<"__builtin_ia32_reducesh_mask">,
  5656. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5657. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5658. llvm_i8_ty, llvm_i32_ty, llvm_i32_ty ],
  5659. [ IntrNoMem, ImmArg<ArgIndex<4>>,
  5660. ImmArg<ArgIndex<5>> ]>;
  5661. def int_x86_avx512fp16_fpclass_ph_128
  5662. : DefaultAttrsIntrinsic<[ llvm_v8i1_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
  5663. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5664. def int_x86_avx512fp16_fpclass_ph_256
  5665. : DefaultAttrsIntrinsic<[ llvm_v16i1_ty ],
  5666. [ llvm_v16f16_ty, llvm_i32_ty ],
  5667. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5668. def int_x86_avx512fp16_fpclass_ph_512
  5669. : DefaultAttrsIntrinsic<[ llvm_v32i1_ty ],
  5670. [ llvm_v32f16_ty, llvm_i32_ty ],
  5671. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5672. def int_x86_avx512fp16_mask_fpclass_sh
  5673. : ClangBuiltin<"__builtin_ia32_fpclasssh_mask">,
  5674. DefaultAttrsIntrinsic<[ llvm_i8_ty ],
  5675. [ llvm_v8f16_ty, llvm_i32_ty, llvm_i8_ty ],
  5676. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5677. def int_x86_avx512fp16_mask_getexp_ph_128
  5678. : ClangBuiltin<"__builtin_ia32_getexpph128_mask">,
  5679. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5680. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i8_ty ],
  5681. [ IntrNoMem ]>;
  5682. def int_x86_avx512fp16_mask_getexp_ph_256
  5683. : ClangBuiltin<"__builtin_ia32_getexpph256_mask">,
  5684. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5685. [ llvm_v16f16_ty, llvm_v16f16_ty, llvm_i16_ty ],
  5686. [ IntrNoMem ]>;
  5687. def int_x86_avx512fp16_mask_getexp_ph_512
  5688. : ClangBuiltin<"__builtin_ia32_getexpph512_mask">,
  5689. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5690. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty,
  5691. llvm_i32_ty ],
  5692. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5693. def int_x86_avx512fp16_mask_getexp_sh
  5694. : ClangBuiltin<"__builtin_ia32_getexpsh128_round_mask">,
  5695. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5696. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5697. llvm_i8_ty, llvm_i32_ty ],
  5698. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5699. def int_x86_avx512fp16_mask_getmant_ph_128
  5700. : ClangBuiltin<"__builtin_ia32_getmantph128_mask">,
  5701. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5702. [ llvm_v8f16_ty, llvm_i32_ty, llvm_v8f16_ty,
  5703. llvm_i8_ty ],
  5704. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5705. def int_x86_avx512fp16_mask_getmant_ph_256
  5706. : ClangBuiltin<"__builtin_ia32_getmantph256_mask">,
  5707. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5708. [ llvm_v16f16_ty, llvm_i32_ty, llvm_v16f16_ty,
  5709. llvm_i16_ty ],
  5710. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5711. def int_x86_avx512fp16_mask_getmant_ph_512
  5712. : ClangBuiltin<"__builtin_ia32_getmantph512_mask">,
  5713. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5714. [ llvm_v32f16_ty, llvm_i32_ty, llvm_v32f16_ty,
  5715. llvm_i32_ty, llvm_i32_ty ],
  5716. [ IntrNoMem, ImmArg<ArgIndex<1>>,
  5717. ImmArg<ArgIndex<4>> ]>;
  5718. def int_x86_avx512fp16_mask_getmant_sh
  5719. : ClangBuiltin<"__builtin_ia32_getmantsh_round_mask">,
  5720. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5721. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i32_ty,
  5722. llvm_v8f16_ty, llvm_i8_ty, llvm_i32_ty ],
  5723. [ IntrNoMem, ImmArg<ArgIndex<2>>,
  5724. ImmArg<ArgIndex<5>> ]>;
  5725. def int_x86_avx512fp16_mask_rndscale_ph_128
  5726. : ClangBuiltin<"__builtin_ia32_rndscaleph_128_mask">,
  5727. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5728. [ llvm_v8f16_ty, llvm_i32_ty, llvm_v8f16_ty,
  5729. llvm_i8_ty ],
  5730. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5731. def int_x86_avx512fp16_mask_rndscale_ph_256
  5732. : ClangBuiltin<"__builtin_ia32_rndscaleph_256_mask">,
  5733. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5734. [ llvm_v16f16_ty, llvm_i32_ty, llvm_v16f16_ty,
  5735. llvm_i16_ty ],
  5736. [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
  5737. def int_x86_avx512fp16_mask_rndscale_ph_512
  5738. : ClangBuiltin<"__builtin_ia32_rndscaleph_mask">,
  5739. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5740. [ llvm_v32f16_ty, llvm_i32_ty, llvm_v32f16_ty,
  5741. llvm_i32_ty, llvm_i32_ty ],
  5742. [ IntrNoMem, ImmArg<ArgIndex<1>>,
  5743. ImmArg<ArgIndex<4>> ]>;
  5744. def int_x86_avx512fp16_mask_rndscale_sh
  5745. : ClangBuiltin<"__builtin_ia32_rndscalesh_round_mask">,
  5746. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5747. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5748. llvm_i8_ty, llvm_i32_ty, llvm_i32_ty ],
  5749. [ IntrNoMem, ImmArg<ArgIndex<4>>,
  5750. ImmArg<ArgIndex<5>> ]>;
  5751. def int_x86_avx512fp16_mask_scalef_ph_128
  5752. : ClangBuiltin<"__builtin_ia32_scalefph128_mask">,
  5753. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5754. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5755. llvm_i8_ty ],
  5756. [ IntrNoMem ]>;
  5757. def int_x86_avx512fp16_mask_scalef_ph_256
  5758. : ClangBuiltin<"__builtin_ia32_scalefph256_mask">,
  5759. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5760. [ llvm_v16f16_ty, llvm_v16f16_ty, llvm_v16f16_ty,
  5761. llvm_i16_ty ],
  5762. [ IntrNoMem ]>;
  5763. def int_x86_avx512fp16_mask_scalef_ph_512
  5764. : ClangBuiltin<"__builtin_ia32_scalefph512_mask">,
  5765. DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5766. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_v32f16_ty,
  5767. llvm_i32_ty, llvm_i32_ty ],
  5768. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5769. def int_x86_avx512fp16_mask_scalef_sh
  5770. : ClangBuiltin<"__builtin_ia32_scalefsh_round_mask">,
  5771. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5772. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
  5773. llvm_i8_ty, llvm_i32_ty ],
  5774. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5775. def int_x86_avx512fp16_vfmadd_ph_512
  5776. : DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5777. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_v32f16_ty,
  5778. llvm_i32_ty ],
  5779. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5780. def int_x86_avx512fp16_vfmaddsub_ph_128
  5781. : ClangBuiltin<"__builtin_ia32_vfmaddsubph">,
  5782. DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
  5783. [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty ],
  5784. [ IntrNoMem ]>;
  5785. def int_x86_avx512fp16_vfmaddsub_ph_256
  5786. : ClangBuiltin<"__builtin_ia32_vfmaddsubph256">,
  5787. DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
  5788. [ llvm_v16f16_ty, llvm_v16f16_ty,
  5789. llvm_v16f16_ty ],
  5790. [ IntrNoMem ]>;
  5791. def int_x86_avx512fp16_vfmaddsub_ph_512
  5792. : DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
  5793. [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_v32f16_ty,
  5794. llvm_i32_ty ],
  5795. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5796. def int_x86_avx512fp16_vfmadd_f16
  5797. : DefaultAttrsIntrinsic<[ llvm_half_ty ],
  5798. [ llvm_half_ty, llvm_half_ty, llvm_half_ty,
  5799. llvm_i32_ty ],
  5800. [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
  5801. def int_x86_avx512fp16_mask_vfcmadd_cph_128
  5802. : ClangBuiltin<"__builtin_ia32_vfcmaddcph128_mask">,
  5803. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5804. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5805. llvm_i8_ty ],
  5806. [ IntrNoMem ]>;
  5807. def int_x86_avx512fp16_maskz_vfcmadd_cph_128
  5808. : ClangBuiltin<"__builtin_ia32_vfcmaddcph128_maskz">,
  5809. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5810. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5811. llvm_i8_ty ],
  5812. [ IntrNoMem ]>;
  5813. def int_x86_avx512fp16_mask_vfcmadd_cph_256
  5814. : ClangBuiltin<"__builtin_ia32_vfcmaddcph256_mask">,
  5815. DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
  5816. [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
  5817. llvm_i8_ty ],
  5818. [ IntrNoMem ]>;
  5819. def int_x86_avx512fp16_maskz_vfcmadd_cph_256
  5820. : ClangBuiltin<"__builtin_ia32_vfcmaddcph256_maskz">,
  5821. DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
  5822. [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
  5823. llvm_i8_ty ],
  5824. [ IntrNoMem ]>;
  5825. def int_x86_avx512fp16_mask_vfcmadd_cph_512
  5826. : ClangBuiltin<"__builtin_ia32_vfcmaddcph512_mask3">,
  5827. DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
  5828. [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
  5829. llvm_i16_ty, llvm_i32_ty ],
  5830. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5831. def int_x86_avx512fp16_maskz_vfcmadd_cph_512
  5832. : ClangBuiltin<"__builtin_ia32_vfcmaddcph512_maskz">,
  5833. DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
  5834. [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
  5835. llvm_i16_ty, llvm_i32_ty ],
  5836. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5837. def int_x86_avx512fp16_mask_vfmadd_cph_128
  5838. : ClangBuiltin<"__builtin_ia32_vfmaddcph128_mask">,
  5839. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5840. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5841. llvm_i8_ty ],
  5842. [ IntrNoMem ]>;
  5843. def int_x86_avx512fp16_maskz_vfmadd_cph_128
  5844. : ClangBuiltin<"__builtin_ia32_vfmaddcph128_maskz">,
  5845. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5846. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5847. llvm_i8_ty ],
  5848. [ IntrNoMem ]>;
  5849. def int_x86_avx512fp16_mask_vfmadd_cph_256
  5850. : ClangBuiltin<"__builtin_ia32_vfmaddcph256_mask">,
  5851. DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
  5852. [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
  5853. llvm_i8_ty ],
  5854. [ IntrNoMem ]>;
  5855. def int_x86_avx512fp16_maskz_vfmadd_cph_256
  5856. : ClangBuiltin<"__builtin_ia32_vfmaddcph256_maskz">,
  5857. DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
  5858. [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
  5859. llvm_i8_ty ],
  5860. [ IntrNoMem ]>;
  5861. def int_x86_avx512fp16_mask_vfmadd_cph_512
  5862. : ClangBuiltin<"__builtin_ia32_vfmaddcph512_mask3">,
  5863. DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
  5864. [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
  5865. llvm_i16_ty, llvm_i32_ty ],
  5866. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5867. def int_x86_avx512fp16_maskz_vfmadd_cph_512
  5868. : ClangBuiltin<"__builtin_ia32_vfmaddcph512_maskz">,
  5869. DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
  5870. [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
  5871. llvm_i16_ty, llvm_i32_ty ],
  5872. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5873. def int_x86_avx512fp16_mask_vfmadd_csh
  5874. : ClangBuiltin<"__builtin_ia32_vfmaddcsh_mask">,
  5875. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5876. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5877. llvm_i8_ty, llvm_i32_ty ],
  5878. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5879. def int_x86_avx512fp16_maskz_vfmadd_csh
  5880. : ClangBuiltin<"__builtin_ia32_vfmaddcsh_maskz">,
  5881. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5882. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5883. llvm_i8_ty, llvm_i32_ty ],
  5884. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5885. def int_x86_avx512fp16_mask_vfcmadd_csh
  5886. : ClangBuiltin<"__builtin_ia32_vfcmaddcsh_mask">,
  5887. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5888. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5889. llvm_i8_ty, llvm_i32_ty ],
  5890. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5891. def int_x86_avx512fp16_maskz_vfcmadd_csh
  5892. : ClangBuiltin<"__builtin_ia32_vfcmaddcsh_maskz">,
  5893. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5894. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5895. llvm_i8_ty, llvm_i32_ty ],
  5896. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5897. def int_x86_avx512fp16_mask_vfmul_cph_128
  5898. : ClangBuiltin<"__builtin_ia32_vfmulcph128_mask">,
  5899. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5900. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5901. llvm_i8_ty ],
  5902. [ IntrNoMem ]>;
  5903. def int_x86_avx512fp16_mask_vfcmul_cph_128
  5904. : ClangBuiltin<"__builtin_ia32_vfcmulcph128_mask">,
  5905. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5906. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5907. llvm_i8_ty ],
  5908. [ IntrNoMem ]>;
  5909. def int_x86_avx512fp16_mask_vfmul_cph_256
  5910. : ClangBuiltin<"__builtin_ia32_vfmulcph256_mask">,
  5911. DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
  5912. [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
  5913. llvm_i8_ty ],
  5914. [ IntrNoMem ]>;
  5915. def int_x86_avx512fp16_mask_vfcmul_cph_256
  5916. : ClangBuiltin<"__builtin_ia32_vfcmulcph256_mask">,
  5917. DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
  5918. [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
  5919. llvm_i8_ty ],
  5920. [ IntrNoMem ]>;
  5921. def int_x86_avx512fp16_mask_vfmul_cph_512
  5922. : ClangBuiltin<"__builtin_ia32_vfmulcph512_mask">,
  5923. DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
  5924. [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
  5925. llvm_i16_ty, llvm_i32_ty ],
  5926. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5927. def int_x86_avx512fp16_mask_vfcmul_cph_512
  5928. : ClangBuiltin<"__builtin_ia32_vfcmulcph512_mask">,
  5929. DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
  5930. [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
  5931. llvm_i16_ty, llvm_i32_ty ],
  5932. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5933. def int_x86_avx512fp16_mask_vfmul_csh
  5934. : ClangBuiltin<"__builtin_ia32_vfmulcsh_mask">,
  5935. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5936. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5937. llvm_i8_ty, llvm_i32_ty ],
  5938. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5939. def int_x86_avx512fp16_mask_vfcmul_csh
  5940. : ClangBuiltin<"__builtin_ia32_vfcmulcsh_mask">,
  5941. DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
  5942. [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
  5943. llvm_i8_ty, llvm_i32_ty ],
  5944. [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
  5945. }