IntrinsicsAArch64.td 128 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962
  1. //===- IntrinsicsAARCH64.td - Defines AARCH64 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 AARCH64-specific intrinsics.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. let TargetPrefix = "aarch64" in {
  13. def int_aarch64_ldxr : Intrinsic<[llvm_i64_ty], [llvm_anyptr_ty],
  14. [IntrNoFree, IntrWillReturn]>;
  15. def int_aarch64_ldaxr : Intrinsic<[llvm_i64_ty], [llvm_anyptr_ty],
  16. [IntrNoFree, IntrWillReturn]>;
  17. def int_aarch64_stxr : Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_anyptr_ty],
  18. [IntrNoFree, IntrWillReturn]>;
  19. def int_aarch64_stlxr : Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_anyptr_ty],
  20. [IntrNoFree, IntrWillReturn]>;
  21. def int_aarch64_ldxp : Intrinsic<[llvm_i64_ty, llvm_i64_ty], [llvm_ptr_ty],
  22. [IntrNoFree, IntrWillReturn]>;
  23. def int_aarch64_ldaxp : Intrinsic<[llvm_i64_ty, llvm_i64_ty], [llvm_ptr_ty],
  24. [IntrNoFree, IntrWillReturn]>;
  25. def int_aarch64_stxp : Intrinsic<[llvm_i32_ty],
  26. [llvm_i64_ty, llvm_i64_ty, llvm_ptr_ty],
  27. [IntrNoFree, IntrWillReturn]>;
  28. def int_aarch64_stlxp : Intrinsic<[llvm_i32_ty],
  29. [llvm_i64_ty, llvm_i64_ty, llvm_ptr_ty],
  30. [IntrNoFree, IntrWillReturn]>;
  31. def int_aarch64_clrex : Intrinsic<[]>;
  32. def int_aarch64_sdiv : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>,
  33. LLVMMatchType<0>], [IntrNoMem]>;
  34. def int_aarch64_udiv : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>,
  35. LLVMMatchType<0>], [IntrNoMem]>;
  36. def int_aarch64_fjcvtzs : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
  37. def int_aarch64_cls: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
  38. def int_aarch64_cls64: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem]>;
  39. def int_aarch64_frint32z
  40. : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ], [ LLVMMatchType<0> ],
  41. [ IntrNoMem ]>;
  42. def int_aarch64_frint64z
  43. : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ], [ LLVMMatchType<0> ],
  44. [ IntrNoMem ]>;
  45. def int_aarch64_frint32x
  46. : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ], [ LLVMMatchType<0> ],
  47. [ IntrNoMem ]>;
  48. def int_aarch64_frint64x
  49. : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ], [ LLVMMatchType<0> ],
  50. [ IntrNoMem ]>;
  51. //===----------------------------------------------------------------------===//
  52. // HINT
  53. def int_aarch64_hint : DefaultAttrsIntrinsic<[], [llvm_i32_ty]>;
  54. def int_aarch64_break : Intrinsic<[], [llvm_i32_ty],
  55. [IntrNoMem, IntrHasSideEffects, IntrNoReturn, IntrCold, ImmArg<ArgIndex<0>>]>;
  56. def int_aarch64_prefetch : Intrinsic<[],
  57. [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
  58. [IntrInaccessibleMemOrArgMemOnly, IntrWillReturn, ReadOnly<ArgIndex<0>>,
  59. ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>
  60. ]>,
  61. ClangBuiltin<"__builtin_arm_prefetch">;
  62. //===----------------------------------------------------------------------===//
  63. // Data Barrier Instructions
  64. def int_aarch64_dmb : ClangBuiltin<"__builtin_arm_dmb">, MSBuiltin<"__dmb">,
  65. Intrinsic<[], [llvm_i32_ty], [IntrNoFree, IntrWillReturn]>;
  66. def int_aarch64_dsb : ClangBuiltin<"__builtin_arm_dsb">, MSBuiltin<"__dsb">,
  67. Intrinsic<[], [llvm_i32_ty], [IntrNoFree, IntrWillReturn]>;
  68. def int_aarch64_isb : ClangBuiltin<"__builtin_arm_isb">, MSBuiltin<"__isb">,
  69. Intrinsic<[], [llvm_i32_ty], [IntrNoFree, IntrWillReturn]>;
  70. // A space-consuming intrinsic primarily for testing block and jump table
  71. // placements. The first argument is the number of bytes this "instruction"
  72. // takes up, the second and return value are essentially chains, used to force
  73. // ordering during ISel.
  74. def int_aarch64_space : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_i64_ty], []>;
  75. }
  76. //===----------------------------------------------------------------------===//
  77. // Advanced SIMD (NEON)
  78. let TargetPrefix = "aarch64" in { // All intrinsics start with "llvm.aarch64.".
  79. class AdvSIMD_2Scalar_Float_Intrinsic
  80. : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
  81. [IntrNoMem]>;
  82. class AdvSIMD_FPToIntRounding_Intrinsic
  83. : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty], [IntrNoMem]>;
  84. class AdvSIMD_1IntArg_Intrinsic
  85. : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>], [IntrNoMem]>;
  86. class AdvSIMD_1FloatArg_Intrinsic
  87. : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>], [IntrNoMem]>;
  88. class AdvSIMD_1VectorArg_Intrinsic
  89. : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>], [IntrNoMem]>;
  90. class AdvSIMD_1VectorArg_Expand_Intrinsic
  91. : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_anyvector_ty], [IntrNoMem]>;
  92. class AdvSIMD_1VectorArg_Long_Intrinsic
  93. : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMTruncatedType<0>], [IntrNoMem]>;
  94. class AdvSIMD_1IntArg_Narrow_Intrinsic
  95. : DefaultAttrsIntrinsic<[llvm_any_ty], [llvm_any_ty], [IntrNoMem]>;
  96. class AdvSIMD_1VectorArg_Narrow_Intrinsic
  97. : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMExtendedType<0>], [IntrNoMem]>;
  98. class AdvSIMD_1VectorArg_Int_Across_Intrinsic
  99. : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyvector_ty], [IntrNoMem]>;
  100. class AdvSIMD_1VectorArg_Float_Across_Intrinsic
  101. : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyvector_ty], [IntrNoMem]>;
  102. class AdvSIMD_2IntArg_Intrinsic
  103. : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
  104. [IntrNoMem]>;
  105. class AdvSIMD_2FloatArg_Intrinsic
  106. : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
  107. [IntrNoMem]>;
  108. class AdvSIMD_2VectorArg_Intrinsic
  109. : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
  110. [IntrNoMem]>;
  111. class AdvSIMD_2VectorArg_Compare_Intrinsic
  112. : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_anyvector_ty, LLVMMatchType<1>],
  113. [IntrNoMem]>;
  114. class AdvSIMD_2Arg_FloatCompare_Intrinsic
  115. : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty, LLVMMatchType<1>],
  116. [IntrNoMem]>;
  117. class AdvSIMD_2VectorArg_Long_Intrinsic
  118. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  119. [LLVMTruncatedType<0>, LLVMTruncatedType<0>],
  120. [IntrNoMem]>;
  121. class AdvSIMD_2VectorArg_Wide_Intrinsic
  122. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  123. [LLVMMatchType<0>, LLVMTruncatedType<0>],
  124. [IntrNoMem]>;
  125. class AdvSIMD_2VectorArg_Narrow_Intrinsic
  126. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  127. [LLVMExtendedType<0>, LLVMExtendedType<0>],
  128. [IntrNoMem]>;
  129. class AdvSIMD_2Arg_Scalar_Narrow_Intrinsic
  130. : DefaultAttrsIntrinsic<[llvm_anyint_ty],
  131. [LLVMExtendedType<0>, llvm_i32_ty],
  132. [IntrNoMem]>;
  133. class AdvSIMD_2VectorArg_Scalar_Expand_BySize_Intrinsic
  134. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  135. [llvm_anyvector_ty],
  136. [IntrNoMem]>;
  137. class AdvSIMD_2VectorArg_Scalar_Wide_BySize_Intrinsic
  138. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  139. [LLVMTruncatedType<0>],
  140. [IntrNoMem]>;
  141. class AdvSIMD_2VectorArg_Scalar_Wide_Intrinsic
  142. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  143. [LLVMTruncatedType<0>, llvm_i32_ty],
  144. [IntrNoMem]>;
  145. class AdvSIMD_2VectorArg_Tied_Narrow_Intrinsic
  146. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  147. [LLVMHalfElementsVectorType<0>, llvm_anyvector_ty],
  148. [IntrNoMem]>;
  149. class AdvSIMD_2VectorArg_Lane_Intrinsic
  150. : DefaultAttrsIntrinsic<[llvm_anyint_ty],
  151. [LLVMMatchType<0>, llvm_anyint_ty, llvm_i32_ty],
  152. [IntrNoMem]>;
  153. class AdvSIMD_3IntArg_Intrinsic
  154. : DefaultAttrsIntrinsic<[llvm_anyint_ty],
  155. [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
  156. [IntrNoMem]>;
  157. class AdvSIMD_3VectorArg_Intrinsic
  158. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  159. [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
  160. [IntrNoMem]>;
  161. class AdvSIMD_3VectorArg_Scalar_Intrinsic
  162. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  163. [LLVMMatchType<0>, LLVMMatchType<0>, llvm_i32_ty],
  164. [IntrNoMem]>;
  165. class AdvSIMD_3VectorArg_Tied_Narrow_Intrinsic
  166. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  167. [LLVMHalfElementsVectorType<0>, llvm_anyvector_ty,
  168. LLVMMatchType<1>], [IntrNoMem]>;
  169. class AdvSIMD_3VectorArg_Scalar_Tied_Narrow_Intrinsic
  170. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  171. [LLVMHalfElementsVectorType<0>, llvm_anyvector_ty, llvm_i32_ty],
  172. [IntrNoMem]>;
  173. class AdvSIMD_CvtFxToFP_Intrinsic
  174. : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty, llvm_i32_ty],
  175. [IntrNoMem]>;
  176. class AdvSIMD_CvtFPToFx_Intrinsic
  177. : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty, llvm_i32_ty],
  178. [IntrNoMem]>;
  179. class AdvSIMD_1Arg_Intrinsic
  180. : DefaultAttrsIntrinsic<[llvm_any_ty], [LLVMMatchType<0>], [IntrNoMem]>;
  181. class AdvSIMD_Dot_Intrinsic
  182. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  183. [LLVMMatchType<0>, llvm_anyvector_ty, LLVMMatchType<1>],
  184. [IntrNoMem]>;
  185. class AdvSIMD_FP16FML_Intrinsic
  186. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  187. [LLVMMatchType<0>, llvm_anyvector_ty, LLVMMatchType<1>],
  188. [IntrNoMem]>;
  189. class AdvSIMD_MatMul_Intrinsic
  190. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  191. [LLVMMatchType<0>, llvm_anyvector_ty, LLVMMatchType<1>],
  192. [IntrNoMem]>;
  193. class AdvSIMD_FML_Intrinsic
  194. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  195. [LLVMMatchType<0>, llvm_anyvector_ty, LLVMMatchType<1>],
  196. [IntrNoMem]>;
  197. class AdvSIMD_BF16FML_Intrinsic
  198. : DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  199. [llvm_v4f32_ty, llvm_v8bf16_ty, llvm_v8bf16_ty],
  200. [IntrNoMem]>;
  201. }
  202. // Arithmetic ops
  203. let TargetPrefix = "aarch64", IntrProperties = [IntrNoMem] in {
  204. // Vector Add Across Lanes
  205. def int_aarch64_neon_saddv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
  206. def int_aarch64_neon_uaddv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
  207. def int_aarch64_neon_faddv : AdvSIMD_1VectorArg_Float_Across_Intrinsic;
  208. // Vector Long Add Across Lanes
  209. def int_aarch64_neon_saddlv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
  210. def int_aarch64_neon_uaddlv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
  211. // Vector Halving Add
  212. def int_aarch64_neon_shadd : AdvSIMD_2VectorArg_Intrinsic;
  213. def int_aarch64_neon_uhadd : AdvSIMD_2VectorArg_Intrinsic;
  214. // Vector Rounding Halving Add
  215. def int_aarch64_neon_srhadd : AdvSIMD_2VectorArg_Intrinsic;
  216. def int_aarch64_neon_urhadd : AdvSIMD_2VectorArg_Intrinsic;
  217. // Vector Saturating Add
  218. def int_aarch64_neon_sqadd : AdvSIMD_2IntArg_Intrinsic;
  219. def int_aarch64_neon_suqadd : AdvSIMD_2IntArg_Intrinsic;
  220. def int_aarch64_neon_usqadd : AdvSIMD_2IntArg_Intrinsic;
  221. def int_aarch64_neon_uqadd : AdvSIMD_2IntArg_Intrinsic;
  222. // Vector Add High-Half
  223. // FIXME: this is a legacy intrinsic for aarch64_simd.h. Remove it when that
  224. // header is no longer supported.
  225. def int_aarch64_neon_addhn : AdvSIMD_2VectorArg_Narrow_Intrinsic;
  226. // Vector Rounding Add High-Half
  227. def int_aarch64_neon_raddhn : AdvSIMD_2VectorArg_Narrow_Intrinsic;
  228. // Vector Saturating Doubling Multiply High
  229. def int_aarch64_neon_sqdmulh : AdvSIMD_2IntArg_Intrinsic;
  230. def int_aarch64_neon_sqdmulh_lane : AdvSIMD_2VectorArg_Lane_Intrinsic;
  231. def int_aarch64_neon_sqdmulh_laneq : AdvSIMD_2VectorArg_Lane_Intrinsic;
  232. // Vector Saturating Rounding Doubling Multiply High
  233. def int_aarch64_neon_sqrdmulh : AdvSIMD_2IntArg_Intrinsic;
  234. def int_aarch64_neon_sqrdmulh_lane : AdvSIMD_2VectorArg_Lane_Intrinsic;
  235. def int_aarch64_neon_sqrdmulh_laneq : AdvSIMD_2VectorArg_Lane_Intrinsic;
  236. def int_aarch64_neon_sqrdmlah : AdvSIMD_3IntArg_Intrinsic;
  237. def int_aarch64_neon_sqrdmlsh : AdvSIMD_3IntArg_Intrinsic;
  238. // Vector Polynominal Multiply
  239. def int_aarch64_neon_pmul : AdvSIMD_2VectorArg_Intrinsic;
  240. // Vector Long Multiply
  241. def int_aarch64_neon_smull : AdvSIMD_2VectorArg_Long_Intrinsic;
  242. def int_aarch64_neon_umull : AdvSIMD_2VectorArg_Long_Intrinsic;
  243. def int_aarch64_neon_pmull : AdvSIMD_2VectorArg_Long_Intrinsic;
  244. // 64-bit polynomial multiply really returns an i128, which is not legal. Fake
  245. // it with a v16i8.
  246. def int_aarch64_neon_pmull64 :
  247. DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
  248. // Vector Extending Multiply
  249. def int_aarch64_neon_fmulx : AdvSIMD_2FloatArg_Intrinsic {
  250. let IntrProperties = [IntrNoMem, Commutative];
  251. }
  252. // Vector Saturating Doubling Long Multiply
  253. def int_aarch64_neon_sqdmull : AdvSIMD_2VectorArg_Long_Intrinsic;
  254. def int_aarch64_neon_sqdmulls_scalar
  255. : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
  256. // Vector Halving Subtract
  257. def int_aarch64_neon_shsub : AdvSIMD_2VectorArg_Intrinsic;
  258. def int_aarch64_neon_uhsub : AdvSIMD_2VectorArg_Intrinsic;
  259. // Vector Saturating Subtract
  260. def int_aarch64_neon_sqsub : AdvSIMD_2IntArg_Intrinsic;
  261. def int_aarch64_neon_uqsub : AdvSIMD_2IntArg_Intrinsic;
  262. // Vector Subtract High-Half
  263. // FIXME: this is a legacy intrinsic for aarch64_simd.h. Remove it when that
  264. // header is no longer supported.
  265. def int_aarch64_neon_subhn : AdvSIMD_2VectorArg_Narrow_Intrinsic;
  266. // Vector Rounding Subtract High-Half
  267. def int_aarch64_neon_rsubhn : AdvSIMD_2VectorArg_Narrow_Intrinsic;
  268. // Vector Compare Absolute Greater-than-or-equal
  269. def int_aarch64_neon_facge : AdvSIMD_2Arg_FloatCompare_Intrinsic;
  270. // Vector Compare Absolute Greater-than
  271. def int_aarch64_neon_facgt : AdvSIMD_2Arg_FloatCompare_Intrinsic;
  272. // Vector Absolute Difference
  273. def int_aarch64_neon_sabd : AdvSIMD_2VectorArg_Intrinsic;
  274. def int_aarch64_neon_uabd : AdvSIMD_2VectorArg_Intrinsic;
  275. def int_aarch64_neon_fabd : AdvSIMD_2VectorArg_Intrinsic;
  276. // Scalar Absolute Difference
  277. def int_aarch64_sisd_fabd : AdvSIMD_2Scalar_Float_Intrinsic;
  278. // Vector Max
  279. def int_aarch64_neon_smax : AdvSIMD_2VectorArg_Intrinsic;
  280. def int_aarch64_neon_umax : AdvSIMD_2VectorArg_Intrinsic;
  281. def int_aarch64_neon_fmax : AdvSIMD_2FloatArg_Intrinsic;
  282. def int_aarch64_neon_fmaxnmp : AdvSIMD_2VectorArg_Intrinsic;
  283. // Vector Max Across Lanes
  284. def int_aarch64_neon_smaxv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
  285. def int_aarch64_neon_umaxv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
  286. def int_aarch64_neon_fmaxv : AdvSIMD_1VectorArg_Float_Across_Intrinsic;
  287. def int_aarch64_neon_fmaxnmv : AdvSIMD_1VectorArg_Float_Across_Intrinsic;
  288. // Vector Min
  289. def int_aarch64_neon_smin : AdvSIMD_2VectorArg_Intrinsic;
  290. def int_aarch64_neon_umin : AdvSIMD_2VectorArg_Intrinsic;
  291. def int_aarch64_neon_fmin : AdvSIMD_2FloatArg_Intrinsic;
  292. def int_aarch64_neon_fminnmp : AdvSIMD_2VectorArg_Intrinsic;
  293. // Vector Min/Max Number
  294. def int_aarch64_neon_fminnm : AdvSIMD_2FloatArg_Intrinsic;
  295. def int_aarch64_neon_fmaxnm : AdvSIMD_2FloatArg_Intrinsic;
  296. // Vector Min Across Lanes
  297. def int_aarch64_neon_sminv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
  298. def int_aarch64_neon_uminv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
  299. def int_aarch64_neon_fminv : AdvSIMD_1VectorArg_Float_Across_Intrinsic;
  300. def int_aarch64_neon_fminnmv : AdvSIMD_1VectorArg_Float_Across_Intrinsic;
  301. // Pairwise Add
  302. def int_aarch64_neon_addp : AdvSIMD_2VectorArg_Intrinsic;
  303. def int_aarch64_neon_faddp : AdvSIMD_2VectorArg_Intrinsic;
  304. // Long Pairwise Add
  305. // FIXME: In theory, we shouldn't need intrinsics for saddlp or
  306. // uaddlp, but tblgen's type inference currently can't handle the
  307. // pattern fragments this ends up generating.
  308. def int_aarch64_neon_saddlp : AdvSIMD_1VectorArg_Expand_Intrinsic;
  309. def int_aarch64_neon_uaddlp : AdvSIMD_1VectorArg_Expand_Intrinsic;
  310. // Folding Maximum
  311. def int_aarch64_neon_smaxp : AdvSIMD_2VectorArg_Intrinsic;
  312. def int_aarch64_neon_umaxp : AdvSIMD_2VectorArg_Intrinsic;
  313. def int_aarch64_neon_fmaxp : AdvSIMD_2VectorArg_Intrinsic;
  314. // Folding Minimum
  315. def int_aarch64_neon_sminp : AdvSIMD_2VectorArg_Intrinsic;
  316. def int_aarch64_neon_uminp : AdvSIMD_2VectorArg_Intrinsic;
  317. def int_aarch64_neon_fminp : AdvSIMD_2VectorArg_Intrinsic;
  318. // Reciprocal Estimate/Step
  319. def int_aarch64_neon_frecps : AdvSIMD_2FloatArg_Intrinsic;
  320. def int_aarch64_neon_frsqrts : AdvSIMD_2FloatArg_Intrinsic;
  321. // Reciprocal Exponent
  322. def int_aarch64_neon_frecpx : AdvSIMD_1FloatArg_Intrinsic;
  323. // Vector Saturating Shift Left
  324. def int_aarch64_neon_sqshl : AdvSIMD_2IntArg_Intrinsic;
  325. def int_aarch64_neon_uqshl : AdvSIMD_2IntArg_Intrinsic;
  326. // Vector Rounding Shift Left
  327. def int_aarch64_neon_srshl : AdvSIMD_2IntArg_Intrinsic;
  328. def int_aarch64_neon_urshl : AdvSIMD_2IntArg_Intrinsic;
  329. // Vector Saturating Rounding Shift Left
  330. def int_aarch64_neon_sqrshl : AdvSIMD_2IntArg_Intrinsic;
  331. def int_aarch64_neon_uqrshl : AdvSIMD_2IntArg_Intrinsic;
  332. // Vector Signed->Unsigned Shift Left by Constant
  333. def int_aarch64_neon_sqshlu : AdvSIMD_2IntArg_Intrinsic;
  334. // Vector Signed->Unsigned Narrowing Saturating Shift Right by Constant
  335. def int_aarch64_neon_sqshrun : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
  336. // Vector Signed->Unsigned Rounding Narrowing Saturating Shift Right by Const
  337. def int_aarch64_neon_sqrshrun : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
  338. // Vector Narrowing Shift Right by Constant
  339. def int_aarch64_neon_sqshrn : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
  340. def int_aarch64_neon_uqshrn : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
  341. // Vector Rounding Narrowing Shift Right by Constant
  342. def int_aarch64_neon_rshrn : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
  343. // Vector Rounding Narrowing Saturating Shift Right by Constant
  344. def int_aarch64_neon_sqrshrn : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
  345. def int_aarch64_neon_uqrshrn : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
  346. // Vector Shift Left
  347. def int_aarch64_neon_sshl : AdvSIMD_2IntArg_Intrinsic;
  348. def int_aarch64_neon_ushl : AdvSIMD_2IntArg_Intrinsic;
  349. // Vector Widening Shift Left by Constant
  350. def int_aarch64_neon_shll : AdvSIMD_2VectorArg_Scalar_Wide_BySize_Intrinsic;
  351. def int_aarch64_neon_sshll : AdvSIMD_2VectorArg_Scalar_Wide_Intrinsic;
  352. def int_aarch64_neon_ushll : AdvSIMD_2VectorArg_Scalar_Wide_Intrinsic;
  353. // Vector Shift Right by Constant and Insert
  354. def int_aarch64_neon_vsri : AdvSIMD_3VectorArg_Scalar_Intrinsic;
  355. // Vector Shift Left by Constant and Insert
  356. def int_aarch64_neon_vsli : AdvSIMD_3VectorArg_Scalar_Intrinsic;
  357. // Vector Saturating Narrow
  358. def int_aarch64_neon_scalar_sqxtn: AdvSIMD_1IntArg_Narrow_Intrinsic;
  359. def int_aarch64_neon_scalar_uqxtn : AdvSIMD_1IntArg_Narrow_Intrinsic;
  360. def int_aarch64_neon_sqxtn : AdvSIMD_1VectorArg_Narrow_Intrinsic;
  361. def int_aarch64_neon_uqxtn : AdvSIMD_1VectorArg_Narrow_Intrinsic;
  362. // Vector Saturating Extract and Unsigned Narrow
  363. def int_aarch64_neon_scalar_sqxtun : AdvSIMD_1IntArg_Narrow_Intrinsic;
  364. def int_aarch64_neon_sqxtun : AdvSIMD_1VectorArg_Narrow_Intrinsic;
  365. // Vector Absolute Value
  366. def int_aarch64_neon_abs : AdvSIMD_1Arg_Intrinsic;
  367. // Vector Saturating Absolute Value
  368. def int_aarch64_neon_sqabs : AdvSIMD_1IntArg_Intrinsic;
  369. // Vector Saturating Negation
  370. def int_aarch64_neon_sqneg : AdvSIMD_1IntArg_Intrinsic;
  371. // Vector Count Leading Sign Bits
  372. def int_aarch64_neon_cls : AdvSIMD_1VectorArg_Intrinsic;
  373. // Vector Reciprocal Estimate
  374. def int_aarch64_neon_urecpe : AdvSIMD_1VectorArg_Intrinsic;
  375. def int_aarch64_neon_frecpe : AdvSIMD_1FloatArg_Intrinsic;
  376. // Vector Square Root Estimate
  377. def int_aarch64_neon_ursqrte : AdvSIMD_1VectorArg_Intrinsic;
  378. def int_aarch64_neon_frsqrte : AdvSIMD_1FloatArg_Intrinsic;
  379. // Vector Conversions Between Half-Precision and Single-Precision.
  380. def int_aarch64_neon_vcvtfp2hf
  381. : DefaultAttrsIntrinsic<[llvm_v4i16_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  382. def int_aarch64_neon_vcvthf2fp
  383. : DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4i16_ty], [IntrNoMem]>;
  384. // Vector Conversions Between Floating-point and Fixed-point.
  385. def int_aarch64_neon_vcvtfp2fxs : AdvSIMD_CvtFPToFx_Intrinsic;
  386. def int_aarch64_neon_vcvtfp2fxu : AdvSIMD_CvtFPToFx_Intrinsic;
  387. def int_aarch64_neon_vcvtfxs2fp : AdvSIMD_CvtFxToFP_Intrinsic;
  388. def int_aarch64_neon_vcvtfxu2fp : AdvSIMD_CvtFxToFP_Intrinsic;
  389. // Vector FP->Int Conversions
  390. def int_aarch64_neon_fcvtas : AdvSIMD_FPToIntRounding_Intrinsic;
  391. def int_aarch64_neon_fcvtau : AdvSIMD_FPToIntRounding_Intrinsic;
  392. def int_aarch64_neon_fcvtms : AdvSIMD_FPToIntRounding_Intrinsic;
  393. def int_aarch64_neon_fcvtmu : AdvSIMD_FPToIntRounding_Intrinsic;
  394. def int_aarch64_neon_fcvtns : AdvSIMD_FPToIntRounding_Intrinsic;
  395. def int_aarch64_neon_fcvtnu : AdvSIMD_FPToIntRounding_Intrinsic;
  396. def int_aarch64_neon_fcvtps : AdvSIMD_FPToIntRounding_Intrinsic;
  397. def int_aarch64_neon_fcvtpu : AdvSIMD_FPToIntRounding_Intrinsic;
  398. def int_aarch64_neon_fcvtzs : AdvSIMD_FPToIntRounding_Intrinsic;
  399. def int_aarch64_neon_fcvtzu : AdvSIMD_FPToIntRounding_Intrinsic;
  400. // v8.5-A Vector FP Rounding
  401. def int_aarch64_neon_frint32x : AdvSIMD_1FloatArg_Intrinsic;
  402. def int_aarch64_neon_frint32z : AdvSIMD_1FloatArg_Intrinsic;
  403. def int_aarch64_neon_frint64x : AdvSIMD_1FloatArg_Intrinsic;
  404. def int_aarch64_neon_frint64z : AdvSIMD_1FloatArg_Intrinsic;
  405. // Scalar FP->Int conversions
  406. // Vector FP Inexact Narrowing
  407. def int_aarch64_neon_fcvtxn : AdvSIMD_1VectorArg_Expand_Intrinsic;
  408. // Scalar FP Inexact Narrowing
  409. def int_aarch64_sisd_fcvtxn : DefaultAttrsIntrinsic<[llvm_float_ty], [llvm_double_ty],
  410. [IntrNoMem]>;
  411. // v8.2-A Dot Product
  412. def int_aarch64_neon_udot : AdvSIMD_Dot_Intrinsic;
  413. def int_aarch64_neon_sdot : AdvSIMD_Dot_Intrinsic;
  414. // v8.6-A Matrix Multiply Intrinsics
  415. def int_aarch64_neon_ummla : AdvSIMD_MatMul_Intrinsic;
  416. def int_aarch64_neon_smmla : AdvSIMD_MatMul_Intrinsic;
  417. def int_aarch64_neon_usmmla : AdvSIMD_MatMul_Intrinsic;
  418. def int_aarch64_neon_usdot : AdvSIMD_Dot_Intrinsic;
  419. def int_aarch64_neon_bfdot : AdvSIMD_Dot_Intrinsic;
  420. def int_aarch64_neon_bfmmla
  421. : DefaultAttrsIntrinsic<[llvm_v4f32_ty],
  422. [llvm_v4f32_ty, llvm_v8bf16_ty, llvm_v8bf16_ty],
  423. [IntrNoMem]>;
  424. def int_aarch64_neon_bfmlalb : AdvSIMD_BF16FML_Intrinsic;
  425. def int_aarch64_neon_bfmlalt : AdvSIMD_BF16FML_Intrinsic;
  426. // v8.6-A Bfloat Intrinsics
  427. def int_aarch64_neon_bfcvt
  428. : DefaultAttrsIntrinsic<[llvm_bfloat_ty], [llvm_float_ty], [IntrNoMem]>;
  429. def int_aarch64_neon_bfcvtn
  430. : DefaultAttrsIntrinsic<[llvm_v8bf16_ty], [llvm_v4f32_ty], [IntrNoMem]>;
  431. def int_aarch64_neon_bfcvtn2
  432. : DefaultAttrsIntrinsic<[llvm_v8bf16_ty],
  433. [llvm_v8bf16_ty, llvm_v4f32_ty],
  434. [IntrNoMem]>;
  435. // v8.2-A FP16 Fused Multiply-Add Long
  436. def int_aarch64_neon_fmlal : AdvSIMD_FP16FML_Intrinsic;
  437. def int_aarch64_neon_fmlsl : AdvSIMD_FP16FML_Intrinsic;
  438. def int_aarch64_neon_fmlal2 : AdvSIMD_FP16FML_Intrinsic;
  439. def int_aarch64_neon_fmlsl2 : AdvSIMD_FP16FML_Intrinsic;
  440. // v8.3-A Floating-point complex add
  441. def int_aarch64_neon_vcadd_rot90 : AdvSIMD_2VectorArg_Intrinsic;
  442. def int_aarch64_neon_vcadd_rot270 : AdvSIMD_2VectorArg_Intrinsic;
  443. def int_aarch64_neon_vcmla_rot0 : AdvSIMD_3VectorArg_Intrinsic;
  444. def int_aarch64_neon_vcmla_rot90 : AdvSIMD_3VectorArg_Intrinsic;
  445. def int_aarch64_neon_vcmla_rot180 : AdvSIMD_3VectorArg_Intrinsic;
  446. def int_aarch64_neon_vcmla_rot270 : AdvSIMD_3VectorArg_Intrinsic;
  447. }
  448. let TargetPrefix = "aarch64" in { // All intrinsics start with "llvm.aarch64.".
  449. class AdvSIMD_2Vector2Index_Intrinsic
  450. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  451. [llvm_anyvector_ty, llvm_i64_ty, LLVMMatchType<0>, llvm_i64_ty],
  452. [IntrNoMem]>;
  453. }
  454. // Vector element to element moves
  455. def int_aarch64_neon_vcopy_lane: AdvSIMD_2Vector2Index_Intrinsic;
  456. let TargetPrefix = "aarch64" in { // All intrinsics start with "llvm.aarch64.".
  457. class AdvSIMD_1Vec_Load_Intrinsic
  458. : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMAnyPointerType<LLVMMatchType<0>>],
  459. [IntrReadMem, IntrArgMemOnly]>;
  460. class AdvSIMD_1Vec_Store_Lane_Intrinsic
  461. : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, llvm_i64_ty, llvm_anyptr_ty],
  462. [IntrArgMemOnly, NoCapture<ArgIndex<2>>]>;
  463. class AdvSIMD_2Vec_Load_Intrinsic
  464. : DefaultAttrsIntrinsic<[LLVMMatchType<0>, llvm_anyvector_ty],
  465. [LLVMAnyPointerType<LLVMMatchType<0>>],
  466. [IntrReadMem, IntrArgMemOnly]>;
  467. class AdvSIMD_2Vec_Load_Lane_Intrinsic
  468. : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>],
  469. [LLVMMatchType<0>, llvm_anyvector_ty,
  470. llvm_i64_ty, llvm_anyptr_ty],
  471. [IntrReadMem, IntrArgMemOnly]>;
  472. class AdvSIMD_2Vec_Store_Intrinsic
  473. : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>,
  474. LLVMAnyPointerType<LLVMMatchType<0>>],
  475. [IntrArgMemOnly, NoCapture<ArgIndex<2>>]>;
  476. class AdvSIMD_2Vec_Store_Lane_Intrinsic
  477. : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>,
  478. llvm_i64_ty, llvm_anyptr_ty],
  479. [IntrArgMemOnly, NoCapture<ArgIndex<3>>]>;
  480. class AdvSIMD_3Vec_Load_Intrinsic
  481. : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>, llvm_anyvector_ty],
  482. [LLVMAnyPointerType<LLVMMatchType<0>>],
  483. [IntrReadMem, IntrArgMemOnly]>;
  484. class AdvSIMD_3Vec_Load_Lane_Intrinsic
  485. : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
  486. [LLVMMatchType<0>, LLVMMatchType<0>, llvm_anyvector_ty,
  487. llvm_i64_ty, llvm_anyptr_ty],
  488. [IntrReadMem, IntrArgMemOnly]>;
  489. class AdvSIMD_3Vec_Store_Intrinsic
  490. : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>,
  491. LLVMMatchType<0>, LLVMAnyPointerType<LLVMMatchType<0>>],
  492. [IntrArgMemOnly, NoCapture<ArgIndex<3>>]>;
  493. class AdvSIMD_3Vec_Store_Lane_Intrinsic
  494. : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty,
  495. LLVMMatchType<0>, LLVMMatchType<0>,
  496. llvm_i64_ty, llvm_anyptr_ty],
  497. [IntrArgMemOnly, NoCapture<ArgIndex<4>>]>;
  498. class AdvSIMD_4Vec_Load_Intrinsic
  499. : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>,
  500. LLVMMatchType<0>, llvm_anyvector_ty],
  501. [LLVMAnyPointerType<LLVMMatchType<0>>],
  502. [IntrReadMem, IntrArgMemOnly]>;
  503. class AdvSIMD_4Vec_Load_Lane_Intrinsic
  504. : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>,
  505. LLVMMatchType<0>, LLVMMatchType<0>],
  506. [LLVMMatchType<0>, LLVMMatchType<0>,
  507. LLVMMatchType<0>, llvm_anyvector_ty,
  508. llvm_i64_ty, llvm_anyptr_ty],
  509. [IntrReadMem, IntrArgMemOnly]>;
  510. class AdvSIMD_4Vec_Store_Intrinsic
  511. : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>,
  512. LLVMMatchType<0>, LLVMMatchType<0>,
  513. LLVMAnyPointerType<LLVMMatchType<0>>],
  514. [IntrArgMemOnly, NoCapture<ArgIndex<4>>]>;
  515. class AdvSIMD_4Vec_Store_Lane_Intrinsic
  516. : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>,
  517. LLVMMatchType<0>, LLVMMatchType<0>,
  518. llvm_i64_ty, llvm_anyptr_ty],
  519. [IntrArgMemOnly, NoCapture<ArgIndex<5>>]>;
  520. }
  521. // Memory ops
  522. def int_aarch64_neon_ld1x2 : AdvSIMD_2Vec_Load_Intrinsic;
  523. def int_aarch64_neon_ld1x3 : AdvSIMD_3Vec_Load_Intrinsic;
  524. def int_aarch64_neon_ld1x4 : AdvSIMD_4Vec_Load_Intrinsic;
  525. def int_aarch64_neon_st1x2 : AdvSIMD_2Vec_Store_Intrinsic;
  526. def int_aarch64_neon_st1x3 : AdvSIMD_3Vec_Store_Intrinsic;
  527. def int_aarch64_neon_st1x4 : AdvSIMD_4Vec_Store_Intrinsic;
  528. def int_aarch64_neon_ld2 : AdvSIMD_2Vec_Load_Intrinsic;
  529. def int_aarch64_neon_ld3 : AdvSIMD_3Vec_Load_Intrinsic;
  530. def int_aarch64_neon_ld4 : AdvSIMD_4Vec_Load_Intrinsic;
  531. def int_aarch64_neon_ld2lane : AdvSIMD_2Vec_Load_Lane_Intrinsic;
  532. def int_aarch64_neon_ld3lane : AdvSIMD_3Vec_Load_Lane_Intrinsic;
  533. def int_aarch64_neon_ld4lane : AdvSIMD_4Vec_Load_Lane_Intrinsic;
  534. def int_aarch64_neon_ld2r : AdvSIMD_2Vec_Load_Intrinsic;
  535. def int_aarch64_neon_ld3r : AdvSIMD_3Vec_Load_Intrinsic;
  536. def int_aarch64_neon_ld4r : AdvSIMD_4Vec_Load_Intrinsic;
  537. def int_aarch64_neon_st2 : AdvSIMD_2Vec_Store_Intrinsic;
  538. def int_aarch64_neon_st3 : AdvSIMD_3Vec_Store_Intrinsic;
  539. def int_aarch64_neon_st4 : AdvSIMD_4Vec_Store_Intrinsic;
  540. def int_aarch64_neon_st2lane : AdvSIMD_2Vec_Store_Lane_Intrinsic;
  541. def int_aarch64_neon_st3lane : AdvSIMD_3Vec_Store_Lane_Intrinsic;
  542. def int_aarch64_neon_st4lane : AdvSIMD_4Vec_Store_Lane_Intrinsic;
  543. let TargetPrefix = "aarch64" in { // All intrinsics start with "llvm.aarch64.".
  544. class AdvSIMD_Tbl1_Intrinsic
  545. : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_v16i8_ty, LLVMMatchType<0>],
  546. [IntrNoMem]>;
  547. class AdvSIMD_Tbl2_Intrinsic
  548. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  549. [llvm_v16i8_ty, llvm_v16i8_ty, LLVMMatchType<0>], [IntrNoMem]>;
  550. class AdvSIMD_Tbl3_Intrinsic
  551. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  552. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty,
  553. LLVMMatchType<0>],
  554. [IntrNoMem]>;
  555. class AdvSIMD_Tbl4_Intrinsic
  556. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  557. [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty,
  558. LLVMMatchType<0>],
  559. [IntrNoMem]>;
  560. class AdvSIMD_Tbx1_Intrinsic
  561. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  562. [LLVMMatchType<0>, llvm_v16i8_ty, LLVMMatchType<0>],
  563. [IntrNoMem]>;
  564. class AdvSIMD_Tbx2_Intrinsic
  565. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  566. [LLVMMatchType<0>, llvm_v16i8_ty, llvm_v16i8_ty,
  567. LLVMMatchType<0>],
  568. [IntrNoMem]>;
  569. class AdvSIMD_Tbx3_Intrinsic
  570. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  571. [LLVMMatchType<0>, llvm_v16i8_ty, llvm_v16i8_ty,
  572. llvm_v16i8_ty, LLVMMatchType<0>],
  573. [IntrNoMem]>;
  574. class AdvSIMD_Tbx4_Intrinsic
  575. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  576. [LLVMMatchType<0>, llvm_v16i8_ty, llvm_v16i8_ty,
  577. llvm_v16i8_ty, llvm_v16i8_ty, LLVMMatchType<0>],
  578. [IntrNoMem]>;
  579. }
  580. def int_aarch64_neon_tbl1 : AdvSIMD_Tbl1_Intrinsic;
  581. def int_aarch64_neon_tbl2 : AdvSIMD_Tbl2_Intrinsic;
  582. def int_aarch64_neon_tbl3 : AdvSIMD_Tbl3_Intrinsic;
  583. def int_aarch64_neon_tbl4 : AdvSIMD_Tbl4_Intrinsic;
  584. def int_aarch64_neon_tbx1 : AdvSIMD_Tbx1_Intrinsic;
  585. def int_aarch64_neon_tbx2 : AdvSIMD_Tbx2_Intrinsic;
  586. def int_aarch64_neon_tbx3 : AdvSIMD_Tbx3_Intrinsic;
  587. def int_aarch64_neon_tbx4 : AdvSIMD_Tbx4_Intrinsic;
  588. let TargetPrefix = "aarch64" in {
  589. class FPCR_Get_Intrinsic
  590. : DefaultAttrsIntrinsic<[llvm_i64_ty], [], [IntrNoMem, IntrHasSideEffects]>;
  591. class FPCR_Set_Intrinsic
  592. : DefaultAttrsIntrinsic<[], [llvm_i64_ty], [IntrNoMem, IntrHasSideEffects]>;
  593. class RNDR_Intrinsic
  594. : DefaultAttrsIntrinsic<[llvm_i64_ty, llvm_i1_ty], [], [IntrNoMem, IntrHasSideEffects]>;
  595. }
  596. // FPCR
  597. def int_aarch64_get_fpcr : FPCR_Get_Intrinsic;
  598. def int_aarch64_set_fpcr : FPCR_Set_Intrinsic;
  599. // Armv8.5-A Random number generation intrinsics
  600. def int_aarch64_rndr : RNDR_Intrinsic;
  601. def int_aarch64_rndrrs : RNDR_Intrinsic;
  602. let TargetPrefix = "aarch64" in {
  603. class Crypto_AES_DataKey_Intrinsic
  604. : DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
  605. class Crypto_AES_Data_Intrinsic
  606. : DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
  607. // SHA intrinsic taking 5 words of the hash (v4i32, i32) and 4 of the schedule
  608. // (v4i32).
  609. class Crypto_SHA_5Hash4Schedule_Intrinsic
  610. : DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty, llvm_v4i32_ty],
  611. [IntrNoMem]>;
  612. // SHA intrinsic taking 5 words of the hash (v4i32, i32) and 4 of the schedule
  613. // (v4i32).
  614. class Crypto_SHA_1Hash_Intrinsic
  615. : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
  616. // SHA intrinsic taking 8 words of the schedule
  617. class Crypto_SHA_8Schedule_Intrinsic
  618. : DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
  619. // SHA intrinsic taking 12 words of the schedule
  620. class Crypto_SHA_12Schedule_Intrinsic
  621. : DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  622. [IntrNoMem]>;
  623. // SHA intrinsic taking 8 words of the hash and 4 of the schedule.
  624. class Crypto_SHA_8Hash4Schedule_Intrinsic
  625. : DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  626. [IntrNoMem]>;
  627. // SHA512 intrinsic taking 2 arguments
  628. class Crypto_SHA512_2Arg_Intrinsic
  629. : DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
  630. // SHA512 intrinsic taking 3 Arguments
  631. class Crypto_SHA512_3Arg_Intrinsic
  632. : DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
  633. [IntrNoMem]>;
  634. // SHA3 Intrinsics taking 3 arguments
  635. class Crypto_SHA3_3Arg_Intrinsic
  636. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  637. [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
  638. [IntrNoMem]>;
  639. // SHA3 Intrinsic taking 2 arguments
  640. class Crypto_SHA3_2Arg_Intrinsic
  641. : DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
  642. [IntrNoMem]>;
  643. // SHA3 Intrinsic taking 3 Arguments 1 immediate
  644. class Crypto_SHA3_2ArgImm_Intrinsic
  645. : DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i64_ty],
  646. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  647. class Crypto_SM3_3Vector_Intrinsic
  648. : Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
  649. [IntrNoMem]>;
  650. class Crypto_SM3_3VectorIndexed_Intrinsic
  651. : Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i64_ty],
  652. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  653. class Crypto_SM4_2Vector_Intrinsic
  654. : Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
  655. }
  656. // AES
  657. def int_aarch64_crypto_aese : Crypto_AES_DataKey_Intrinsic;
  658. def int_aarch64_crypto_aesd : Crypto_AES_DataKey_Intrinsic;
  659. def int_aarch64_crypto_aesmc : Crypto_AES_Data_Intrinsic;
  660. def int_aarch64_crypto_aesimc : Crypto_AES_Data_Intrinsic;
  661. // SHA1
  662. def int_aarch64_crypto_sha1c : Crypto_SHA_5Hash4Schedule_Intrinsic;
  663. def int_aarch64_crypto_sha1p : Crypto_SHA_5Hash4Schedule_Intrinsic;
  664. def int_aarch64_crypto_sha1m : Crypto_SHA_5Hash4Schedule_Intrinsic;
  665. def int_aarch64_crypto_sha1h : Crypto_SHA_1Hash_Intrinsic;
  666. def int_aarch64_crypto_sha1su0 : Crypto_SHA_12Schedule_Intrinsic;
  667. def int_aarch64_crypto_sha1su1 : Crypto_SHA_8Schedule_Intrinsic;
  668. // SHA256
  669. def int_aarch64_crypto_sha256h : Crypto_SHA_8Hash4Schedule_Intrinsic;
  670. def int_aarch64_crypto_sha256h2 : Crypto_SHA_8Hash4Schedule_Intrinsic;
  671. def int_aarch64_crypto_sha256su0 : Crypto_SHA_8Schedule_Intrinsic;
  672. def int_aarch64_crypto_sha256su1 : Crypto_SHA_12Schedule_Intrinsic;
  673. //SHA3
  674. def int_aarch64_crypto_eor3s : Crypto_SHA3_3Arg_Intrinsic;
  675. def int_aarch64_crypto_eor3u : Crypto_SHA3_3Arg_Intrinsic;
  676. def int_aarch64_crypto_bcaxs : Crypto_SHA3_3Arg_Intrinsic;
  677. def int_aarch64_crypto_bcaxu : Crypto_SHA3_3Arg_Intrinsic;
  678. def int_aarch64_crypto_rax1 : Crypto_SHA3_2Arg_Intrinsic;
  679. def int_aarch64_crypto_xar : Crypto_SHA3_2ArgImm_Intrinsic;
  680. // SHA512
  681. def int_aarch64_crypto_sha512h : Crypto_SHA512_3Arg_Intrinsic;
  682. def int_aarch64_crypto_sha512h2 : Crypto_SHA512_3Arg_Intrinsic;
  683. def int_aarch64_crypto_sha512su0 : Crypto_SHA512_2Arg_Intrinsic;
  684. def int_aarch64_crypto_sha512su1 : Crypto_SHA512_3Arg_Intrinsic;
  685. //SM3 & SM4
  686. def int_aarch64_crypto_sm3partw1 : Crypto_SM3_3Vector_Intrinsic;
  687. def int_aarch64_crypto_sm3partw2 : Crypto_SM3_3Vector_Intrinsic;
  688. def int_aarch64_crypto_sm3ss1 : Crypto_SM3_3Vector_Intrinsic;
  689. def int_aarch64_crypto_sm3tt1a : Crypto_SM3_3VectorIndexed_Intrinsic;
  690. def int_aarch64_crypto_sm3tt1b : Crypto_SM3_3VectorIndexed_Intrinsic;
  691. def int_aarch64_crypto_sm3tt2a : Crypto_SM3_3VectorIndexed_Intrinsic;
  692. def int_aarch64_crypto_sm3tt2b : Crypto_SM3_3VectorIndexed_Intrinsic;
  693. def int_aarch64_crypto_sm4e : Crypto_SM4_2Vector_Intrinsic;
  694. def int_aarch64_crypto_sm4ekey : Crypto_SM4_2Vector_Intrinsic;
  695. //===----------------------------------------------------------------------===//
  696. // CRC32
  697. let TargetPrefix = "aarch64" in {
  698. def int_aarch64_crc32b : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  699. [IntrNoMem]>;
  700. def int_aarch64_crc32cb : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  701. [IntrNoMem]>;
  702. def int_aarch64_crc32h : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  703. [IntrNoMem]>;
  704. def int_aarch64_crc32ch : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  705. [IntrNoMem]>;
  706. def int_aarch64_crc32w : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  707. [IntrNoMem]>;
  708. def int_aarch64_crc32cw : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
  709. [IntrNoMem]>;
  710. def int_aarch64_crc32x : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i64_ty],
  711. [IntrNoMem]>;
  712. def int_aarch64_crc32cx : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i64_ty],
  713. [IntrNoMem]>;
  714. }
  715. //===----------------------------------------------------------------------===//
  716. // Memory Tagging Extensions (MTE) Intrinsics
  717. let TargetPrefix = "aarch64" in {
  718. def int_aarch64_irg : DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_i64_ty],
  719. [IntrNoMem, IntrHasSideEffects]>;
  720. def int_aarch64_addg : DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_i64_ty],
  721. [IntrNoMem]>;
  722. def int_aarch64_gmi : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_ptr_ty, llvm_i64_ty],
  723. [IntrNoMem]>;
  724. def int_aarch64_ldg : DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_ptr_ty],
  725. [IntrReadMem]>;
  726. def int_aarch64_stg : DefaultAttrsIntrinsic<[], [llvm_ptr_ty, llvm_ptr_ty],
  727. [IntrWriteMem]>;
  728. def int_aarch64_subp : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_ptr_ty, llvm_ptr_ty],
  729. [IntrNoMem]>;
  730. // The following are codegen-only intrinsics for stack instrumentation.
  731. // Generate a randomly tagged stack base pointer.
  732. def int_aarch64_irg_sp : DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_i64_ty],
  733. [IntrNoMem, IntrHasSideEffects]>;
  734. // Transfer pointer tag with offset.
  735. // ptr1 = tagp(ptr0, baseptr, tag_offset) returns a pointer where
  736. // * address is the address in ptr0
  737. // * tag is a function of (tag in baseptr, tag_offset).
  738. // ** Beware, this is not the same function as implemented by the ADDG instruction!
  739. // Backend optimizations may change tag_offset; the only guarantee is that calls
  740. // to tagp with the same pair of (baseptr, tag_offset) will produce pointers
  741. // with the same tag value, assuming the set of excluded tags has not changed.
  742. // Address bits in baseptr and tag bits in ptr0 are ignored.
  743. // When offset between ptr0 and baseptr is a compile time constant, this can be emitted as
  744. // ADDG ptr1, baseptr, (ptr0 - baseptr), tag_offset
  745. // It is intended that ptr0 is an alloca address, and baseptr is the direct output of llvm.aarch64.irg.sp.
  746. def int_aarch64_tagp : DefaultAttrsIntrinsic<[llvm_anyptr_ty], [LLVMMatchType<0>, llvm_ptr_ty, llvm_i64_ty],
  747. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  748. // Update allocation tags for the memory range to match the tag in the pointer argument.
  749. def int_aarch64_settag : DefaultAttrsIntrinsic<[], [llvm_ptr_ty, llvm_i64_ty],
  750. [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>]>;
  751. // Update allocation tags for the memory range to match the tag in the pointer argument,
  752. // and set memory contents to zero.
  753. def int_aarch64_settag_zero : DefaultAttrsIntrinsic<[], [llvm_ptr_ty, llvm_i64_ty],
  754. [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>]>;
  755. // Update allocation tags for 16-aligned, 16-sized memory region, and store a pair 8-byte values.
  756. def int_aarch64_stgp : DefaultAttrsIntrinsic<[], [llvm_ptr_ty, llvm_i64_ty, llvm_i64_ty],
  757. [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>]>;
  758. }
  759. //===----------------------------------------------------------------------===//
  760. // Memory Operations (MOPS) Intrinsics
  761. let TargetPrefix = "aarch64" in {
  762. // Sizes are chosen to correspond to the llvm.memset intrinsic: ptr, i8, i64
  763. def int_aarch64_mops_memset_tag : DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_i8_ty, llvm_i64_ty],
  764. [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>]>;
  765. }
  766. // Transactional Memory Extension (TME) Intrinsics
  767. let TargetPrefix = "aarch64" in {
  768. def int_aarch64_tstart : ClangBuiltin<"__builtin_arm_tstart">,
  769. Intrinsic<[llvm_i64_ty], [], [IntrWillReturn]>;
  770. def int_aarch64_tcommit : ClangBuiltin<"__builtin_arm_tcommit">, Intrinsic<[], [], [IntrWillReturn]>;
  771. def int_aarch64_tcancel : ClangBuiltin<"__builtin_arm_tcancel">,
  772. Intrinsic<[], [llvm_i64_ty], [IntrWillReturn, ImmArg<ArgIndex<0>>]>;
  773. def int_aarch64_ttest : ClangBuiltin<"__builtin_arm_ttest">,
  774. Intrinsic<[llvm_i64_ty], [],
  775. [IntrNoMem, IntrHasSideEffects, IntrWillReturn]>;
  776. // Armv8.7-A load/store 64-byte intrinsics
  777. defvar data512 = !listsplat(llvm_i64_ty, 8);
  778. def int_aarch64_ld64b: Intrinsic<data512, [llvm_ptr_ty]>;
  779. def int_aarch64_st64b: Intrinsic<[], !listconcat([llvm_ptr_ty], data512)>;
  780. def int_aarch64_st64bv: Intrinsic<[llvm_i64_ty], !listconcat([llvm_ptr_ty], data512)>;
  781. def int_aarch64_st64bv0: Intrinsic<[llvm_i64_ty], !listconcat([llvm_ptr_ty], data512)>;
  782. }
  783. def llvm_nxv1i1_ty : LLVMType<nxv1i1>;
  784. def llvm_nxv2i1_ty : LLVMType<nxv2i1>;
  785. def llvm_nxv4i1_ty : LLVMType<nxv4i1>;
  786. def llvm_nxv8i1_ty : LLVMType<nxv8i1>;
  787. def llvm_nxv16i1_ty : LLVMType<nxv16i1>;
  788. def llvm_nxv16i8_ty : LLVMType<nxv16i8>;
  789. def llvm_nxv4i32_ty : LLVMType<nxv4i32>;
  790. def llvm_nxv2i64_ty : LLVMType<nxv2i64>;
  791. def llvm_nxv8f16_ty : LLVMType<nxv8f16>;
  792. def llvm_nxv8bf16_ty : LLVMType<nxv8bf16>;
  793. def llvm_nxv4f32_ty : LLVMType<nxv4f32>;
  794. def llvm_nxv2f64_ty : LLVMType<nxv2f64>;
  795. let TargetPrefix = "aarch64" in { // All intrinsics start with "llvm.aarch64.".
  796. class AdvSIMD_1Vec_PredLoad_Intrinsic
  797. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  798. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  799. LLVMPointerToElt<0>],
  800. [IntrReadMem, IntrArgMemOnly]>;
  801. class AdvSIMD_2Vec_PredLoad_Intrinsic
  802. : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
  803. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  804. LLVMPointerToElt<0>],
  805. [IntrReadMem, IntrArgMemOnly]>;
  806. class AdvSIMD_3Vec_PredLoad_Intrinsic
  807. : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>],
  808. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  809. LLVMPointerToElt<0>],
  810. [IntrReadMem, IntrArgMemOnly]>;
  811. class AdvSIMD_4Vec_PredLoad_Intrinsic
  812. : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
  813. LLVMMatchType<0>],
  814. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  815. LLVMPointerToElt<0>],
  816. [IntrReadMem, IntrArgMemOnly]>;
  817. class AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic
  818. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  819. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  820. LLVMPointerToElt<0>],
  821. [IntrInaccessibleMemOrArgMemOnly]>;
  822. class AdvSIMD_1Vec_PredStore_Intrinsic
  823. : DefaultAttrsIntrinsic<[],
  824. [llvm_anyvector_ty,
  825. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  826. LLVMPointerToElt<0>],
  827. [IntrArgMemOnly, NoCapture<ArgIndex<2>>]>;
  828. class AdvSIMD_2Vec_PredStore_Intrinsic
  829. : DefaultAttrsIntrinsic<[],
  830. [llvm_anyvector_ty, LLVMMatchType<0>,
  831. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, LLVMPointerToElt<0>],
  832. [IntrArgMemOnly, NoCapture<ArgIndex<3>>]>;
  833. class AdvSIMD_3Vec_PredStore_Intrinsic
  834. : DefaultAttrsIntrinsic<[],
  835. [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
  836. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, LLVMPointerToElt<0>],
  837. [IntrArgMemOnly, NoCapture<ArgIndex<4>>]>;
  838. class AdvSIMD_4Vec_PredStore_Intrinsic
  839. : DefaultAttrsIntrinsic<[],
  840. [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
  841. LLVMMatchType<0>,
  842. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, LLVMPointerToElt<0>],
  843. [IntrArgMemOnly, NoCapture<ArgIndex<5>>]>;
  844. class AdvSIMD_SVE_Index_Intrinsic
  845. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  846. [LLVMVectorElementType<0>,
  847. LLVMVectorElementType<0>],
  848. [IntrNoMem]>;
  849. class AdvSIMD_Merged1VectorArg_Intrinsic
  850. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  851. [LLVMMatchType<0>,
  852. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  853. LLVMMatchType<0>],
  854. [IntrNoMem]>;
  855. class AdvSIMD_2VectorArgIndexed_Intrinsic
  856. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  857. [LLVMMatchType<0>,
  858. LLVMMatchType<0>,
  859. llvm_i32_ty],
  860. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  861. class AdvSIMD_3VectorArgIndexed_Intrinsic
  862. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  863. [LLVMMatchType<0>,
  864. LLVMMatchType<0>,
  865. LLVMMatchType<0>,
  866. llvm_i32_ty],
  867. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  868. class AdvSIMD_Pred1VectorArg_Intrinsic
  869. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  870. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  871. LLVMMatchType<0>],
  872. [IntrNoMem]>;
  873. class AdvSIMD_Pred2VectorArg_Intrinsic
  874. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  875. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  876. LLVMMatchType<0>,
  877. LLVMMatchType<0>],
  878. [IntrNoMem]>;
  879. class AdvSIMD_Pred3VectorArg_Intrinsic
  880. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  881. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  882. LLVMMatchType<0>,
  883. LLVMMatchType<0>,
  884. LLVMMatchType<0>],
  885. [IntrNoMem]>;
  886. class AdvSIMD_SVE_Compare_Intrinsic
  887. : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
  888. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  889. llvm_anyvector_ty,
  890. LLVMMatchType<0>],
  891. [IntrNoMem]>;
  892. class AdvSIMD_SVE_CompareWide_Intrinsic
  893. : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
  894. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  895. llvm_anyvector_ty,
  896. llvm_nxv2i64_ty],
  897. [IntrNoMem]>;
  898. class AdvSIMD_SVE_Saturating_Intrinsic
  899. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  900. [LLVMMatchType<0>,
  901. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
  902. [IntrNoMem]>;
  903. class AdvSIMD_SVE_SaturatingWithPattern_Intrinsic
  904. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  905. [LLVMMatchType<0>,
  906. llvm_i32_ty,
  907. llvm_i32_ty],
  908. [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>;
  909. class AdvSIMD_SVE_Saturating_N_Intrinsic<LLVMType T>
  910. : DefaultAttrsIntrinsic<[T],
  911. [T, llvm_anyvector_ty],
  912. [IntrNoMem]>;
  913. class AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<LLVMType T>
  914. : DefaultAttrsIntrinsic<[T],
  915. [T, llvm_i32_ty, llvm_i32_ty],
  916. [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>;
  917. class AdvSIMD_SVE_CNT_Intrinsic
  918. : DefaultAttrsIntrinsic<[LLVMVectorOfBitcastsToInt<0>],
  919. [LLVMVectorOfBitcastsToInt<0>,
  920. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  921. llvm_anyvector_ty],
  922. [IntrNoMem]>;
  923. class AdvSIMD_SVE_ReduceWithInit_Intrinsic
  924. : DefaultAttrsIntrinsic<[LLVMVectorElementType<0>],
  925. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  926. LLVMVectorElementType<0>,
  927. llvm_anyvector_ty],
  928. [IntrNoMem]>;
  929. class AdvSIMD_SVE_ShiftByImm_Intrinsic
  930. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  931. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  932. LLVMMatchType<0>,
  933. llvm_i32_ty],
  934. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  935. class AdvSIMD_SVE_ShiftWide_Intrinsic
  936. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  937. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  938. LLVMMatchType<0>,
  939. llvm_nxv2i64_ty],
  940. [IntrNoMem]>;
  941. class AdvSIMD_SVE_Unpack_Intrinsic
  942. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  943. [LLVMSubdivide2VectorType<0>],
  944. [IntrNoMem]>;
  945. class AdvSIMD_SVE_CADD_Intrinsic
  946. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  947. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  948. LLVMMatchType<0>,
  949. LLVMMatchType<0>,
  950. llvm_i32_ty],
  951. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  952. class AdvSIMD_SVE_CMLA_Intrinsic
  953. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  954. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  955. LLVMMatchType<0>,
  956. LLVMMatchType<0>,
  957. LLVMMatchType<0>,
  958. llvm_i32_ty],
  959. [IntrNoMem, ImmArg<ArgIndex<4>>]>;
  960. class AdvSIMD_SVE_CMLA_LANE_Intrinsic
  961. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  962. [LLVMMatchType<0>,
  963. LLVMMatchType<0>,
  964. LLVMMatchType<0>,
  965. llvm_i32_ty,
  966. llvm_i32_ty],
  967. [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
  968. class AdvSIMD_SVE_DUP_Intrinsic
  969. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  970. [LLVMMatchType<0>,
  971. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  972. LLVMVectorElementType<0>],
  973. [IntrNoMem]>;
  974. class AdvSIMD_SVE_DUP_Unpred_Intrinsic
  975. : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMVectorElementType<0>],
  976. [IntrNoMem]>;
  977. class AdvSIMD_SVE_DUPQ_Intrinsic
  978. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  979. [LLVMMatchType<0>,
  980. llvm_i64_ty],
  981. [IntrNoMem]>;
  982. class AdvSIMD_SVE_EXPA_Intrinsic
  983. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  984. [LLVMVectorOfBitcastsToInt<0>],
  985. [IntrNoMem]>;
  986. class AdvSIMD_SVE_FCVT_Intrinsic
  987. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  988. [LLVMMatchType<0>,
  989. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  990. llvm_anyvector_ty],
  991. [IntrNoMem]>;
  992. class AdvSIMD_SVE_FCVTZS_Intrinsic
  993. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  994. [LLVMVectorOfBitcastsToInt<0>,
  995. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  996. llvm_anyvector_ty],
  997. [IntrNoMem]>;
  998. class AdvSIMD_SVE_INSR_Intrinsic
  999. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1000. [LLVMMatchType<0>,
  1001. LLVMVectorElementType<0>],
  1002. [IntrNoMem]>;
  1003. class AdvSIMD_SVE_PTRUE_Intrinsic
  1004. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1005. [llvm_i32_ty],
  1006. [IntrNoMem, ImmArg<ArgIndex<0>>]>;
  1007. class AdvSIMD_SVE_PUNPKHI_Intrinsic
  1008. : DefaultAttrsIntrinsic<[LLVMHalfElementsVectorType<0>],
  1009. [llvm_anyvector_ty],
  1010. [IntrNoMem]>;
  1011. class AdvSIMD_SVE_SCALE_Intrinsic
  1012. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1013. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1014. LLVMMatchType<0>,
  1015. LLVMVectorOfBitcastsToInt<0>],
  1016. [IntrNoMem]>;
  1017. class AdvSIMD_SVE_SCVTF_Intrinsic
  1018. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1019. [LLVMMatchType<0>,
  1020. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1021. llvm_anyvector_ty],
  1022. [IntrNoMem]>;
  1023. class AdvSIMD_SVE_TSMUL_Intrinsic
  1024. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1025. [LLVMMatchType<0>,
  1026. LLVMVectorOfBitcastsToInt<0>],
  1027. [IntrNoMem]>;
  1028. class AdvSIMD_SVE_CNTB_Intrinsic
  1029. : DefaultAttrsIntrinsic<[llvm_i64_ty],
  1030. [llvm_i32_ty],
  1031. [IntrNoMem, ImmArg<ArgIndex<0>>]>;
  1032. class AdvSIMD_SVE_CNTP_Intrinsic
  1033. : DefaultAttrsIntrinsic<[llvm_i64_ty],
  1034. [llvm_anyvector_ty, LLVMMatchType<0>],
  1035. [IntrNoMem]>;
  1036. class AdvSIMD_SVE_DOT_Intrinsic
  1037. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1038. [LLVMMatchType<0>,
  1039. LLVMSubdivide4VectorType<0>,
  1040. LLVMSubdivide4VectorType<0>],
  1041. [IntrNoMem]>;
  1042. class AdvSIMD_SVE_DOT_Indexed_Intrinsic
  1043. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1044. [LLVMMatchType<0>,
  1045. LLVMSubdivide4VectorType<0>,
  1046. LLVMSubdivide4VectorType<0>,
  1047. llvm_i32_ty],
  1048. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1049. class AdvSIMD_SVE_PTEST_Intrinsic
  1050. : DefaultAttrsIntrinsic<[llvm_i1_ty],
  1051. [llvm_anyvector_ty,
  1052. LLVMMatchType<0>],
  1053. [IntrNoMem]>;
  1054. class AdvSIMD_SVE_TBL_Intrinsic
  1055. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1056. [LLVMMatchType<0>,
  1057. LLVMVectorOfBitcastsToInt<0>],
  1058. [IntrNoMem]>;
  1059. class AdvSIMD_SVE2_TBX_Intrinsic
  1060. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1061. [LLVMMatchType<0>,
  1062. LLVMMatchType<0>,
  1063. LLVMVectorOfBitcastsToInt<0>],
  1064. [IntrNoMem]>;
  1065. class SVE2_1VectorArg_Long_Intrinsic
  1066. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1067. [LLVMSubdivide2VectorType<0>,
  1068. llvm_i32_ty],
  1069. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  1070. class SVE2_2VectorArg_Long_Intrinsic
  1071. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1072. [LLVMSubdivide2VectorType<0>,
  1073. LLVMSubdivide2VectorType<0>],
  1074. [IntrNoMem]>;
  1075. class SVE2_2VectorArgIndexed_Long_Intrinsic
  1076. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1077. [LLVMSubdivide2VectorType<0>,
  1078. LLVMSubdivide2VectorType<0>,
  1079. llvm_i32_ty],
  1080. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1081. class SVE2_2VectorArg_Wide_Intrinsic
  1082. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1083. [LLVMMatchType<0>,
  1084. LLVMSubdivide2VectorType<0>],
  1085. [IntrNoMem]>;
  1086. class SVE2_2VectorArg_Pred_Long_Intrinsic
  1087. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1088. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1089. LLVMMatchType<0>,
  1090. LLVMSubdivide2VectorType<0>],
  1091. [IntrNoMem]>;
  1092. class SVE2_3VectorArg_Long_Intrinsic
  1093. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1094. [LLVMMatchType<0>,
  1095. LLVMSubdivide2VectorType<0>,
  1096. LLVMSubdivide2VectorType<0>],
  1097. [IntrNoMem]>;
  1098. class SVE2_3VectorArgIndexed_Long_Intrinsic
  1099. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1100. [LLVMMatchType<0>,
  1101. LLVMSubdivide2VectorType<0>,
  1102. LLVMSubdivide2VectorType<0>,
  1103. llvm_i32_ty],
  1104. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1105. class SVE2_1VectorArg_Narrowing_Intrinsic
  1106. : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
  1107. [llvm_anyvector_ty],
  1108. [IntrNoMem]>;
  1109. class SVE2_Merged1VectorArg_Narrowing_Intrinsic
  1110. : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
  1111. [LLVMSubdivide2VectorType<0>,
  1112. llvm_anyvector_ty],
  1113. [IntrNoMem]>;
  1114. class SVE2_2VectorArg_Narrowing_Intrinsic
  1115. : DefaultAttrsIntrinsic<
  1116. [LLVMSubdivide2VectorType<0>],
  1117. [llvm_anyvector_ty, LLVMMatchType<0>],
  1118. [IntrNoMem]>;
  1119. class SVE2_Merged2VectorArg_Narrowing_Intrinsic
  1120. : DefaultAttrsIntrinsic<
  1121. [LLVMSubdivide2VectorType<0>],
  1122. [LLVMSubdivide2VectorType<0>, llvm_anyvector_ty, LLVMMatchType<0>],
  1123. [IntrNoMem]>;
  1124. class SVE2_1VectorArg_Imm_Narrowing_Intrinsic
  1125. : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
  1126. [llvm_anyvector_ty, llvm_i32_ty],
  1127. [IntrNoMem, ImmArg<ArgIndex<1>>]>;
  1128. class SVE2_2VectorArg_Imm_Narrowing_Intrinsic
  1129. : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
  1130. [LLVMSubdivide2VectorType<0>, llvm_anyvector_ty,
  1131. llvm_i32_ty],
  1132. [IntrNoMem, ImmArg<ArgIndex<2>>]>;
  1133. class SVE2_CONFLICT_DETECT_Intrinsic
  1134. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1135. [LLVMAnyPointerType<llvm_any_ty>,
  1136. LLVMMatchType<1>]>;
  1137. class SVE2_3VectorArg_Indexed_Intrinsic
  1138. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1139. [LLVMMatchType<0>,
  1140. LLVMSubdivide2VectorType<0>,
  1141. LLVMSubdivide2VectorType<0>,
  1142. llvm_i32_ty],
  1143. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1144. class AdvSIMD_SVE_CDOT_LANE_Intrinsic
  1145. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1146. [LLVMMatchType<0>,
  1147. LLVMSubdivide4VectorType<0>,
  1148. LLVMSubdivide4VectorType<0>,
  1149. llvm_i32_ty,
  1150. llvm_i32_ty],
  1151. [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
  1152. // NOTE: There is no relationship between these intrinsics beyond an attempt
  1153. // to reuse currently identical class definitions.
  1154. class AdvSIMD_SVE_LOGB_Intrinsic : AdvSIMD_SVE_CNT_Intrinsic;
  1155. class AdvSIMD_SVE2_CADD_Intrinsic : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1156. class AdvSIMD_SVE2_CMLA_Intrinsic : AdvSIMD_3VectorArgIndexed_Intrinsic;
  1157. // This class of intrinsics are not intended to be useful within LLVM IR but
  1158. // are instead here to support some of the more regid parts of the ACLE.
  1159. class Builtin_SVCVT<LLVMType OUT, LLVMType PRED, LLVMType IN>
  1160. : DefaultAttrsIntrinsic<[OUT], [OUT, PRED, IN], [IntrNoMem]>;
  1161. }
  1162. //===----------------------------------------------------------------------===//
  1163. // SVE
  1164. let TargetPrefix = "aarch64" in { // All intrinsics start with "llvm.aarch64.".
  1165. class AdvSIMD_SVE_2SVBoolArg_Intrinsic
  1166. : DefaultAttrsIntrinsic<[llvm_nxv16i1_ty],
  1167. [llvm_nxv16i1_ty],
  1168. [IntrNoMem]>;
  1169. class AdvSIMD_SVE_3SVBoolArg_Intrinsic
  1170. : DefaultAttrsIntrinsic<[llvm_nxv16i1_ty],
  1171. [llvm_nxv16i1_ty, llvm_nxv16i1_ty],
  1172. [IntrNoMem]>;
  1173. class AdvSIMD_SVE_Reduce_Intrinsic
  1174. : DefaultAttrsIntrinsic<[LLVMVectorElementType<0>],
  1175. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1176. llvm_anyvector_ty],
  1177. [IntrNoMem]>;
  1178. class AdvSIMD_SVE_SADDV_Reduce_Intrinsic
  1179. : DefaultAttrsIntrinsic<[llvm_i64_ty],
  1180. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1181. llvm_anyvector_ty],
  1182. [IntrNoMem]>;
  1183. class AdvSIMD_SVE_WHILE_Intrinsic
  1184. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1185. [llvm_anyint_ty, LLVMMatchType<1>],
  1186. [IntrNoMem]>;
  1187. class AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic
  1188. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1189. [
  1190. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1191. LLVMPointerToElt<0>,
  1192. LLVMScalarOrSameVectorWidth<0, llvm_i64_ty>
  1193. ],
  1194. [IntrReadMem, IntrArgMemOnly]>;
  1195. class AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic
  1196. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1197. [
  1198. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1199. LLVMPointerToElt<0>,
  1200. LLVMScalarOrSameVectorWidth<0, llvm_i64_ty>
  1201. ],
  1202. [IntrInaccessibleMemOrArgMemOnly]>;
  1203. class AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic
  1204. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1205. [
  1206. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1207. LLVMPointerToElt<0>,
  1208. LLVMScalarOrSameVectorWidth<0, llvm_i32_ty>
  1209. ],
  1210. [IntrReadMem, IntrArgMemOnly]>;
  1211. class AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic
  1212. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1213. [
  1214. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1215. LLVMPointerToElt<0>,
  1216. LLVMScalarOrSameVectorWidth<0, llvm_i32_ty>
  1217. ],
  1218. [IntrInaccessibleMemOrArgMemOnly]>;
  1219. class AdvSIMD_GatherLoad_VS_Intrinsic
  1220. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1221. [
  1222. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1223. llvm_anyvector_ty,
  1224. llvm_i64_ty
  1225. ],
  1226. [IntrReadMem]>;
  1227. class AdvSIMD_GatherLoad_VS_WriteFFR_Intrinsic
  1228. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1229. [
  1230. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1231. llvm_anyvector_ty,
  1232. llvm_i64_ty
  1233. ],
  1234. [IntrInaccessibleMemOrArgMemOnly]>;
  1235. class AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic
  1236. : DefaultAttrsIntrinsic<[],
  1237. [
  1238. llvm_anyvector_ty,
  1239. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1240. LLVMPointerToElt<0>,
  1241. LLVMScalarOrSameVectorWidth<0, llvm_i64_ty>
  1242. ],
  1243. [IntrWriteMem, IntrArgMemOnly]>;
  1244. class AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic
  1245. : DefaultAttrsIntrinsic<[],
  1246. [
  1247. llvm_anyvector_ty,
  1248. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1249. LLVMPointerToElt<0>,
  1250. LLVMScalarOrSameVectorWidth<0, llvm_i32_ty>
  1251. ],
  1252. [IntrWriteMem, IntrArgMemOnly]>;
  1253. class AdvSIMD_ScatterStore_VS_Intrinsic
  1254. : DefaultAttrsIntrinsic<[],
  1255. [
  1256. llvm_anyvector_ty,
  1257. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  1258. llvm_anyvector_ty, llvm_i64_ty
  1259. ],
  1260. [IntrWriteMem]>;
  1261. class SVE_gather_prf_SV
  1262. : DefaultAttrsIntrinsic<[],
  1263. [
  1264. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, // Predicate
  1265. llvm_ptr_ty, // Base address
  1266. llvm_anyvector_ty, // Offsets
  1267. llvm_i32_ty // Prfop
  1268. ],
  1269. [IntrInaccessibleMemOrArgMemOnly, NoCapture<ArgIndex<1>>, ImmArg<ArgIndex<3>>]>;
  1270. class SVE_gather_prf_VS
  1271. : DefaultAttrsIntrinsic<[],
  1272. [
  1273. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, // Predicate
  1274. llvm_anyvector_ty, // Base addresses
  1275. llvm_i64_ty, // Scalar offset
  1276. llvm_i32_ty // Prfop
  1277. ],
  1278. [IntrInaccessibleMemOrArgMemOnly, ImmArg<ArgIndex<3>>]>;
  1279. class SVE_MatMul_Intrinsic
  1280. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1281. [LLVMMatchType<0>, LLVMSubdivide4VectorType<0>, LLVMSubdivide4VectorType<0>],
  1282. [IntrNoMem]>;
  1283. class SVE_4Vec_BF16
  1284. : DefaultAttrsIntrinsic<[llvm_nxv4f32_ty],
  1285. [llvm_nxv4f32_ty, llvm_nxv8bf16_ty, llvm_nxv8bf16_ty],
  1286. [IntrNoMem]>;
  1287. class SVE_4Vec_BF16_Indexed
  1288. : DefaultAttrsIntrinsic<[llvm_nxv4f32_ty],
  1289. [llvm_nxv4f32_ty, llvm_nxv8bf16_ty, llvm_nxv8bf16_ty, llvm_i32_ty],
  1290. [IntrNoMem, ImmArg<ArgIndex<3>>]>;
  1291. //
  1292. // Loads
  1293. //
  1294. def int_aarch64_sve_ld1 : AdvSIMD_1Vec_PredLoad_Intrinsic;
  1295. def int_aarch64_sve_ld2_sret : AdvSIMD_2Vec_PredLoad_Intrinsic;
  1296. def int_aarch64_sve_ld3_sret : AdvSIMD_3Vec_PredLoad_Intrinsic;
  1297. def int_aarch64_sve_ld4_sret : AdvSIMD_4Vec_PredLoad_Intrinsic;
  1298. def int_aarch64_sve_ldnt1 : AdvSIMD_1Vec_PredLoad_Intrinsic;
  1299. def int_aarch64_sve_ldnf1 : AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic;
  1300. def int_aarch64_sve_ldff1 : AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic;
  1301. def int_aarch64_sve_ld1rq : AdvSIMD_1Vec_PredLoad_Intrinsic;
  1302. def int_aarch64_sve_ld1ro : AdvSIMD_1Vec_PredLoad_Intrinsic;
  1303. //
  1304. // Stores
  1305. //
  1306. def int_aarch64_sve_st1 : AdvSIMD_1Vec_PredStore_Intrinsic;
  1307. def int_aarch64_sve_st2 : AdvSIMD_2Vec_PredStore_Intrinsic;
  1308. def int_aarch64_sve_st3 : AdvSIMD_3Vec_PredStore_Intrinsic;
  1309. def int_aarch64_sve_st4 : AdvSIMD_4Vec_PredStore_Intrinsic;
  1310. def int_aarch64_sve_stnt1 : AdvSIMD_1Vec_PredStore_Intrinsic;
  1311. //
  1312. // Prefetches
  1313. //
  1314. def int_aarch64_sve_prf
  1315. : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, llvm_ptr_ty, llvm_i32_ty],
  1316. [IntrArgMemOnly, ImmArg<ArgIndex<2>>]>;
  1317. // Scalar + 32-bit scaled offset vector, zero extend, packed and
  1318. // unpacked.
  1319. def int_aarch64_sve_prfb_gather_uxtw_index : SVE_gather_prf_SV;
  1320. def int_aarch64_sve_prfh_gather_uxtw_index : SVE_gather_prf_SV;
  1321. def int_aarch64_sve_prfw_gather_uxtw_index : SVE_gather_prf_SV;
  1322. def int_aarch64_sve_prfd_gather_uxtw_index : SVE_gather_prf_SV;
  1323. // Scalar + 32-bit scaled offset vector, sign extend, packed and
  1324. // unpacked.
  1325. def int_aarch64_sve_prfb_gather_sxtw_index : SVE_gather_prf_SV;
  1326. def int_aarch64_sve_prfw_gather_sxtw_index : SVE_gather_prf_SV;
  1327. def int_aarch64_sve_prfh_gather_sxtw_index : SVE_gather_prf_SV;
  1328. def int_aarch64_sve_prfd_gather_sxtw_index : SVE_gather_prf_SV;
  1329. // Scalar + 64-bit scaled offset vector.
  1330. def int_aarch64_sve_prfb_gather_index : SVE_gather_prf_SV;
  1331. def int_aarch64_sve_prfh_gather_index : SVE_gather_prf_SV;
  1332. def int_aarch64_sve_prfw_gather_index : SVE_gather_prf_SV;
  1333. def int_aarch64_sve_prfd_gather_index : SVE_gather_prf_SV;
  1334. // Vector + scalar.
  1335. def int_aarch64_sve_prfb_gather_scalar_offset : SVE_gather_prf_VS;
  1336. def int_aarch64_sve_prfh_gather_scalar_offset : SVE_gather_prf_VS;
  1337. def int_aarch64_sve_prfw_gather_scalar_offset : SVE_gather_prf_VS;
  1338. def int_aarch64_sve_prfd_gather_scalar_offset : SVE_gather_prf_VS;
  1339. //
  1340. // Scalar to vector operations
  1341. //
  1342. def int_aarch64_sve_dup : AdvSIMD_SVE_DUP_Intrinsic;
  1343. def int_aarch64_sve_dup_x : AdvSIMD_SVE_DUP_Unpred_Intrinsic;
  1344. def int_aarch64_sve_index : AdvSIMD_SVE_Index_Intrinsic;
  1345. //
  1346. // Address calculation
  1347. //
  1348. def int_aarch64_sve_adrb : AdvSIMD_2VectorArg_Intrinsic;
  1349. def int_aarch64_sve_adrh : AdvSIMD_2VectorArg_Intrinsic;
  1350. def int_aarch64_sve_adrw : AdvSIMD_2VectorArg_Intrinsic;
  1351. def int_aarch64_sve_adrd : AdvSIMD_2VectorArg_Intrinsic;
  1352. //
  1353. // Integer arithmetic
  1354. //
  1355. def int_aarch64_sve_add : AdvSIMD_Pred2VectorArg_Intrinsic;
  1356. def int_aarch64_sve_add_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1357. def int_aarch64_sve_sub : AdvSIMD_Pred2VectorArg_Intrinsic;
  1358. def int_aarch64_sve_sub_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1359. def int_aarch64_sve_subr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1360. def int_aarch64_sve_pmul : AdvSIMD_2VectorArg_Intrinsic;
  1361. def int_aarch64_sve_mul : AdvSIMD_Pred2VectorArg_Intrinsic;
  1362. def int_aarch64_sve_mul_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1363. def int_aarch64_sve_mul_lane : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1364. def int_aarch64_sve_smulh : AdvSIMD_Pred2VectorArg_Intrinsic;
  1365. def int_aarch64_sve_smulh_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1366. def int_aarch64_sve_umulh : AdvSIMD_Pred2VectorArg_Intrinsic;
  1367. def int_aarch64_sve_umulh_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1368. def int_aarch64_sve_sdiv : AdvSIMD_Pred2VectorArg_Intrinsic;
  1369. def int_aarch64_sve_sdiv_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1370. def int_aarch64_sve_udiv : AdvSIMD_Pred2VectorArg_Intrinsic;
  1371. def int_aarch64_sve_udiv_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1372. def int_aarch64_sve_sdivr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1373. def int_aarch64_sve_udivr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1374. def int_aarch64_sve_smax : AdvSIMD_Pred2VectorArg_Intrinsic;
  1375. def int_aarch64_sve_smax_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1376. def int_aarch64_sve_umax : AdvSIMD_Pred2VectorArg_Intrinsic;
  1377. def int_aarch64_sve_umax_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1378. def int_aarch64_sve_smin : AdvSIMD_Pred2VectorArg_Intrinsic;
  1379. def int_aarch64_sve_smin_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1380. def int_aarch64_sve_umin : AdvSIMD_Pred2VectorArg_Intrinsic;
  1381. def int_aarch64_sve_umin_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1382. def int_aarch64_sve_sabd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1383. def int_aarch64_sve_sabd_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1384. def int_aarch64_sve_uabd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1385. def int_aarch64_sve_uabd_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1386. def int_aarch64_sve_mad : AdvSIMD_Pred3VectorArg_Intrinsic;
  1387. def int_aarch64_sve_msb : AdvSIMD_Pred3VectorArg_Intrinsic;
  1388. def int_aarch64_sve_mla : AdvSIMD_Pred3VectorArg_Intrinsic;
  1389. def int_aarch64_sve_mla_lane : AdvSIMD_3VectorArgIndexed_Intrinsic;
  1390. def int_aarch64_sve_mls : AdvSIMD_Pred3VectorArg_Intrinsic;
  1391. def int_aarch64_sve_mls_lane : AdvSIMD_3VectorArgIndexed_Intrinsic;
  1392. def int_aarch64_sve_saddv : AdvSIMD_SVE_SADDV_Reduce_Intrinsic;
  1393. def int_aarch64_sve_uaddv : AdvSIMD_SVE_SADDV_Reduce_Intrinsic;
  1394. def int_aarch64_sve_smaxv : AdvSIMD_SVE_Reduce_Intrinsic;
  1395. def int_aarch64_sve_umaxv : AdvSIMD_SVE_Reduce_Intrinsic;
  1396. def int_aarch64_sve_sminv : AdvSIMD_SVE_Reduce_Intrinsic;
  1397. def int_aarch64_sve_uminv : AdvSIMD_SVE_Reduce_Intrinsic;
  1398. def int_aarch64_sve_orv : AdvSIMD_SVE_Reduce_Intrinsic;
  1399. def int_aarch64_sve_eorv : AdvSIMD_SVE_Reduce_Intrinsic;
  1400. def int_aarch64_sve_andv : AdvSIMD_SVE_Reduce_Intrinsic;
  1401. def int_aarch64_sve_abs : AdvSIMD_Merged1VectorArg_Intrinsic;
  1402. def int_aarch64_sve_neg : AdvSIMD_Merged1VectorArg_Intrinsic;
  1403. def int_aarch64_sve_sdot : AdvSIMD_SVE_DOT_Intrinsic;
  1404. def int_aarch64_sve_sdot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic;
  1405. def int_aarch64_sve_udot : AdvSIMD_SVE_DOT_Intrinsic;
  1406. def int_aarch64_sve_udot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic;
  1407. def int_aarch64_sve_sqadd_x : AdvSIMD_2VectorArg_Intrinsic;
  1408. def int_aarch64_sve_sqsub_x : AdvSIMD_2VectorArg_Intrinsic;
  1409. def int_aarch64_sve_uqadd_x : AdvSIMD_2VectorArg_Intrinsic;
  1410. def int_aarch64_sve_uqsub_x : AdvSIMD_2VectorArg_Intrinsic;
  1411. // Shifts
  1412. def int_aarch64_sve_asr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1413. def int_aarch64_sve_asr_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1414. def int_aarch64_sve_asr_wide : AdvSIMD_SVE_ShiftWide_Intrinsic;
  1415. def int_aarch64_sve_asrd : AdvSIMD_SVE_ShiftByImm_Intrinsic;
  1416. def int_aarch64_sve_insr : AdvSIMD_SVE_INSR_Intrinsic;
  1417. def int_aarch64_sve_lsl : AdvSIMD_Pred2VectorArg_Intrinsic;
  1418. def int_aarch64_sve_lsl_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1419. def int_aarch64_sve_lsl_wide : AdvSIMD_SVE_ShiftWide_Intrinsic;
  1420. def int_aarch64_sve_lsr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1421. def int_aarch64_sve_lsr_u : AdvSIMD_Pred2VectorArg_Intrinsic;
  1422. def int_aarch64_sve_lsr_wide : AdvSIMD_SVE_ShiftWide_Intrinsic;
  1423. //
  1424. // Integer comparisons
  1425. //
  1426. def int_aarch64_sve_cmpeq : AdvSIMD_SVE_Compare_Intrinsic;
  1427. def int_aarch64_sve_cmpge : AdvSIMD_SVE_Compare_Intrinsic;
  1428. def int_aarch64_sve_cmpgt : AdvSIMD_SVE_Compare_Intrinsic;
  1429. def int_aarch64_sve_cmphi : AdvSIMD_SVE_Compare_Intrinsic;
  1430. def int_aarch64_sve_cmphs : AdvSIMD_SVE_Compare_Intrinsic;
  1431. def int_aarch64_sve_cmpne : AdvSIMD_SVE_Compare_Intrinsic;
  1432. def int_aarch64_sve_cmpeq_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
  1433. def int_aarch64_sve_cmpge_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
  1434. def int_aarch64_sve_cmpgt_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
  1435. def int_aarch64_sve_cmphi_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
  1436. def int_aarch64_sve_cmphs_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
  1437. def int_aarch64_sve_cmple_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
  1438. def int_aarch64_sve_cmplo_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
  1439. def int_aarch64_sve_cmpls_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
  1440. def int_aarch64_sve_cmplt_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
  1441. def int_aarch64_sve_cmpne_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
  1442. //
  1443. // Counting bits
  1444. //
  1445. def int_aarch64_sve_cls : AdvSIMD_Merged1VectorArg_Intrinsic;
  1446. def int_aarch64_sve_clz : AdvSIMD_Merged1VectorArg_Intrinsic;
  1447. def int_aarch64_sve_cnt : AdvSIMD_SVE_CNT_Intrinsic;
  1448. //
  1449. // Counting elements
  1450. //
  1451. def int_aarch64_sve_cntb : AdvSIMD_SVE_CNTB_Intrinsic;
  1452. def int_aarch64_sve_cnth : AdvSIMD_SVE_CNTB_Intrinsic;
  1453. def int_aarch64_sve_cntw : AdvSIMD_SVE_CNTB_Intrinsic;
  1454. def int_aarch64_sve_cntd : AdvSIMD_SVE_CNTB_Intrinsic;
  1455. def int_aarch64_sve_cntp : AdvSIMD_SVE_CNTP_Intrinsic;
  1456. //
  1457. // FFR manipulation
  1458. //
  1459. def int_aarch64_sve_rdffr : ClangBuiltin<"__builtin_sve_svrdffr">, DefaultAttrsIntrinsic<[llvm_nxv16i1_ty], [], [IntrReadMem, IntrInaccessibleMemOnly]>;
  1460. def int_aarch64_sve_rdffr_z : ClangBuiltin<"__builtin_sve_svrdffr_z">, DefaultAttrsIntrinsic<[llvm_nxv16i1_ty], [llvm_nxv16i1_ty], [IntrReadMem, IntrInaccessibleMemOnly]>;
  1461. def int_aarch64_sve_setffr : ClangBuiltin<"__builtin_sve_svsetffr">, DefaultAttrsIntrinsic<[], [], [IntrWriteMem, IntrInaccessibleMemOnly]>;
  1462. def int_aarch64_sve_wrffr : ClangBuiltin<"__builtin_sve_svwrffr">, DefaultAttrsIntrinsic<[], [llvm_nxv16i1_ty], [IntrWriteMem, IntrInaccessibleMemOnly]>;
  1463. //
  1464. // Saturating scalar arithmetic
  1465. //
  1466. def int_aarch64_sve_sqdech : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1467. def int_aarch64_sve_sqdecw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1468. def int_aarch64_sve_sqdecd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1469. def int_aarch64_sve_sqdecp : AdvSIMD_SVE_Saturating_Intrinsic;
  1470. def int_aarch64_sve_sqdecb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1471. def int_aarch64_sve_sqdecb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1472. def int_aarch64_sve_sqdech_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1473. def int_aarch64_sve_sqdech_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1474. def int_aarch64_sve_sqdecw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1475. def int_aarch64_sve_sqdecw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1476. def int_aarch64_sve_sqdecd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1477. def int_aarch64_sve_sqdecd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1478. def int_aarch64_sve_sqdecp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty>;
  1479. def int_aarch64_sve_sqdecp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty>;
  1480. def int_aarch64_sve_sqinch : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1481. def int_aarch64_sve_sqincw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1482. def int_aarch64_sve_sqincd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1483. def int_aarch64_sve_sqincp : AdvSIMD_SVE_Saturating_Intrinsic;
  1484. def int_aarch64_sve_sqincb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1485. def int_aarch64_sve_sqincb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1486. def int_aarch64_sve_sqinch_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1487. def int_aarch64_sve_sqinch_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1488. def int_aarch64_sve_sqincw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1489. def int_aarch64_sve_sqincw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1490. def int_aarch64_sve_sqincd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1491. def int_aarch64_sve_sqincd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1492. def int_aarch64_sve_sqincp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty>;
  1493. def int_aarch64_sve_sqincp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty>;
  1494. def int_aarch64_sve_uqdech : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1495. def int_aarch64_sve_uqdecw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1496. def int_aarch64_sve_uqdecd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1497. def int_aarch64_sve_uqdecp : AdvSIMD_SVE_Saturating_Intrinsic;
  1498. def int_aarch64_sve_uqdecb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1499. def int_aarch64_sve_uqdecb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1500. def int_aarch64_sve_uqdech_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1501. def int_aarch64_sve_uqdech_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1502. def int_aarch64_sve_uqdecw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1503. def int_aarch64_sve_uqdecw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1504. def int_aarch64_sve_uqdecd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1505. def int_aarch64_sve_uqdecd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1506. def int_aarch64_sve_uqdecp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty>;
  1507. def int_aarch64_sve_uqdecp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty>;
  1508. def int_aarch64_sve_uqinch : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1509. def int_aarch64_sve_uqincw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1510. def int_aarch64_sve_uqincd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
  1511. def int_aarch64_sve_uqincp : AdvSIMD_SVE_Saturating_Intrinsic;
  1512. def int_aarch64_sve_uqincb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1513. def int_aarch64_sve_uqincb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1514. def int_aarch64_sve_uqinch_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1515. def int_aarch64_sve_uqinch_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1516. def int_aarch64_sve_uqincw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1517. def int_aarch64_sve_uqincw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1518. def int_aarch64_sve_uqincd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
  1519. def int_aarch64_sve_uqincd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
  1520. def int_aarch64_sve_uqincp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty>;
  1521. def int_aarch64_sve_uqincp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty>;
  1522. //
  1523. // Reversal
  1524. //
  1525. def int_aarch64_sve_rbit : AdvSIMD_Merged1VectorArg_Intrinsic;
  1526. def int_aarch64_sve_revb : AdvSIMD_Merged1VectorArg_Intrinsic;
  1527. def int_aarch64_sve_revh : AdvSIMD_Merged1VectorArg_Intrinsic;
  1528. def int_aarch64_sve_revw : AdvSIMD_Merged1VectorArg_Intrinsic;
  1529. //
  1530. // Permutations and selection
  1531. //
  1532. def int_aarch64_sve_clasta : AdvSIMD_Pred2VectorArg_Intrinsic;
  1533. def int_aarch64_sve_clasta_n : AdvSIMD_SVE_ReduceWithInit_Intrinsic;
  1534. def int_aarch64_sve_clastb : AdvSIMD_Pred2VectorArg_Intrinsic;
  1535. def int_aarch64_sve_clastb_n : AdvSIMD_SVE_ReduceWithInit_Intrinsic;
  1536. def int_aarch64_sve_compact : AdvSIMD_Pred1VectorArg_Intrinsic;
  1537. def int_aarch64_sve_dupq_lane : AdvSIMD_SVE_DUPQ_Intrinsic;
  1538. def int_aarch64_sve_ext : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1539. def int_aarch64_sve_sel : AdvSIMD_Pred2VectorArg_Intrinsic;
  1540. def int_aarch64_sve_lasta : AdvSIMD_SVE_Reduce_Intrinsic;
  1541. def int_aarch64_sve_lastb : AdvSIMD_SVE_Reduce_Intrinsic;
  1542. def int_aarch64_sve_rev : AdvSIMD_1VectorArg_Intrinsic;
  1543. def int_aarch64_sve_rev_b16 : AdvSIMD_SVE_2SVBoolArg_Intrinsic;
  1544. def int_aarch64_sve_rev_b32 : AdvSIMD_SVE_2SVBoolArg_Intrinsic;
  1545. def int_aarch64_sve_rev_b64 : AdvSIMD_SVE_2SVBoolArg_Intrinsic;
  1546. def int_aarch64_sve_splice : AdvSIMD_Pred2VectorArg_Intrinsic;
  1547. def int_aarch64_sve_sunpkhi : AdvSIMD_SVE_Unpack_Intrinsic;
  1548. def int_aarch64_sve_sunpklo : AdvSIMD_SVE_Unpack_Intrinsic;
  1549. def int_aarch64_sve_tbl : AdvSIMD_SVE_TBL_Intrinsic;
  1550. def int_aarch64_sve_trn1 : AdvSIMD_2VectorArg_Intrinsic;
  1551. def int_aarch64_sve_trn1_b16 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1552. def int_aarch64_sve_trn1_b32 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1553. def int_aarch64_sve_trn1_b64 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1554. def int_aarch64_sve_trn2 : AdvSIMD_2VectorArg_Intrinsic;
  1555. def int_aarch64_sve_trn2_b16 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1556. def int_aarch64_sve_trn2_b32 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1557. def int_aarch64_sve_trn2_b64 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1558. def int_aarch64_sve_trn1q : AdvSIMD_2VectorArg_Intrinsic;
  1559. def int_aarch64_sve_trn2q : AdvSIMD_2VectorArg_Intrinsic;
  1560. def int_aarch64_sve_uunpkhi : AdvSIMD_SVE_Unpack_Intrinsic;
  1561. def int_aarch64_sve_uunpklo : AdvSIMD_SVE_Unpack_Intrinsic;
  1562. def int_aarch64_sve_uzp1 : AdvSIMD_2VectorArg_Intrinsic;
  1563. def int_aarch64_sve_uzp1_b16 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1564. def int_aarch64_sve_uzp1_b32 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1565. def int_aarch64_sve_uzp1_b64 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1566. def int_aarch64_sve_uzp2 : AdvSIMD_2VectorArg_Intrinsic;
  1567. def int_aarch64_sve_uzp2_b16 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1568. def int_aarch64_sve_uzp2_b32 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1569. def int_aarch64_sve_uzp2_b64 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1570. def int_aarch64_sve_uzp1q : AdvSIMD_2VectorArg_Intrinsic;
  1571. def int_aarch64_sve_uzp2q : AdvSIMD_2VectorArg_Intrinsic;
  1572. def int_aarch64_sve_zip1 : AdvSIMD_2VectorArg_Intrinsic;
  1573. def int_aarch64_sve_zip1_b16 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1574. def int_aarch64_sve_zip1_b32 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1575. def int_aarch64_sve_zip1_b64 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1576. def int_aarch64_sve_zip2 : AdvSIMD_2VectorArg_Intrinsic;
  1577. def int_aarch64_sve_zip2_b16 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1578. def int_aarch64_sve_zip2_b32 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1579. def int_aarch64_sve_zip2_b64 : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
  1580. def int_aarch64_sve_zip1q : AdvSIMD_2VectorArg_Intrinsic;
  1581. def int_aarch64_sve_zip2q : AdvSIMD_2VectorArg_Intrinsic;
  1582. //
  1583. // Logical operations
  1584. //
  1585. def int_aarch64_sve_and : AdvSIMD_Pred2VectorArg_Intrinsic;
  1586. def int_aarch64_sve_bic : AdvSIMD_Pred2VectorArg_Intrinsic;
  1587. def int_aarch64_sve_cnot : AdvSIMD_Merged1VectorArg_Intrinsic;
  1588. def int_aarch64_sve_eor : AdvSIMD_Pred2VectorArg_Intrinsic;
  1589. def int_aarch64_sve_not : AdvSIMD_Merged1VectorArg_Intrinsic;
  1590. def int_aarch64_sve_orr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1591. //
  1592. // Conversion
  1593. //
  1594. def int_aarch64_sve_sxtb : AdvSIMD_Merged1VectorArg_Intrinsic;
  1595. def int_aarch64_sve_sxth : AdvSIMD_Merged1VectorArg_Intrinsic;
  1596. def int_aarch64_sve_sxtw : AdvSIMD_Merged1VectorArg_Intrinsic;
  1597. def int_aarch64_sve_uxtb : AdvSIMD_Merged1VectorArg_Intrinsic;
  1598. def int_aarch64_sve_uxth : AdvSIMD_Merged1VectorArg_Intrinsic;
  1599. def int_aarch64_sve_uxtw : AdvSIMD_Merged1VectorArg_Intrinsic;
  1600. //
  1601. // While comparisons
  1602. //
  1603. def int_aarch64_sve_whilele : AdvSIMD_SVE_WHILE_Intrinsic;
  1604. def int_aarch64_sve_whilelo : AdvSIMD_SVE_WHILE_Intrinsic;
  1605. def int_aarch64_sve_whilels : AdvSIMD_SVE_WHILE_Intrinsic;
  1606. def int_aarch64_sve_whilelt : AdvSIMD_SVE_WHILE_Intrinsic;
  1607. def int_aarch64_sve_whilege : AdvSIMD_SVE_WHILE_Intrinsic;
  1608. def int_aarch64_sve_whilegt : AdvSIMD_SVE_WHILE_Intrinsic;
  1609. def int_aarch64_sve_whilehs : AdvSIMD_SVE_WHILE_Intrinsic;
  1610. def int_aarch64_sve_whilehi : AdvSIMD_SVE_WHILE_Intrinsic;
  1611. //
  1612. // Floating-point arithmetic
  1613. //
  1614. def int_aarch64_sve_fabd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1615. def int_aarch64_sve_fabs : AdvSIMD_Merged1VectorArg_Intrinsic;
  1616. def int_aarch64_sve_fadd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1617. def int_aarch64_sve_fcadd : AdvSIMD_SVE_CADD_Intrinsic;
  1618. def int_aarch64_sve_fcmla : AdvSIMD_SVE_CMLA_Intrinsic;
  1619. def int_aarch64_sve_fcmla_lane : AdvSIMD_SVE_CMLA_LANE_Intrinsic;
  1620. def int_aarch64_sve_fdiv : AdvSIMD_Pred2VectorArg_Intrinsic;
  1621. def int_aarch64_sve_fdivr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1622. def int_aarch64_sve_fexpa_x : AdvSIMD_SVE_EXPA_Intrinsic;
  1623. def int_aarch64_sve_fmad : AdvSIMD_Pred3VectorArg_Intrinsic;
  1624. def int_aarch64_sve_fmax : AdvSIMD_Pred2VectorArg_Intrinsic;
  1625. def int_aarch64_sve_fmaxnm : AdvSIMD_Pred2VectorArg_Intrinsic;
  1626. def int_aarch64_sve_fmin : AdvSIMD_Pred2VectorArg_Intrinsic;
  1627. def int_aarch64_sve_fminnm : AdvSIMD_Pred2VectorArg_Intrinsic;
  1628. def int_aarch64_sve_fmla : AdvSIMD_Pred3VectorArg_Intrinsic;
  1629. def int_aarch64_sve_fmla_lane : AdvSIMD_3VectorArgIndexed_Intrinsic;
  1630. def int_aarch64_sve_fmls : AdvSIMD_Pred3VectorArg_Intrinsic;
  1631. def int_aarch64_sve_fmls_lane : AdvSIMD_3VectorArgIndexed_Intrinsic;
  1632. def int_aarch64_sve_fmsb : AdvSIMD_Pred3VectorArg_Intrinsic;
  1633. def int_aarch64_sve_fmul : AdvSIMD_Pred2VectorArg_Intrinsic;
  1634. def int_aarch64_sve_fmulx : AdvSIMD_Pred2VectorArg_Intrinsic;
  1635. def int_aarch64_sve_fneg : AdvSIMD_Merged1VectorArg_Intrinsic;
  1636. def int_aarch64_sve_fmul_lane : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1637. def int_aarch64_sve_fnmad : AdvSIMD_Pred3VectorArg_Intrinsic;
  1638. def int_aarch64_sve_fnmla : AdvSIMD_Pred3VectorArg_Intrinsic;
  1639. def int_aarch64_sve_fnmls : AdvSIMD_Pred3VectorArg_Intrinsic;
  1640. def int_aarch64_sve_fnmsb : AdvSIMD_Pred3VectorArg_Intrinsic;
  1641. def int_aarch64_sve_frecpe_x : AdvSIMD_1VectorArg_Intrinsic;
  1642. def int_aarch64_sve_frecps_x : AdvSIMD_2VectorArg_Intrinsic;
  1643. def int_aarch64_sve_frecpx : AdvSIMD_Merged1VectorArg_Intrinsic;
  1644. def int_aarch64_sve_frinta : AdvSIMD_Merged1VectorArg_Intrinsic;
  1645. def int_aarch64_sve_frinti : AdvSIMD_Merged1VectorArg_Intrinsic;
  1646. def int_aarch64_sve_frintm : AdvSIMD_Merged1VectorArg_Intrinsic;
  1647. def int_aarch64_sve_frintn : AdvSIMD_Merged1VectorArg_Intrinsic;
  1648. def int_aarch64_sve_frintp : AdvSIMD_Merged1VectorArg_Intrinsic;
  1649. def int_aarch64_sve_frintx : AdvSIMD_Merged1VectorArg_Intrinsic;
  1650. def int_aarch64_sve_frintz : AdvSIMD_Merged1VectorArg_Intrinsic;
  1651. def int_aarch64_sve_frsqrte_x : AdvSIMD_1VectorArg_Intrinsic;
  1652. def int_aarch64_sve_frsqrts_x : AdvSIMD_2VectorArg_Intrinsic;
  1653. def int_aarch64_sve_fscale : AdvSIMD_SVE_SCALE_Intrinsic;
  1654. def int_aarch64_sve_fsqrt : AdvSIMD_Merged1VectorArg_Intrinsic;
  1655. def int_aarch64_sve_fsub : AdvSIMD_Pred2VectorArg_Intrinsic;
  1656. def int_aarch64_sve_fsubr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1657. def int_aarch64_sve_ftmad_x : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1658. def int_aarch64_sve_ftsmul_x : AdvSIMD_SVE_TSMUL_Intrinsic;
  1659. def int_aarch64_sve_ftssel_x : AdvSIMD_SVE_TSMUL_Intrinsic;
  1660. //
  1661. // Floating-point reductions
  1662. //
  1663. def int_aarch64_sve_fadda : AdvSIMD_SVE_ReduceWithInit_Intrinsic;
  1664. def int_aarch64_sve_faddv : AdvSIMD_SVE_Reduce_Intrinsic;
  1665. def int_aarch64_sve_fmaxv : AdvSIMD_SVE_Reduce_Intrinsic;
  1666. def int_aarch64_sve_fmaxnmv : AdvSIMD_SVE_Reduce_Intrinsic;
  1667. def int_aarch64_sve_fminv : AdvSIMD_SVE_Reduce_Intrinsic;
  1668. def int_aarch64_sve_fminnmv : AdvSIMD_SVE_Reduce_Intrinsic;
  1669. //
  1670. // Floating-point conversions
  1671. //
  1672. def int_aarch64_sve_fcvt : AdvSIMD_SVE_FCVT_Intrinsic;
  1673. def int_aarch64_sve_fcvtzs : AdvSIMD_SVE_FCVTZS_Intrinsic;
  1674. def int_aarch64_sve_fcvtzu : AdvSIMD_SVE_FCVTZS_Intrinsic;
  1675. def int_aarch64_sve_scvtf : AdvSIMD_SVE_SCVTF_Intrinsic;
  1676. def int_aarch64_sve_ucvtf : AdvSIMD_SVE_SCVTF_Intrinsic;
  1677. //
  1678. // Floating-point comparisons
  1679. //
  1680. def int_aarch64_sve_facge : AdvSIMD_SVE_Compare_Intrinsic;
  1681. def int_aarch64_sve_facgt : AdvSIMD_SVE_Compare_Intrinsic;
  1682. def int_aarch64_sve_fcmpeq : AdvSIMD_SVE_Compare_Intrinsic;
  1683. def int_aarch64_sve_fcmpge : AdvSIMD_SVE_Compare_Intrinsic;
  1684. def int_aarch64_sve_fcmpgt : AdvSIMD_SVE_Compare_Intrinsic;
  1685. def int_aarch64_sve_fcmpne : AdvSIMD_SVE_Compare_Intrinsic;
  1686. def int_aarch64_sve_fcmpuo : AdvSIMD_SVE_Compare_Intrinsic;
  1687. def int_aarch64_sve_fcvtzs_i32f16 : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
  1688. def int_aarch64_sve_fcvtzs_i32f64 : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
  1689. def int_aarch64_sve_fcvtzs_i64f16 : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
  1690. def int_aarch64_sve_fcvtzs_i64f32 : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
  1691. def int_aarch64_sve_fcvt_bf16f32 : Builtin_SVCVT<llvm_nxv8bf16_ty, llvm_nxv8i1_ty, llvm_nxv4f32_ty>;
  1692. def int_aarch64_sve_fcvtnt_bf16f32 : Builtin_SVCVT<llvm_nxv8bf16_ty, llvm_nxv8i1_ty, llvm_nxv4f32_ty>;
  1693. def int_aarch64_sve_fcvtzu_i32f16 : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
  1694. def int_aarch64_sve_fcvtzu_i32f64 : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
  1695. def int_aarch64_sve_fcvtzu_i64f16 : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
  1696. def int_aarch64_sve_fcvtzu_i64f32 : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
  1697. def int_aarch64_sve_fcvt_f16f32 : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
  1698. def int_aarch64_sve_fcvt_f16f64 : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
  1699. def int_aarch64_sve_fcvt_f32f64 : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
  1700. def int_aarch64_sve_fcvt_f32f16 : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
  1701. def int_aarch64_sve_fcvt_f64f16 : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
  1702. def int_aarch64_sve_fcvt_f64f32 : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
  1703. def int_aarch64_sve_fcvtlt_f32f16 : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
  1704. def int_aarch64_sve_fcvtlt_f64f32 : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
  1705. def int_aarch64_sve_fcvtnt_f16f32 : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
  1706. def int_aarch64_sve_fcvtnt_f32f64 : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
  1707. def int_aarch64_sve_fcvtx_f32f64 : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
  1708. def int_aarch64_sve_fcvtxnt_f32f64 : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
  1709. def int_aarch64_sve_scvtf_f16i32 : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4i32_ty>;
  1710. def int_aarch64_sve_scvtf_f16i64 : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
  1711. def int_aarch64_sve_scvtf_f32i64 : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
  1712. def int_aarch64_sve_scvtf_f64i32 : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4i32_ty>;
  1713. def int_aarch64_sve_ucvtf_f16i32 : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4i32_ty>;
  1714. def int_aarch64_sve_ucvtf_f16i64 : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
  1715. def int_aarch64_sve_ucvtf_f32i64 : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
  1716. def int_aarch64_sve_ucvtf_f64i32 : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4i32_ty>;
  1717. //
  1718. // Predicate creation
  1719. //
  1720. def int_aarch64_sve_ptrue : AdvSIMD_SVE_PTRUE_Intrinsic;
  1721. //
  1722. // Predicate operations
  1723. //
  1724. def int_aarch64_sve_and_z : AdvSIMD_Pred2VectorArg_Intrinsic;
  1725. def int_aarch64_sve_bic_z : AdvSIMD_Pred2VectorArg_Intrinsic;
  1726. def int_aarch64_sve_brka : AdvSIMD_Merged1VectorArg_Intrinsic;
  1727. def int_aarch64_sve_brka_z : AdvSIMD_Pred1VectorArg_Intrinsic;
  1728. def int_aarch64_sve_brkb : AdvSIMD_Merged1VectorArg_Intrinsic;
  1729. def int_aarch64_sve_brkb_z : AdvSIMD_Pred1VectorArg_Intrinsic;
  1730. def int_aarch64_sve_brkn_z : AdvSIMD_Pred2VectorArg_Intrinsic;
  1731. def int_aarch64_sve_brkpa_z : AdvSIMD_Pred2VectorArg_Intrinsic;
  1732. def int_aarch64_sve_brkpb_z : AdvSIMD_Pred2VectorArg_Intrinsic;
  1733. def int_aarch64_sve_eor_z : AdvSIMD_Pred2VectorArg_Intrinsic;
  1734. def int_aarch64_sve_nand_z : AdvSIMD_Pred2VectorArg_Intrinsic;
  1735. def int_aarch64_sve_nor_z : AdvSIMD_Pred2VectorArg_Intrinsic;
  1736. def int_aarch64_sve_orn_z : AdvSIMD_Pred2VectorArg_Intrinsic;
  1737. def int_aarch64_sve_orr_z : AdvSIMD_Pred2VectorArg_Intrinsic;
  1738. def int_aarch64_sve_pfirst : AdvSIMD_Pred1VectorArg_Intrinsic;
  1739. def int_aarch64_sve_pnext : AdvSIMD_Pred1VectorArg_Intrinsic;
  1740. def int_aarch64_sve_punpkhi : AdvSIMD_SVE_PUNPKHI_Intrinsic;
  1741. def int_aarch64_sve_punpklo : AdvSIMD_SVE_PUNPKHI_Intrinsic;
  1742. //
  1743. // Testing predicates
  1744. //
  1745. def int_aarch64_sve_ptest_any : AdvSIMD_SVE_PTEST_Intrinsic;
  1746. def int_aarch64_sve_ptest_first : AdvSIMD_SVE_PTEST_Intrinsic;
  1747. def int_aarch64_sve_ptest_last : AdvSIMD_SVE_PTEST_Intrinsic;
  1748. //
  1749. // Reinterpreting data
  1750. //
  1751. def int_aarch64_sve_convert_from_svbool : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  1752. [llvm_nxv16i1_ty],
  1753. [IntrNoMem]>;
  1754. def int_aarch64_sve_convert_to_svbool : DefaultAttrsIntrinsic<[llvm_nxv16i1_ty],
  1755. [llvm_anyvector_ty],
  1756. [IntrNoMem]>;
  1757. //
  1758. // Gather loads: scalar base + vector offsets
  1759. //
  1760. // 64 bit unscaled offsets
  1761. def int_aarch64_sve_ld1_gather : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
  1762. // 64 bit scaled offsets
  1763. def int_aarch64_sve_ld1_gather_index : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
  1764. // 32 bit unscaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
  1765. def int_aarch64_sve_ld1_gather_sxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
  1766. def int_aarch64_sve_ld1_gather_uxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
  1767. // 32 bit scaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
  1768. def int_aarch64_sve_ld1_gather_sxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
  1769. def int_aarch64_sve_ld1_gather_uxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
  1770. //
  1771. // Gather loads: vector base + scalar offset
  1772. //
  1773. def int_aarch64_sve_ld1_gather_scalar_offset : AdvSIMD_GatherLoad_VS_Intrinsic;
  1774. //
  1775. // First-faulting gather loads: scalar base + vector offsets
  1776. //
  1777. // 64 bit unscaled offsets
  1778. def int_aarch64_sve_ldff1_gather : AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic;
  1779. // 64 bit scaled offsets
  1780. def int_aarch64_sve_ldff1_gather_index : AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic;
  1781. // 32 bit unscaled offsets, sign (sxtw) or zero (uxtw) extended to 64 bits
  1782. def int_aarch64_sve_ldff1_gather_sxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
  1783. def int_aarch64_sve_ldff1_gather_uxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
  1784. // 32 bit scaled offsets, sign (sxtw) or zero (uxtw) extended to 64 bits
  1785. def int_aarch64_sve_ldff1_gather_sxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
  1786. def int_aarch64_sve_ldff1_gather_uxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
  1787. //
  1788. // First-faulting gather loads: vector base + scalar offset
  1789. //
  1790. def int_aarch64_sve_ldff1_gather_scalar_offset : AdvSIMD_GatherLoad_VS_WriteFFR_Intrinsic;
  1791. //
  1792. // Non-temporal gather loads: scalar base + vector offsets
  1793. //
  1794. // 64 bit unscaled offsets
  1795. def int_aarch64_sve_ldnt1_gather : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
  1796. // 64 bit indices
  1797. def int_aarch64_sve_ldnt1_gather_index : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
  1798. // 32 bit unscaled offsets, zero (zxtw) extended to 64 bits
  1799. def int_aarch64_sve_ldnt1_gather_uxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
  1800. //
  1801. // Non-temporal gather loads: vector base + scalar offset
  1802. //
  1803. def int_aarch64_sve_ldnt1_gather_scalar_offset : AdvSIMD_GatherLoad_VS_Intrinsic;
  1804. //
  1805. // Scatter stores: scalar base + vector offsets
  1806. //
  1807. // 64 bit unscaled offsets
  1808. def int_aarch64_sve_st1_scatter : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
  1809. // 64 bit scaled offsets
  1810. def int_aarch64_sve_st1_scatter_index
  1811. : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
  1812. // 32 bit unscaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
  1813. def int_aarch64_sve_st1_scatter_sxtw
  1814. : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
  1815. def int_aarch64_sve_st1_scatter_uxtw
  1816. : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
  1817. // 32 bit scaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
  1818. def int_aarch64_sve_st1_scatter_sxtw_index
  1819. : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
  1820. def int_aarch64_sve_st1_scatter_uxtw_index
  1821. : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
  1822. //
  1823. // Scatter stores: vector base + scalar offset
  1824. //
  1825. def int_aarch64_sve_st1_scatter_scalar_offset : AdvSIMD_ScatterStore_VS_Intrinsic;
  1826. //
  1827. // Non-temporal scatter stores: scalar base + vector offsets
  1828. //
  1829. // 64 bit unscaled offsets
  1830. def int_aarch64_sve_stnt1_scatter : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
  1831. // 64 bit indices
  1832. def int_aarch64_sve_stnt1_scatter_index
  1833. : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
  1834. // 32 bit unscaled offsets, zero (zxtw) extended to 64 bits
  1835. def int_aarch64_sve_stnt1_scatter_uxtw : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
  1836. //
  1837. // Non-temporal scatter stores: vector base + scalar offset
  1838. //
  1839. def int_aarch64_sve_stnt1_scatter_scalar_offset : AdvSIMD_ScatterStore_VS_Intrinsic;
  1840. //
  1841. // SVE2 - Uniform DSP operations
  1842. //
  1843. def int_aarch64_sve_saba : AdvSIMD_3VectorArg_Intrinsic;
  1844. def int_aarch64_sve_shadd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1845. def int_aarch64_sve_shsub : AdvSIMD_Pred2VectorArg_Intrinsic;
  1846. def int_aarch64_sve_shsubr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1847. def int_aarch64_sve_sli : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1848. def int_aarch64_sve_sqabs : AdvSIMD_Merged1VectorArg_Intrinsic;
  1849. def int_aarch64_sve_sqadd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1850. def int_aarch64_sve_sqdmulh : AdvSIMD_2VectorArg_Intrinsic;
  1851. def int_aarch64_sve_sqdmulh_lane : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1852. def int_aarch64_sve_sqneg : AdvSIMD_Merged1VectorArg_Intrinsic;
  1853. def int_aarch64_sve_sqrdmlah : AdvSIMD_3VectorArg_Intrinsic;
  1854. def int_aarch64_sve_sqrdmlah_lane : AdvSIMD_3VectorArgIndexed_Intrinsic;
  1855. def int_aarch64_sve_sqrdmlsh : AdvSIMD_3VectorArg_Intrinsic;
  1856. def int_aarch64_sve_sqrdmlsh_lane : AdvSIMD_3VectorArgIndexed_Intrinsic;
  1857. def int_aarch64_sve_sqrdmulh : AdvSIMD_2VectorArg_Intrinsic;
  1858. def int_aarch64_sve_sqrdmulh_lane : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1859. def int_aarch64_sve_sqrshl : AdvSIMD_Pred2VectorArg_Intrinsic;
  1860. def int_aarch64_sve_sqshl : AdvSIMD_Pred2VectorArg_Intrinsic;
  1861. def int_aarch64_sve_sqshlu : AdvSIMD_SVE_ShiftByImm_Intrinsic;
  1862. def int_aarch64_sve_sqsub : AdvSIMD_Pred2VectorArg_Intrinsic;
  1863. def int_aarch64_sve_sqsubr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1864. def int_aarch64_sve_srhadd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1865. def int_aarch64_sve_sri : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1866. def int_aarch64_sve_srshl : AdvSIMD_Pred2VectorArg_Intrinsic;
  1867. def int_aarch64_sve_srshr : AdvSIMD_SVE_ShiftByImm_Intrinsic;
  1868. def int_aarch64_sve_srsra : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1869. def int_aarch64_sve_ssra : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1870. def int_aarch64_sve_suqadd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1871. def int_aarch64_sve_uaba : AdvSIMD_3VectorArg_Intrinsic;
  1872. def int_aarch64_sve_uhadd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1873. def int_aarch64_sve_uhsub : AdvSIMD_Pred2VectorArg_Intrinsic;
  1874. def int_aarch64_sve_uhsubr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1875. def int_aarch64_sve_uqadd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1876. def int_aarch64_sve_uqrshl : AdvSIMD_Pred2VectorArg_Intrinsic;
  1877. def int_aarch64_sve_uqshl : AdvSIMD_Pred2VectorArg_Intrinsic;
  1878. def int_aarch64_sve_uqsub : AdvSIMD_Pred2VectorArg_Intrinsic;
  1879. def int_aarch64_sve_uqsubr : AdvSIMD_Pred2VectorArg_Intrinsic;
  1880. def int_aarch64_sve_urecpe : AdvSIMD_Merged1VectorArg_Intrinsic;
  1881. def int_aarch64_sve_urhadd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1882. def int_aarch64_sve_urshl : AdvSIMD_Pred2VectorArg_Intrinsic;
  1883. def int_aarch64_sve_urshr : AdvSIMD_SVE_ShiftByImm_Intrinsic;
  1884. def int_aarch64_sve_ursqrte : AdvSIMD_Merged1VectorArg_Intrinsic;
  1885. def int_aarch64_sve_ursra : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1886. def int_aarch64_sve_usqadd : AdvSIMD_Pred2VectorArg_Intrinsic;
  1887. def int_aarch64_sve_usra : AdvSIMD_2VectorArgIndexed_Intrinsic;
  1888. //
  1889. // SVE2 - Widening DSP operations
  1890. //
  1891. def int_aarch64_sve_sabalb : SVE2_3VectorArg_Long_Intrinsic;
  1892. def int_aarch64_sve_sabalt : SVE2_3VectorArg_Long_Intrinsic;
  1893. def int_aarch64_sve_sabdlb : SVE2_2VectorArg_Long_Intrinsic;
  1894. def int_aarch64_sve_sabdlt : SVE2_2VectorArg_Long_Intrinsic;
  1895. def int_aarch64_sve_saddlb : SVE2_2VectorArg_Long_Intrinsic;
  1896. def int_aarch64_sve_saddlt : SVE2_2VectorArg_Long_Intrinsic;
  1897. def int_aarch64_sve_saddwb : SVE2_2VectorArg_Wide_Intrinsic;
  1898. def int_aarch64_sve_saddwt : SVE2_2VectorArg_Wide_Intrinsic;
  1899. def int_aarch64_sve_sshllb : SVE2_1VectorArg_Long_Intrinsic;
  1900. def int_aarch64_sve_sshllt : SVE2_1VectorArg_Long_Intrinsic;
  1901. def int_aarch64_sve_ssublb : SVE2_2VectorArg_Long_Intrinsic;
  1902. def int_aarch64_sve_ssublt : SVE2_2VectorArg_Long_Intrinsic;
  1903. def int_aarch64_sve_ssubwb : SVE2_2VectorArg_Wide_Intrinsic;
  1904. def int_aarch64_sve_ssubwt : SVE2_2VectorArg_Wide_Intrinsic;
  1905. def int_aarch64_sve_uabalb : SVE2_3VectorArg_Long_Intrinsic;
  1906. def int_aarch64_sve_uabalt : SVE2_3VectorArg_Long_Intrinsic;
  1907. def int_aarch64_sve_uabdlb : SVE2_2VectorArg_Long_Intrinsic;
  1908. def int_aarch64_sve_uabdlt : SVE2_2VectorArg_Long_Intrinsic;
  1909. def int_aarch64_sve_uaddlb : SVE2_2VectorArg_Long_Intrinsic;
  1910. def int_aarch64_sve_uaddlt : SVE2_2VectorArg_Long_Intrinsic;
  1911. def int_aarch64_sve_uaddwb : SVE2_2VectorArg_Wide_Intrinsic;
  1912. def int_aarch64_sve_uaddwt : SVE2_2VectorArg_Wide_Intrinsic;
  1913. def int_aarch64_sve_ushllb : SVE2_1VectorArg_Long_Intrinsic;
  1914. def int_aarch64_sve_ushllt : SVE2_1VectorArg_Long_Intrinsic;
  1915. def int_aarch64_sve_usublb : SVE2_2VectorArg_Long_Intrinsic;
  1916. def int_aarch64_sve_usublt : SVE2_2VectorArg_Long_Intrinsic;
  1917. def int_aarch64_sve_usubwb : SVE2_2VectorArg_Wide_Intrinsic;
  1918. def int_aarch64_sve_usubwt : SVE2_2VectorArg_Wide_Intrinsic;
  1919. //
  1920. // SVE2 - Non-widening pairwise arithmetic
  1921. //
  1922. def int_aarch64_sve_addp : AdvSIMD_Pred2VectorArg_Intrinsic;
  1923. def int_aarch64_sve_faddp : AdvSIMD_Pred2VectorArg_Intrinsic;
  1924. def int_aarch64_sve_fmaxp : AdvSIMD_Pred2VectorArg_Intrinsic;
  1925. def int_aarch64_sve_fmaxnmp : AdvSIMD_Pred2VectorArg_Intrinsic;
  1926. def int_aarch64_sve_fminp : AdvSIMD_Pred2VectorArg_Intrinsic;
  1927. def int_aarch64_sve_fminnmp : AdvSIMD_Pred2VectorArg_Intrinsic;
  1928. def int_aarch64_sve_smaxp : AdvSIMD_Pred2VectorArg_Intrinsic;
  1929. def int_aarch64_sve_sminp : AdvSIMD_Pred2VectorArg_Intrinsic;
  1930. def int_aarch64_sve_umaxp : AdvSIMD_Pred2VectorArg_Intrinsic;
  1931. def int_aarch64_sve_uminp : AdvSIMD_Pred2VectorArg_Intrinsic;
  1932. //
  1933. // SVE2 - Widening pairwise arithmetic
  1934. //
  1935. def int_aarch64_sve_sadalp : SVE2_2VectorArg_Pred_Long_Intrinsic;
  1936. def int_aarch64_sve_uadalp : SVE2_2VectorArg_Pred_Long_Intrinsic;
  1937. //
  1938. // SVE2 - Uniform complex integer arithmetic
  1939. //
  1940. def int_aarch64_sve_cadd_x : AdvSIMD_SVE2_CADD_Intrinsic;
  1941. def int_aarch64_sve_sqcadd_x : AdvSIMD_SVE2_CADD_Intrinsic;
  1942. def int_aarch64_sve_cmla_x : AdvSIMD_SVE2_CMLA_Intrinsic;
  1943. def int_aarch64_sve_cmla_lane_x : AdvSIMD_SVE_CMLA_LANE_Intrinsic;
  1944. def int_aarch64_sve_sqrdcmlah_x : AdvSIMD_SVE2_CMLA_Intrinsic;
  1945. def int_aarch64_sve_sqrdcmlah_lane_x : AdvSIMD_SVE_CMLA_LANE_Intrinsic;
  1946. //
  1947. // SVE2 - Widening complex integer arithmetic
  1948. //
  1949. def int_aarch64_sve_saddlbt : SVE2_2VectorArg_Long_Intrinsic;
  1950. def int_aarch64_sve_ssublbt : SVE2_2VectorArg_Long_Intrinsic;
  1951. def int_aarch64_sve_ssubltb : SVE2_2VectorArg_Long_Intrinsic;
  1952. //
  1953. // SVE2 - Widening complex integer dot product
  1954. //
  1955. def int_aarch64_sve_cdot : AdvSIMD_SVE_DOT_Indexed_Intrinsic;
  1956. def int_aarch64_sve_cdot_lane : AdvSIMD_SVE_CDOT_LANE_Intrinsic;
  1957. //
  1958. // SVE2 - Floating-point widening multiply-accumulate
  1959. //
  1960. def int_aarch64_sve_fmlalb : SVE2_3VectorArg_Long_Intrinsic;
  1961. def int_aarch64_sve_fmlalb_lane : SVE2_3VectorArgIndexed_Long_Intrinsic;
  1962. def int_aarch64_sve_fmlalt : SVE2_3VectorArg_Long_Intrinsic;
  1963. def int_aarch64_sve_fmlalt_lane : SVE2_3VectorArgIndexed_Long_Intrinsic;
  1964. def int_aarch64_sve_fmlslb : SVE2_3VectorArg_Long_Intrinsic;
  1965. def int_aarch64_sve_fmlslb_lane : SVE2_3VectorArgIndexed_Long_Intrinsic;
  1966. def int_aarch64_sve_fmlslt : SVE2_3VectorArg_Long_Intrinsic;
  1967. def int_aarch64_sve_fmlslt_lane : SVE2_3VectorArgIndexed_Long_Intrinsic;
  1968. //
  1969. // SVE2 - Floating-point integer binary logarithm
  1970. //
  1971. def int_aarch64_sve_flogb : AdvSIMD_SVE_LOGB_Intrinsic;
  1972. //
  1973. // SVE2 - Vector histogram count
  1974. //
  1975. def int_aarch64_sve_histcnt : AdvSIMD_Pred2VectorArg_Intrinsic;
  1976. def int_aarch64_sve_histseg : AdvSIMD_2VectorArg_Intrinsic;
  1977. //
  1978. // SVE2 - Character match
  1979. //
  1980. def int_aarch64_sve_match : AdvSIMD_SVE_Compare_Intrinsic;
  1981. def int_aarch64_sve_nmatch : AdvSIMD_SVE_Compare_Intrinsic;
  1982. //
  1983. // SVE2 - Unary narrowing operations
  1984. //
  1985. def int_aarch64_sve_sqxtnb : SVE2_1VectorArg_Narrowing_Intrinsic;
  1986. def int_aarch64_sve_sqxtnt : SVE2_Merged1VectorArg_Narrowing_Intrinsic;
  1987. def int_aarch64_sve_sqxtunb : SVE2_1VectorArg_Narrowing_Intrinsic;
  1988. def int_aarch64_sve_sqxtunt : SVE2_Merged1VectorArg_Narrowing_Intrinsic;
  1989. def int_aarch64_sve_uqxtnb : SVE2_1VectorArg_Narrowing_Intrinsic;
  1990. def int_aarch64_sve_uqxtnt : SVE2_Merged1VectorArg_Narrowing_Intrinsic;
  1991. //
  1992. // SVE2 - Binary narrowing DSP operations
  1993. //
  1994. def int_aarch64_sve_addhnb : SVE2_2VectorArg_Narrowing_Intrinsic;
  1995. def int_aarch64_sve_addhnt : SVE2_Merged2VectorArg_Narrowing_Intrinsic;
  1996. def int_aarch64_sve_raddhnb : SVE2_2VectorArg_Narrowing_Intrinsic;
  1997. def int_aarch64_sve_raddhnt : SVE2_Merged2VectorArg_Narrowing_Intrinsic;
  1998. def int_aarch64_sve_subhnb : SVE2_2VectorArg_Narrowing_Intrinsic;
  1999. def int_aarch64_sve_subhnt : SVE2_Merged2VectorArg_Narrowing_Intrinsic;
  2000. def int_aarch64_sve_rsubhnb : SVE2_2VectorArg_Narrowing_Intrinsic;
  2001. def int_aarch64_sve_rsubhnt : SVE2_Merged2VectorArg_Narrowing_Intrinsic;
  2002. // Narrowing shift right
  2003. def int_aarch64_sve_shrnb : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
  2004. def int_aarch64_sve_shrnt : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
  2005. def int_aarch64_sve_rshrnb : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
  2006. def int_aarch64_sve_rshrnt : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
  2007. // Saturating shift right - signed input/output
  2008. def int_aarch64_sve_sqshrnb : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
  2009. def int_aarch64_sve_sqshrnt : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
  2010. def int_aarch64_sve_sqrshrnb : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
  2011. def int_aarch64_sve_sqrshrnt : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
  2012. // Saturating shift right - unsigned input/output
  2013. def int_aarch64_sve_uqshrnb : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
  2014. def int_aarch64_sve_uqshrnt : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
  2015. def int_aarch64_sve_uqrshrnb : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
  2016. def int_aarch64_sve_uqrshrnt : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
  2017. // Saturating shift right - signed input, unsigned output
  2018. def int_aarch64_sve_sqshrunb : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
  2019. def int_aarch64_sve_sqshrunt : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
  2020. def int_aarch64_sve_sqrshrunb : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
  2021. def int_aarch64_sve_sqrshrunt : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
  2022. // SVE2 MLA LANE.
  2023. def int_aarch64_sve_smlalb_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2024. def int_aarch64_sve_smlalt_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2025. def int_aarch64_sve_umlalb_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2026. def int_aarch64_sve_umlalt_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2027. def int_aarch64_sve_smlslb_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2028. def int_aarch64_sve_smlslt_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2029. def int_aarch64_sve_umlslb_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2030. def int_aarch64_sve_umlslt_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2031. def int_aarch64_sve_smullb_lane : SVE2_2VectorArgIndexed_Long_Intrinsic;
  2032. def int_aarch64_sve_smullt_lane : SVE2_2VectorArgIndexed_Long_Intrinsic;
  2033. def int_aarch64_sve_umullb_lane : SVE2_2VectorArgIndexed_Long_Intrinsic;
  2034. def int_aarch64_sve_umullt_lane : SVE2_2VectorArgIndexed_Long_Intrinsic;
  2035. def int_aarch64_sve_sqdmlalb_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2036. def int_aarch64_sve_sqdmlalt_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2037. def int_aarch64_sve_sqdmlslb_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2038. def int_aarch64_sve_sqdmlslt_lane : SVE2_3VectorArg_Indexed_Intrinsic;
  2039. def int_aarch64_sve_sqdmullb_lane : SVE2_2VectorArgIndexed_Long_Intrinsic;
  2040. def int_aarch64_sve_sqdmullt_lane : SVE2_2VectorArgIndexed_Long_Intrinsic;
  2041. // SVE2 MLA Unpredicated.
  2042. def int_aarch64_sve_smlalb : SVE2_3VectorArg_Long_Intrinsic;
  2043. def int_aarch64_sve_smlalt : SVE2_3VectorArg_Long_Intrinsic;
  2044. def int_aarch64_sve_umlalb : SVE2_3VectorArg_Long_Intrinsic;
  2045. def int_aarch64_sve_umlalt : SVE2_3VectorArg_Long_Intrinsic;
  2046. def int_aarch64_sve_smlslb : SVE2_3VectorArg_Long_Intrinsic;
  2047. def int_aarch64_sve_smlslt : SVE2_3VectorArg_Long_Intrinsic;
  2048. def int_aarch64_sve_umlslb : SVE2_3VectorArg_Long_Intrinsic;
  2049. def int_aarch64_sve_umlslt : SVE2_3VectorArg_Long_Intrinsic;
  2050. def int_aarch64_sve_smullb : SVE2_2VectorArg_Long_Intrinsic;
  2051. def int_aarch64_sve_smullt : SVE2_2VectorArg_Long_Intrinsic;
  2052. def int_aarch64_sve_umullb : SVE2_2VectorArg_Long_Intrinsic;
  2053. def int_aarch64_sve_umullt : SVE2_2VectorArg_Long_Intrinsic;
  2054. def int_aarch64_sve_sqdmlalb : SVE2_3VectorArg_Long_Intrinsic;
  2055. def int_aarch64_sve_sqdmlalt : SVE2_3VectorArg_Long_Intrinsic;
  2056. def int_aarch64_sve_sqdmlslb : SVE2_3VectorArg_Long_Intrinsic;
  2057. def int_aarch64_sve_sqdmlslt : SVE2_3VectorArg_Long_Intrinsic;
  2058. def int_aarch64_sve_sqdmullb : SVE2_2VectorArg_Long_Intrinsic;
  2059. def int_aarch64_sve_sqdmullt : SVE2_2VectorArg_Long_Intrinsic;
  2060. def int_aarch64_sve_sqdmlalbt : SVE2_3VectorArg_Long_Intrinsic;
  2061. def int_aarch64_sve_sqdmlslbt : SVE2_3VectorArg_Long_Intrinsic;
  2062. // SVE2 ADDSUB Long Unpredicated.
  2063. def int_aarch64_sve_adclb : AdvSIMD_3VectorArg_Intrinsic;
  2064. def int_aarch64_sve_adclt : AdvSIMD_3VectorArg_Intrinsic;
  2065. def int_aarch64_sve_sbclb : AdvSIMD_3VectorArg_Intrinsic;
  2066. def int_aarch64_sve_sbclt : AdvSIMD_3VectorArg_Intrinsic;
  2067. //
  2068. // SVE2 - Polynomial arithmetic
  2069. //
  2070. def int_aarch64_sve_eorbt : AdvSIMD_3VectorArg_Intrinsic;
  2071. def int_aarch64_sve_eortb : AdvSIMD_3VectorArg_Intrinsic;
  2072. def int_aarch64_sve_pmullb_pair : AdvSIMD_2VectorArg_Intrinsic;
  2073. def int_aarch64_sve_pmullt_pair : AdvSIMD_2VectorArg_Intrinsic;
  2074. //
  2075. // SVE2 bitwise ternary operations.
  2076. //
  2077. def int_aarch64_sve_eor3 : AdvSIMD_3VectorArg_Intrinsic;
  2078. def int_aarch64_sve_bcax : AdvSIMD_3VectorArg_Intrinsic;
  2079. def int_aarch64_sve_bsl : AdvSIMD_3VectorArg_Intrinsic;
  2080. def int_aarch64_sve_bsl1n : AdvSIMD_3VectorArg_Intrinsic;
  2081. def int_aarch64_sve_bsl2n : AdvSIMD_3VectorArg_Intrinsic;
  2082. def int_aarch64_sve_nbsl : AdvSIMD_3VectorArg_Intrinsic;
  2083. def int_aarch64_sve_xar : AdvSIMD_2VectorArgIndexed_Intrinsic;
  2084. //
  2085. // SVE2 - Optional AES, SHA-3 and SM4
  2086. //
  2087. def int_aarch64_sve_aesd : ClangBuiltin<"__builtin_sve_svaesd_u8">,
  2088. DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
  2089. [llvm_nxv16i8_ty, llvm_nxv16i8_ty],
  2090. [IntrNoMem]>;
  2091. def int_aarch64_sve_aesimc : ClangBuiltin<"__builtin_sve_svaesimc_u8">,
  2092. DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
  2093. [llvm_nxv16i8_ty],
  2094. [IntrNoMem]>;
  2095. def int_aarch64_sve_aese : ClangBuiltin<"__builtin_sve_svaese_u8">,
  2096. DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
  2097. [llvm_nxv16i8_ty, llvm_nxv16i8_ty],
  2098. [IntrNoMem]>;
  2099. def int_aarch64_sve_aesmc : ClangBuiltin<"__builtin_sve_svaesmc_u8">,
  2100. DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
  2101. [llvm_nxv16i8_ty],
  2102. [IntrNoMem]>;
  2103. def int_aarch64_sve_rax1 : ClangBuiltin<"__builtin_sve_svrax1_u64">,
  2104. DefaultAttrsIntrinsic<[llvm_nxv2i64_ty],
  2105. [llvm_nxv2i64_ty, llvm_nxv2i64_ty],
  2106. [IntrNoMem]>;
  2107. def int_aarch64_sve_sm4e : ClangBuiltin<"__builtin_sve_svsm4e_u32">,
  2108. DefaultAttrsIntrinsic<[llvm_nxv4i32_ty],
  2109. [llvm_nxv4i32_ty, llvm_nxv4i32_ty],
  2110. [IntrNoMem]>;
  2111. def int_aarch64_sve_sm4ekey : ClangBuiltin<"__builtin_sve_svsm4ekey_u32">,
  2112. DefaultAttrsIntrinsic<[llvm_nxv4i32_ty],
  2113. [llvm_nxv4i32_ty, llvm_nxv4i32_ty],
  2114. [IntrNoMem]>;
  2115. //
  2116. // SVE2 - Extended table lookup/permute
  2117. //
  2118. def int_aarch64_sve_tbl2 : AdvSIMD_SVE2_TBX_Intrinsic;
  2119. def int_aarch64_sve_tbx : AdvSIMD_SVE2_TBX_Intrinsic;
  2120. //
  2121. // SVE2 - Optional bit permutation
  2122. //
  2123. def int_aarch64_sve_bdep_x : AdvSIMD_2VectorArg_Intrinsic;
  2124. def int_aarch64_sve_bext_x : AdvSIMD_2VectorArg_Intrinsic;
  2125. def int_aarch64_sve_bgrp_x : AdvSIMD_2VectorArg_Intrinsic;
  2126. //
  2127. // SVE ACLE: 7.3. INT8 matrix multiply extensions
  2128. //
  2129. def int_aarch64_sve_ummla : SVE_MatMul_Intrinsic;
  2130. def int_aarch64_sve_smmla : SVE_MatMul_Intrinsic;
  2131. def int_aarch64_sve_usmmla : SVE_MatMul_Intrinsic;
  2132. def int_aarch64_sve_usdot : AdvSIMD_SVE_DOT_Intrinsic;
  2133. def int_aarch64_sve_usdot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic;
  2134. def int_aarch64_sve_sudot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic;
  2135. //
  2136. // SVE ACLE: 7.4/5. FP64/FP32 matrix multiply extensions
  2137. //
  2138. def int_aarch64_sve_fmmla : AdvSIMD_3VectorArg_Intrinsic;
  2139. //
  2140. // SVE ACLE: 7.2. BFloat16 extensions
  2141. //
  2142. def int_aarch64_sve_bfdot : SVE_4Vec_BF16;
  2143. def int_aarch64_sve_bfmlalb : SVE_4Vec_BF16;
  2144. def int_aarch64_sve_bfmlalt : SVE_4Vec_BF16;
  2145. def int_aarch64_sve_bfmmla : SVE_4Vec_BF16;
  2146. def int_aarch64_sve_bfdot_lane_v2 : SVE_4Vec_BF16_Indexed;
  2147. def int_aarch64_sve_bfmlalb_lane_v2 : SVE_4Vec_BF16_Indexed;
  2148. def int_aarch64_sve_bfmlalt_lane_v2 : SVE_4Vec_BF16_Indexed;
  2149. }
  2150. //
  2151. // SVE2 - Contiguous conflict detection
  2152. //
  2153. def int_aarch64_sve_whilerw_b : SVE2_CONFLICT_DETECT_Intrinsic;
  2154. def int_aarch64_sve_whilerw_h : SVE2_CONFLICT_DETECT_Intrinsic;
  2155. def int_aarch64_sve_whilerw_s : SVE2_CONFLICT_DETECT_Intrinsic;
  2156. def int_aarch64_sve_whilerw_d : SVE2_CONFLICT_DETECT_Intrinsic;
  2157. def int_aarch64_sve_whilewr_b : SVE2_CONFLICT_DETECT_Intrinsic;
  2158. def int_aarch64_sve_whilewr_h : SVE2_CONFLICT_DETECT_Intrinsic;
  2159. def int_aarch64_sve_whilewr_s : SVE2_CONFLICT_DETECT_Intrinsic;
  2160. def int_aarch64_sve_whilewr_d : SVE2_CONFLICT_DETECT_Intrinsic;
  2161. // Scalable Matrix Extension (SME) Intrinsics
  2162. let TargetPrefix = "aarch64" in {
  2163. class SME_Load_Store_Intrinsic<LLVMType pred_ty>
  2164. : DefaultAttrsIntrinsic<[],
  2165. [pred_ty, llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<2>>]>;
  2166. // Loads
  2167. def int_aarch64_sme_ld1b_horiz : SME_Load_Store_Intrinsic<llvm_nxv16i1_ty>;
  2168. def int_aarch64_sme_ld1h_horiz : SME_Load_Store_Intrinsic<llvm_nxv8i1_ty>;
  2169. def int_aarch64_sme_ld1w_horiz : SME_Load_Store_Intrinsic<llvm_nxv4i1_ty>;
  2170. def int_aarch64_sme_ld1d_horiz : SME_Load_Store_Intrinsic<llvm_nxv2i1_ty>;
  2171. def int_aarch64_sme_ld1q_horiz : SME_Load_Store_Intrinsic<llvm_nxv1i1_ty>;
  2172. def int_aarch64_sme_ld1b_vert : SME_Load_Store_Intrinsic<llvm_nxv16i1_ty>;
  2173. def int_aarch64_sme_ld1h_vert : SME_Load_Store_Intrinsic<llvm_nxv8i1_ty>;
  2174. def int_aarch64_sme_ld1w_vert : SME_Load_Store_Intrinsic<llvm_nxv4i1_ty>;
  2175. def int_aarch64_sme_ld1d_vert : SME_Load_Store_Intrinsic<llvm_nxv2i1_ty>;
  2176. def int_aarch64_sme_ld1q_vert : SME_Load_Store_Intrinsic<llvm_nxv1i1_ty>;
  2177. // Stores
  2178. def int_aarch64_sme_st1b_horiz : SME_Load_Store_Intrinsic<llvm_nxv16i1_ty>;
  2179. def int_aarch64_sme_st1h_horiz : SME_Load_Store_Intrinsic<llvm_nxv8i1_ty>;
  2180. def int_aarch64_sme_st1w_horiz : SME_Load_Store_Intrinsic<llvm_nxv4i1_ty>;
  2181. def int_aarch64_sme_st1d_horiz : SME_Load_Store_Intrinsic<llvm_nxv2i1_ty>;
  2182. def int_aarch64_sme_st1q_horiz : SME_Load_Store_Intrinsic<llvm_nxv1i1_ty>;
  2183. def int_aarch64_sme_st1b_vert : SME_Load_Store_Intrinsic<llvm_nxv16i1_ty>;
  2184. def int_aarch64_sme_st1h_vert : SME_Load_Store_Intrinsic<llvm_nxv8i1_ty>;
  2185. def int_aarch64_sme_st1w_vert : SME_Load_Store_Intrinsic<llvm_nxv4i1_ty>;
  2186. def int_aarch64_sme_st1d_vert : SME_Load_Store_Intrinsic<llvm_nxv2i1_ty>;
  2187. def int_aarch64_sme_st1q_vert : SME_Load_Store_Intrinsic<llvm_nxv1i1_ty>;
  2188. // Spill + fill
  2189. def int_aarch64_sme_ldr : DefaultAttrsIntrinsic<
  2190. [], [llvm_i32_ty, llvm_ptr_ty]>;
  2191. def int_aarch64_sme_str : DefaultAttrsIntrinsic<
  2192. [], [llvm_i32_ty, llvm_ptr_ty]>;
  2193. class SME_TileToVector_Intrinsic
  2194. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  2195. [LLVMMatchType<0>, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  2196. llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<2>>]>;
  2197. class SME_VectorToTile_Intrinsic
  2198. : DefaultAttrsIntrinsic<[],
  2199. [llvm_i32_ty, llvm_i32_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  2200. llvm_anyvector_ty], [ImmArg<ArgIndex<0>>]>;
  2201. def int_aarch64_sme_read_horiz : SME_TileToVector_Intrinsic;
  2202. def int_aarch64_sme_read_vert : SME_TileToVector_Intrinsic;
  2203. def int_aarch64_sme_write_horiz : SME_VectorToTile_Intrinsic;
  2204. def int_aarch64_sme_write_vert : SME_VectorToTile_Intrinsic;
  2205. def int_aarch64_sme_readq_horiz : SME_TileToVector_Intrinsic;
  2206. def int_aarch64_sme_readq_vert : SME_TileToVector_Intrinsic;
  2207. def int_aarch64_sme_writeq_horiz : SME_VectorToTile_Intrinsic;
  2208. def int_aarch64_sme_writeq_vert : SME_VectorToTile_Intrinsic;
  2209. def int_aarch64_sme_zero : DefaultAttrsIntrinsic<[], [llvm_i32_ty], [ImmArg<ArgIndex<0>>]>;
  2210. class SME_OuterProduct_Intrinsic
  2211. : DefaultAttrsIntrinsic<[],
  2212. [llvm_i32_ty,
  2213. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  2214. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  2215. LLVMMatchType<0>,
  2216. llvm_anyvector_ty], [ImmArg<ArgIndex<0>>]>;
  2217. def int_aarch64_sme_mopa : SME_OuterProduct_Intrinsic;
  2218. def int_aarch64_sme_mops : SME_OuterProduct_Intrinsic;
  2219. def int_aarch64_sme_mopa_wide : SME_OuterProduct_Intrinsic;
  2220. def int_aarch64_sme_mops_wide : SME_OuterProduct_Intrinsic;
  2221. def int_aarch64_sme_smopa_wide : SME_OuterProduct_Intrinsic;
  2222. def int_aarch64_sme_smops_wide : SME_OuterProduct_Intrinsic;
  2223. def int_aarch64_sme_umopa_wide : SME_OuterProduct_Intrinsic;
  2224. def int_aarch64_sme_umops_wide : SME_OuterProduct_Intrinsic;
  2225. def int_aarch64_sme_sumopa_wide : SME_OuterProduct_Intrinsic;
  2226. def int_aarch64_sme_sumops_wide : SME_OuterProduct_Intrinsic;
  2227. def int_aarch64_sme_usmopa_wide : SME_OuterProduct_Intrinsic;
  2228. def int_aarch64_sme_usmops_wide : SME_OuterProduct_Intrinsic;
  2229. class SME_AddVectorToTile_Intrinsic
  2230. : DefaultAttrsIntrinsic<[],
  2231. [llvm_i32_ty,
  2232. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  2233. LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  2234. llvm_anyvector_ty], [ImmArg<ArgIndex<0>>]>;
  2235. def int_aarch64_sme_addha : SME_AddVectorToTile_Intrinsic;
  2236. def int_aarch64_sme_addva : SME_AddVectorToTile_Intrinsic;
  2237. //
  2238. // Counting elements
  2239. //
  2240. class AdvSIMD_SME_CNTSB_Intrinsic
  2241. : DefaultAttrsIntrinsic<[llvm_i64_ty], [], [IntrNoMem]>;
  2242. def int_aarch64_sme_cntsb : AdvSIMD_SME_CNTSB_Intrinsic;
  2243. def int_aarch64_sme_cntsh : AdvSIMD_SME_CNTSB_Intrinsic;
  2244. def int_aarch64_sme_cntsw : AdvSIMD_SME_CNTSB_Intrinsic;
  2245. def int_aarch64_sme_cntsd : AdvSIMD_SME_CNTSB_Intrinsic;
  2246. //
  2247. // PSTATE Functions
  2248. //
  2249. def int_aarch64_sme_get_tpidr2
  2250. : DefaultAttrsIntrinsic<[llvm_i64_ty], [],
  2251. [IntrNoMem, IntrHasSideEffects]>;
  2252. def int_aarch64_sme_set_tpidr2
  2253. : DefaultAttrsIntrinsic<[], [llvm_i64_ty],
  2254. [IntrNoMem, IntrHasSideEffects]>;
  2255. def int_aarch64_sme_za_enable
  2256. : DefaultAttrsIntrinsic<[], [], [IntrNoMem, IntrHasSideEffects]>;
  2257. def int_aarch64_sme_za_disable
  2258. : DefaultAttrsIntrinsic<[], [], [IntrNoMem, IntrHasSideEffects]>;
  2259. // Clamp
  2260. //
  2261. def int_aarch64_sve_sclamp : AdvSIMD_3VectorArg_Intrinsic;
  2262. def int_aarch64_sve_uclamp : AdvSIMD_3VectorArg_Intrinsic;
  2263. def int_aarch64_sve_fclamp : AdvSIMD_3VectorArg_Intrinsic;
  2264. //
  2265. // Reversal
  2266. //
  2267. def int_aarch64_sve_revd : AdvSIMD_Merged1VectorArg_Intrinsic;
  2268. //
  2269. // Predicate selection
  2270. //
  2271. def int_aarch64_sve_psel
  2272. : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
  2273. [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
  2274. LLVMMatchType<0>, llvm_i32_ty]>;
  2275. //
  2276. // Predicate-pair intrinsics
  2277. //
  2278. foreach cmp = ["ge", "gt", "hi", "hs", "le", "lo", "ls", "lt"] in {
  2279. def int_aarch64_sve_while # cmp # _x2
  2280. : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
  2281. [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
  2282. }
  2283. //
  2284. // SME2 Intrinsics
  2285. //
  2286. class SME2_Matrix_ArrayVector_Single_Single_Intrinsic
  2287. : DefaultAttrsIntrinsic<[],
  2288. [llvm_i32_ty,
  2289. llvm_anyvector_ty, LLVMMatchType<0>],
  2290. []>;
  2291. class SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic
  2292. : DefaultAttrsIntrinsic<[],
  2293. [llvm_i32_ty,
  2294. llvm_anyvector_ty, LLVMMatchType<0>,
  2295. LLVMMatchType<0>],
  2296. []>;
  2297. class SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic
  2298. : DefaultAttrsIntrinsic<[],
  2299. [llvm_i32_ty,
  2300. llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
  2301. LLVMMatchType<0>],
  2302. []>;
  2303. class SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic
  2304. : DefaultAttrsIntrinsic<[],
  2305. [llvm_i32_ty,
  2306. llvm_anyvector_ty, LLVMMatchType<0>,
  2307. LLVMMatchType<0>, LLVMMatchType<0>],
  2308. []>;
  2309. class SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic
  2310. : DefaultAttrsIntrinsic<[],
  2311. [llvm_i32_ty,
  2312. llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
  2313. LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
  2314. []>;
  2315. class SME2_Matrix_ArrayVector_Single_Index_Intrinsic
  2316. : DefaultAttrsIntrinsic<[],
  2317. [llvm_i32_ty,
  2318. llvm_anyvector_ty,
  2319. LLVMMatchType<0>, llvm_i32_ty],
  2320. [ImmArg<ArgIndex<3>>]>;
  2321. class SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic
  2322. : DefaultAttrsIntrinsic<[],
  2323. [llvm_i32_ty,
  2324. llvm_anyvector_ty, LLVMMatchType<0>,
  2325. LLVMMatchType<0>, llvm_i32_ty],
  2326. [ImmArg<ArgIndex<4>>]>;
  2327. class SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic
  2328. : DefaultAttrsIntrinsic<[],
  2329. [llvm_i32_ty,
  2330. llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
  2331. LLVMMatchType<0>, llvm_i32_ty],
  2332. [ImmArg<ArgIndex<6>>]>;
  2333. class SME2_ZA_Write_VG2_Intrinsic
  2334. : DefaultAttrsIntrinsic<[],
  2335. [llvm_i32_ty,
  2336. llvm_anyvector_ty, LLVMMatchType<0>],
  2337. []>;
  2338. class SME2_ZA_Write_VG4_Intrinsic
  2339. : DefaultAttrsIntrinsic<[],
  2340. [llvm_i32_ty,
  2341. llvm_anyvector_ty, LLVMMatchType<0>,
  2342. LLVMMatchType<0>, LLVMMatchType<0>],
  2343. []>;
  2344. class SME2_CVT_VG2_SINGLE_Intrinsic
  2345. : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
  2346. [llvm_anyvector_ty, LLVMMatchType<0>],
  2347. [IntrNoMem]>;
  2348. class SME2_CVT_VG2_SINGLE_BF16_Intrinsic
  2349. : DefaultAttrsIntrinsic<[llvm_nxv8bf16_ty],
  2350. [llvm_nxv4f32_ty, llvm_nxv4f32_ty],
  2351. [IntrNoMem]>;
  2352. class SME2_CVT_VG4_SINGLE_Intrinsic
  2353. : DefaultAttrsIntrinsic<[LLVMSubdivide4VectorType<0>],
  2354. [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
  2355. [IntrNoMem]>;
  2356. class SME2_CVT_FtoI_VG2_Intrinsic
  2357. : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
  2358. [LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
  2359. [IntrNoMem]>;
  2360. class SME2_CVT_ItoF_VG2_Intrinsic
  2361. : DefaultAttrsIntrinsic<[LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
  2362. [llvm_anyvector_ty, LLVMMatchType<0>],
  2363. [IntrNoMem]>;
  2364. class SME2_CVT_FtoI_VG4_Intrinsic
  2365. : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
  2366. [LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>,
  2367. LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
  2368. [IntrNoMem]>;
  2369. class SME2_CVT_ItoF_VG4_Intrinsic
  2370. : DefaultAttrsIntrinsic<[LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>,
  2371. LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
  2372. [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
  2373. [IntrNoMem]>;
  2374. //
  2375. // Multi-vector fused multiply-add/subtract
  2376. //
  2377. def int_aarch64_sme_fmla_single_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
  2378. def int_aarch64_sme_fmls_single_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
  2379. def int_aarch64_sme_fmla_single_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
  2380. def int_aarch64_sme_fmls_single_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
  2381. def int_aarch64_sme_fmla_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
  2382. def int_aarch64_sme_fmls_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
  2383. def int_aarch64_sme_fmla_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
  2384. def int_aarch64_sme_fmls_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
  2385. def int_aarch64_sme_fmla_lane_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
  2386. def int_aarch64_sme_fmls_lane_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
  2387. def int_aarch64_sme_fmla_lane_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
  2388. def int_aarch64_sme_fmls_lane_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
  2389. //
  2390. // Multi-vector multiply-add/subtract long
  2391. //
  2392. foreach ty = ["f", "s", "u"] in {
  2393. foreach instr = ["mlal", "mlsl"] in {
  2394. def int_aarch64_sme_ # ty # instr # _single_vg2x1 : SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
  2395. def int_aarch64_sme_ # ty # instr # _single_vg2x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
  2396. def int_aarch64_sme_ # ty # instr # _single_vg2x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
  2397. def int_aarch64_sme_ # ty # instr # _vg2x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
  2398. def int_aarch64_sme_ # ty # instr # _vg2x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
  2399. def int_aarch64_sme_ # ty # instr # _lane_vg2x1 : SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
  2400. def int_aarch64_sme_ # ty # instr # _lane_vg2x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
  2401. def int_aarch64_sme_ # ty # instr # _lane_vg2x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
  2402. }
  2403. }
  2404. //
  2405. // Multi-vector vertical dot-products
  2406. //
  2407. def int_aarch64_sme_fvdot_lane_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
  2408. foreach ty = ["s", "u"] in {
  2409. def int_aarch64_sme_ #ty # vdot_lane_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
  2410. def int_aarch64_sme_ #ty # vdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
  2411. def int_aarch64_sme_ #ty # vdot_lane_za64_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
  2412. }
  2413. def int_aarch64_sme_suvdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
  2414. def int_aarch64_sme_usvdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
  2415. //
  2416. // Multi-vector floating-point CVT from single-precision to interleaved half-precision/BFloat16
  2417. //
  2418. def int_aarch64_sve_fcvtn_x2 : SME2_CVT_VG2_SINGLE_Intrinsic;
  2419. def int_aarch64_sve_bfcvtn_x2 : SME2_CVT_VG2_SINGLE_BF16_Intrinsic;
  2420. //
  2421. // Multi-vector convert to/from floating-point.
  2422. //
  2423. def int_aarch64_sve_fcvt_x2 : SME2_CVT_VG2_SINGLE_Intrinsic;
  2424. def int_aarch64_sve_bfcvt_x2 : SME2_CVT_VG2_SINGLE_BF16_Intrinsic;
  2425. def int_aarch64_sve_fcvts_x2 : SME2_CVT_FtoI_VG2_Intrinsic;
  2426. def int_aarch64_sve_fcvtu_x2 : SME2_CVT_FtoI_VG2_Intrinsic;
  2427. def int_aarch64_sve_scvtf_x2 : SME2_CVT_ItoF_VG2_Intrinsic;
  2428. def int_aarch64_sve_ucvtf_x2 : SME2_CVT_ItoF_VG2_Intrinsic;
  2429. def int_aarch64_sve_fcvts_x4 : SME2_CVT_FtoI_VG4_Intrinsic;
  2430. def int_aarch64_sve_fcvtu_x4 : SME2_CVT_FtoI_VG4_Intrinsic;
  2431. def int_aarch64_sve_scvtf_x4 : SME2_CVT_ItoF_VG4_Intrinsic;
  2432. def int_aarch64_sve_ucvtf_x4 : SME2_CVT_ItoF_VG4_Intrinsic;
  2433. //
  2434. // Multi-vector saturating extract narrow
  2435. //
  2436. def int_aarch64_sve_sqcvt_x2 : SME2_CVT_VG2_SINGLE_Intrinsic;
  2437. def int_aarch64_sve_uqcvt_x2 : SME2_CVT_VG2_SINGLE_Intrinsic;
  2438. def int_aarch64_sve_sqcvtu_x2 : SME2_CVT_VG2_SINGLE_Intrinsic;
  2439. def int_aarch64_sve_sqcvt_x4 : SME2_CVT_VG4_SINGLE_Intrinsic;
  2440. def int_aarch64_sve_uqcvt_x4 : SME2_CVT_VG4_SINGLE_Intrinsic;
  2441. def int_aarch64_sve_sqcvtu_x4 : SME2_CVT_VG4_SINGLE_Intrinsic;
  2442. //
  2443. // Multi-vector saturating extract narrow and interleave
  2444. //
  2445. def int_aarch64_sve_sqcvtn_x2 : SME2_CVT_VG2_SINGLE_Intrinsic;
  2446. def int_aarch64_sve_uqcvtn_x2 : SME2_CVT_VG2_SINGLE_Intrinsic;
  2447. def int_aarch64_sve_sqcvtun_x2 : SME2_CVT_VG2_SINGLE_Intrinsic;
  2448. def int_aarch64_sve_sqcvtn_x4 : SME2_CVT_VG4_SINGLE_Intrinsic;
  2449. def int_aarch64_sve_uqcvtn_x4 : SME2_CVT_VG4_SINGLE_Intrinsic;
  2450. def int_aarch64_sve_sqcvtun_x4 : SME2_CVT_VG4_SINGLE_Intrinsic;
  2451. //
  2452. // Multi-Single add/sub
  2453. //
  2454. def int_aarch64_sme_add_write_single_za_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
  2455. def int_aarch64_sme_sub_write_single_za_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
  2456. def int_aarch64_sme_add_write_single_za_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
  2457. def int_aarch64_sme_sub_write_single_za_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
  2458. //
  2459. // Multi-Multi add/sub
  2460. //
  2461. def int_aarch64_sme_add_write_za_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
  2462. def int_aarch64_sme_sub_write_za_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
  2463. def int_aarch64_sme_add_write_za_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
  2464. def int_aarch64_sme_sub_write_za_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
  2465. }