Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AMDILMultiClass.td 68KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440
  1. //===-- AMDILMultiClass.td - TODO: Add brief description -------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //==-----------------------------------------------------------------------===//
  9. // Multiclass that handles branch instructions
  10. multiclass BranchConditional<SDNode Op> {
  11. def _i8 : ILFormat<IL_OP_IFC, (outs),
  12. (ins brtarget:$target, GPRI8:$src0),
  13. "; i32 Pseudo branch instruction",
  14. [(Op bb:$target, GPRI8:$src0)]>;
  15. def _i16 : ILFormat<IL_OP_IFC, (outs),
  16. (ins brtarget:$target, GPRI16:$src0),
  17. "; i32 Pseudo branch instruction",
  18. [(Op bb:$target, GPRI16:$src0)]>;
  19. def _i32 : ILFormat<IL_OP_IFC, (outs),
  20. (ins brtarget:$target, GPRI32:$src0),
  21. "; i32 Pseudo branch instruction",
  22. [(Op bb:$target, GPRI32:$src0)]>;
  23. def _f32 : ILFormat<IL_OP_IFC, (outs),
  24. (ins brtarget:$target, GPRF32:$src0),
  25. "; f32 Pseudo branch instruction",
  26. [(Op bb:$target, GPRF32:$src0)]>;
  27. def _i64 : ILFormat<IL_OP_IFC, (outs),
  28. (ins brtarget:$target, GPRI64:$src0),
  29. "; f64 Pseudo branch instruction",
  30. [(Op bb:$target, (i64 GPRI64:$src0))]>;
  31. def _f64 : ILFormat<IL_OP_IFC, (outs),
  32. (ins brtarget:$target, GPRF64:$src0),
  33. "; f64 Pseudo branch instruction",
  34. [(Op bb:$target, (f64 GPRF64:$src0))]>;
  35. }
  36. // Multiclass that handles compare instructions
  37. // When a definition is added here, a corrosponding defition
  38. // needs to be added at:
  39. // AMDILISelLowering.cpp@EmitInstrWithCustomInserter
  40. multiclass Compare<string asm> {
  41. def _i8 : ILFormat<IL_OP_CMP, (outs GPRI8:$dst),
  42. (ins i32imm:$cc, GPRI8:$src0, GPRI8:$src1),
  43. !strconcat("; i8 ", asm),
  44. [(set GPRI8:$dst, (IL_cmp imm:$cc, GPRI8:$src0, GPRI8:$src1))]>;
  45. def _i16 : ILFormat<IL_OP_CMP, (outs GPRI16:$dst),
  46. (ins i32imm:$cc, GPRI16:$src0, GPRI16:$src1),
  47. !strconcat("; i16 ", asm),
  48. [(set GPRI16:$dst, (IL_cmp imm:$cc, GPRI16:$src0, GPRI16:$src1))]>;
  49. def _i32 : ILFormat<IL_OP_CMP, (outs GPRI32:$dst),
  50. (ins i32imm:$cc, GPRI32:$src0, GPRI32:$src1),
  51. !strconcat("; i32 ", asm),
  52. [(set GPRI32:$dst, (IL_cmp imm:$cc, GPRI32:$src0, GPRI32:$src1))]>;
  53. def _i64 : ILFormat<IL_OP_CMP, (outs GPRI64:$dst),
  54. (ins i32imm:$cc, GPRI64:$src0, GPRI64:$src1),
  55. !strconcat("; i64 ", asm),
  56. [(set GPRI64:$dst, (IL_cmp imm:$cc, GPRI64:$src0, GPRI64:$src1))]>;
  57. def _f32 : ILFormat<IL_OP_CMP, (outs GPRF32:$dst),
  58. (ins i32imm:$cc, GPRF32:$src0, GPRF32:$src1),
  59. !strconcat("; f32 ", asm),
  60. [(set GPRF32:$dst, (IL_cmp imm:$cc, GPRF32:$src0, GPRF32:$src1))]>;
  61. def _f64 : ILFormat<IL_OP_CMP, (outs GPRF64:$dst),
  62. (ins i32imm:$cc, GPRF64:$src0, GPRF64:$src1),
  63. !strconcat("; f64 ", asm),
  64. [(set GPRF64:$dst, (IL_cmp imm:$cc, GPRF64:$src0, GPRF64:$src1))]>;
  65. def _v2i8 : ILFormat<IL_OP_CMP, (outs GPRV2I8:$dst),
  66. (ins i32imm:$cc, GPRV2I8:$src0, GPRV2I8:$src1),
  67. !strconcat("; i8 ", asm),
  68. [(set GPRV2I8:$dst, (IL_cmp imm:$cc, GPRV2I8:$src0, GPRV2I8:$src1))]>;
  69. def _v2i16 : ILFormat<IL_OP_CMP, (outs GPRV2I16:$dst),
  70. (ins i32imm:$cc, GPRV2I16:$src0, GPRV2I16:$src1),
  71. !strconcat("; i16 ", asm),
  72. [(set GPRV2I16:$dst, (IL_cmp imm:$cc, GPRV2I16:$src0, GPRV2I16:$src1))]>;
  73. def _v2i32 : ILFormat<IL_OP_CMP, (outs GPRV2I32:$dst),
  74. (ins i32imm:$cc, GPRV2I32:$src0, GPRV2I32:$src1),
  75. !strconcat("; i32 ", asm),
  76. [(set GPRV2I32:$dst, (IL_cmp imm:$cc, GPRV2I32:$src0, GPRV2I32:$src1))]>;
  77. def _v2i64 : ILFormat<IL_OP_CMP, (outs GPRV2I64:$dst),
  78. (ins i32imm:$cc, GPRV2I64:$src0, GPRV2I64:$src1),
  79. !strconcat("; i64 ", asm),
  80. [(set GPRV2I64:$dst, (IL_cmp imm:$cc, GPRV2I64:$src0, GPRV2I64:$src1))]>;
  81. def _v2f32 : ILFormat<IL_OP_CMP, (outs GPRV2F32:$dst),
  82. (ins i32imm:$cc, GPRV2F32:$src0, GPRV2F32:$src1),
  83. !strconcat("; f32 ", asm),
  84. [(set GPRV2F32:$dst, (IL_cmp imm:$cc, GPRV2F32:$src0, GPRV2F32:$src1))]>;
  85. def _v2f64 : ILFormat<IL_OP_CMP, (outs GPRV2F64:$dst),
  86. (ins i32imm:$cc, GPRV2F64:$src0, GPRV2F64:$src1),
  87. !strconcat("; f64 ", asm),
  88. [(set GPRV2F64:$dst, (IL_cmp imm:$cc, GPRV2F64:$src0, GPRV2F64:$src1))]>;
  89. def _v4i8 : ILFormat<IL_OP_CMP, (outs GPRV4I8:$dst),
  90. (ins i32imm:$cc, GPRV4I8:$src0, GPRV4I8:$src1),
  91. !strconcat("; i8 ", asm),
  92. [(set GPRV4I8:$dst, (IL_cmp imm:$cc, GPRV4I8:$src0, GPRV4I8:$src1))]>;
  93. def _v4i16 : ILFormat<IL_OP_CMP, (outs GPRV4I16:$dst),
  94. (ins i32imm:$cc, GPRV4I16:$src0, GPRV4I16:$src1),
  95. !strconcat("; i16 ", asm),
  96. [(set GPRV4I16:$dst, (IL_cmp imm:$cc, GPRV4I16:$src0, GPRV4I16:$src1))]>;
  97. def _v4i32 : ILFormat<IL_OP_CMP, (outs GPRV4I32:$dst),
  98. (ins i32imm:$cc, GPRV4I32:$src0, GPRV4I32:$src1),
  99. !strconcat("; i32 ", asm),
  100. [(set GPRV4I32:$dst, (IL_cmp imm:$cc, GPRV4I32:$src0, GPRV4I32:$src1))]>;
  101. def _v4f32 : ILFormat<IL_OP_CMP, (outs GPRV4F32:$dst),
  102. (ins i32imm:$cc, GPRV4F32:$src0, GPRV4F32:$src1),
  103. !strconcat("; f32 ", asm),
  104. [(set GPRV4F32:$dst, (IL_cmp imm:$cc, GPRV4F32:$src0, GPRV4F32:$src1))]>;
  105. }
  106. // Multiclass that handles constant values
  107. multiclass ILConstant<string asm> {
  108. def _i8 : ILFormat<IL_OP_MOV, (outs GPRI8:$dst),
  109. (ins i8imm:$val),
  110. asm, [(set GPRI8:$dst, imm:$val)]>;
  111. // def _v2i8 : ILFormat<IL_OP_MOV, (outs GPRV2I8:$dst),
  112. // (ins i8imm:$val),
  113. // asm, [(set GPRV2I8:$dst, GPRV2I8:$val)]>;
  114. //def _v4i8 : ILFormat<IL_OP_MOV, (outs GPRV4I8:$dst),
  115. //(ins i8imm:$val),
  116. //asm, [(set GPRV4I8:$dst, GPRV4I8:$val)]>;
  117. def _i16 : ILFormat<IL_OP_MOV, (outs GPRI16:$dst),
  118. (ins i16imm:$val),
  119. asm, [(set GPRI16:$dst, imm:$val)]>;
  120. // def _v2i16 : ILFormat<IL_OP_MOV, (outs GPRV2I16:$dst),
  121. // (ins i16imm:$val),
  122. // asm, [(set GPRV2I16:$dst, GPRV2I16:$val)]>;
  123. // def _v4i16 : ILFormat<IL_OP_MOV, (outs GPRV4I16:$dst),
  124. // (ins i16imm:$val),
  125. // asm, [(set GPRV4I16:$dst, GPRV4I16:$val)]>;
  126. def _i32 : ILFormat<IL_OP_MOV, (outs GPRI32:$dst),
  127. (ins i32imm:$val),
  128. asm, [(set GPRI32:$dst, imm:$val)]>;
  129. // def _v2i32 : ILFormat<IL_OP_MOV, (outs GPRV2I32:$dst),
  130. // (ins i32imm:$val),
  131. // asm, [(set GPRV2I32:$dst, GPRV2I32:$val)]>;
  132. // def _v4i32 : ILFormat<IL_OP_MOV, (outs GPRV4I32:$dst),
  133. // (ins GPRV4I32:$val),
  134. // asm, [(set GPRV4I32:$dst, GPRV4I32:$val)]>;
  135. def _i64 : ILFormat<IL_OP_MOV, (outs GPRI64:$dst),
  136. (ins i64imm:$val),
  137. asm, [(set GPRI64:$dst, imm:$val)]>;
  138. // def _v2i64 : ILFormat<IL_OP_MOV, (outs GPRV2I64:$dst),
  139. // (ins i64imm:$val),
  140. // asm, [(set GPRV2I64:$dst, GPRV2I64:$val)]>;
  141. def _f32 : ILFormat<IL_OP_MOV, (outs GPRF32:$dst),
  142. (ins f32imm:$val),
  143. asm, [(set GPRF32:$dst, fpimm:$val)]>;
  144. // def _v2f32 : ILFormat<IL_OP_MOV, (outs GPRV2F32:$dst),
  145. // (ins f32imm:$val),
  146. // asm, [(set GPRV2F32:$dst, GPRV2F32:$val)]>;
  147. // def _v4f32 : ILFormat<IL_OP_MOV, (outs GPRV4F32:$dst),
  148. // (ins f32imm:$val),
  149. // asm, [(set GPRV4F32:$dst, GPRV4F32:$val)]>;
  150. def _f64 : ILFormat<IL_OP_MOV, (outs GPRF64:$dst),
  151. (ins f64imm:$val),
  152. asm, [(set GPRF64:$dst, fpimm:$val)]>;
  153. // def _v2f64 : ILFormat<IL_OP_MOV, (outs GPRV2F64:$dst),
  154. // (ins f64imm:$val),
  155. // asm, [(set GPRV2F64:$dst, GPRV2F64:$val)]>;
  156. }
  157. // Multiclass that handles memory store operations
  158. multiclass GTRUNCSTORE<string asm> {
  159. def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI32:$ptr),
  160. !strconcat(asm, " $val $ptr"),
  161. [(global_i8trunc_store GPRI16:$val, ADDR:$ptr)]>;
  162. def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
  163. !strconcat(asm, " $val $ptr"),
  164. [(global_i8trunc_store GPRI32:$val, ADDR:$ptr)]>;
  165. def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  166. !strconcat(asm, " $val $ptr"),
  167. [(global_i8trunc_store GPRI64:$val, ADDR:$ptr)]>;
  168. def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
  169. !strconcat(asm, " $val $ptr"),
  170. [(global_i16trunc_store GPRI32:$val, ADDR:$ptr)]>;
  171. def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  172. !strconcat(asm, " $val $ptr"),
  173. [(global_i16trunc_store GPRI64:$val, ADDR:$ptr)]>;
  174. def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  175. !strconcat(asm, " $val $ptr"),
  176. [(global_i32trunc_store GPRI64:$val, ADDR:$ptr)]>;
  177. def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI32:$ptr),
  178. !strconcat(asm, " $val $ptr"),
  179. [(global_f32trunc_store GPRF64:$val, ADDR:$ptr)]>;
  180. def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
  181. !strconcat(asm, " $val $ptr"),
  182. [(global_v2i8trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
  183. def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
  184. !strconcat(asm, " $val $ptr"),
  185. [(global_v4i8trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
  186. def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI32:$ptr),
  187. !strconcat(asm, " $val $ptr"),
  188. [(global_v2i8trunc_store GPRV2I16:$val, ADDR:$ptr)]>;
  189. def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI32:$ptr),
  190. !strconcat(asm, " $val $ptr"),
  191. [(global_v4i8trunc_store GPRV4I16:$val, ADDR:$ptr)]>;
  192. def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
  193. !strconcat(asm, " $val $ptr"),
  194. [(global_v2i16trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
  195. def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
  196. !strconcat(asm, " $val $ptr"),
  197. [(global_v4i16trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
  198. def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI32:$ptr),
  199. !strconcat(asm, " $val $ptr"),
  200. [(global_v2f32trunc_store GPRV2F64:$val, ADDR:$ptr)]>;
  201. def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  202. !strconcat(asm, " $val $ptr"),
  203. [(global_v2i8trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  204. def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  205. !strconcat(asm, " $val $ptr"),
  206. [(global_v2i16trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  207. def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  208. !strconcat(asm, " $val $ptr"),
  209. [(global_v2i32trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  210. }
  211. // Multiclass that handles memory store operations
  212. multiclass LTRUNCSTORE<string asm> {
  213. def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI32:$ptr),
  214. !strconcat(asm, " $val $ptr"),
  215. [(local_i8trunc_store GPRI16:$val, ADDR:$ptr)]>;
  216. def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
  217. !strconcat(asm, " $val $ptr"),
  218. [(local_i8trunc_store GPRI32:$val, ADDR:$ptr)]>;
  219. def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  220. !strconcat(asm, " $val $ptr"),
  221. [(local_i8trunc_store GPRI64:$val, ADDR:$ptr)]>;
  222. def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
  223. !strconcat(asm, " $val $ptr"),
  224. [(local_i16trunc_store GPRI32:$val, ADDR:$ptr)]>;
  225. def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  226. !strconcat(asm, " $val $ptr"),
  227. [(local_i16trunc_store GPRI64:$val, ADDR:$ptr)]>;
  228. def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  229. !strconcat(asm, " $val $ptr"),
  230. [(local_i32trunc_store GPRI64:$val, ADDR:$ptr)]>;
  231. def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI32:$ptr),
  232. !strconcat(asm, " $val $ptr"),
  233. [(local_f32trunc_store GPRF64:$val, ADDR:$ptr)]>;
  234. def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
  235. !strconcat(asm, " $val $ptr"),
  236. [(local_v2i8trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
  237. def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
  238. !strconcat(asm, " $val $ptr"),
  239. [(local_v4i8trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
  240. def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI32:$ptr),
  241. !strconcat(asm, " $val $ptr"),
  242. [(local_v2i8trunc_store GPRV2I16:$val, ADDR:$ptr)]>;
  243. def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI32:$ptr),
  244. !strconcat(asm, " $val $ptr"),
  245. [(local_v4i8trunc_store GPRV4I16:$val, ADDR:$ptr)]>;
  246. def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
  247. !strconcat(asm, " $val $ptr"),
  248. [(local_v2i16trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
  249. def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
  250. !strconcat(asm, " $val $ptr"),
  251. [(local_v4i16trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
  252. def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI32:$ptr),
  253. !strconcat(asm, " $val $ptr"),
  254. [(local_v2f32trunc_store GPRV2F64:$val, ADDR:$ptr)]>;
  255. def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  256. !strconcat(asm, " $val $ptr"),
  257. [(local_v2i8trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  258. def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  259. !strconcat(asm, " $val $ptr"),
  260. [(local_v2i16trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  261. def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  262. !strconcat(asm, " $val $ptr"),
  263. [(local_v2i32trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  264. }
  265. // Multiclass that handles memory store operations
  266. multiclass PTRUNCSTORE<string asm> {
  267. def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI32:$ptr),
  268. !strconcat(asm, " $val $ptr"),
  269. [(private_i8trunc_store GPRI16:$val, ADDR:$ptr)]>;
  270. def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
  271. !strconcat(asm, " $val $ptr"),
  272. [(private_i8trunc_store GPRI32:$val, ADDR:$ptr)]>;
  273. def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  274. !strconcat(asm, " $val $ptr"),
  275. [(private_i8trunc_store GPRI64:$val, ADDR:$ptr)]>;
  276. def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
  277. !strconcat(asm, " $val $ptr"),
  278. [(private_i16trunc_store GPRI32:$val, ADDR:$ptr)]>;
  279. def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  280. !strconcat(asm, " $val $ptr"),
  281. [(private_i16trunc_store GPRI64:$val, ADDR:$ptr)]>;
  282. def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  283. !strconcat(asm, " $val $ptr"),
  284. [(private_i32trunc_store GPRI64:$val, ADDR:$ptr)]>;
  285. def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI32:$ptr),
  286. !strconcat(asm, " $val $ptr"),
  287. [(private_f32trunc_store GPRF64:$val, ADDR:$ptr)]>;
  288. def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
  289. !strconcat(asm, " $val $ptr"),
  290. [(private_v2i8trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
  291. def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
  292. !strconcat(asm, " $val $ptr"),
  293. [(private_v4i8trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
  294. def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI32:$ptr),
  295. !strconcat(asm, " $val $ptr"),
  296. [(private_v2i8trunc_store GPRV2I16:$val, ADDR:$ptr)]>;
  297. def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI32:$ptr),
  298. !strconcat(asm, " $val $ptr"),
  299. [(private_v4i8trunc_store GPRV4I16:$val, ADDR:$ptr)]>;
  300. def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
  301. !strconcat(asm, " $val $ptr"),
  302. [(private_v2i16trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
  303. def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
  304. !strconcat(asm, " $val $ptr"),
  305. [(private_v4i16trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
  306. def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI32:$ptr),
  307. !strconcat(asm, " $val $ptr"),
  308. [(private_v2f32trunc_store GPRV2F64:$val, ADDR:$ptr)]>;
  309. def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  310. !strconcat(asm, " $val $ptr"),
  311. [(private_v2i8trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  312. def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  313. !strconcat(asm, " $val $ptr"),
  314. [(private_v2i16trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  315. def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  316. !strconcat(asm, " $val $ptr"),
  317. [(private_v2i32trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  318. }
  319. // Multiclass that handles memory store operations
  320. multiclass RTRUNCSTORE<string asm> {
  321. def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI32:$ptr),
  322. !strconcat(asm, " $val $ptr"),
  323. [(region_i8trunc_store GPRI16:$val, ADDR:$ptr)]>;
  324. def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
  325. !strconcat(asm, " $val $ptr"),
  326. [(region_i8trunc_store GPRI32:$val, ADDR:$ptr)]>;
  327. def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  328. !strconcat(asm, " $val $ptr"),
  329. [(region_i8trunc_store GPRI64:$val, ADDR:$ptr)]>;
  330. def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
  331. !strconcat(asm, " $val $ptr"),
  332. [(region_i16trunc_store GPRI32:$val, ADDR:$ptr)]>;
  333. def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  334. !strconcat(asm, " $val $ptr"),
  335. [(region_i16trunc_store GPRI64:$val, ADDR:$ptr)]>;
  336. def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  337. !strconcat(asm, " $val $ptr"),
  338. [(region_i32trunc_store GPRI64:$val, ADDR:$ptr)]>;
  339. def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI32:$ptr),
  340. !strconcat(asm, " $val $ptr"),
  341. [(region_f32trunc_store GPRF64:$val, ADDR:$ptr)]>;
  342. def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
  343. !strconcat(asm, " $val $ptr"),
  344. [(region_v2i8trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
  345. def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
  346. !strconcat(asm, " $val $ptr"),
  347. [(region_v4i8trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
  348. def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI32:$ptr),
  349. !strconcat(asm, " $val $ptr"),
  350. [(region_v2i8trunc_store GPRV2I16:$val, ADDR:$ptr)]>;
  351. def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI32:$ptr),
  352. !strconcat(asm, " $val $ptr"),
  353. [(region_v4i8trunc_store GPRV4I16:$val, ADDR:$ptr)]>;
  354. def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
  355. !strconcat(asm, " $val $ptr"),
  356. [(region_v2i16trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
  357. def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
  358. !strconcat(asm, " $val $ptr"),
  359. [(region_v4i16trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
  360. def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI32:$ptr),
  361. !strconcat(asm, " $val $ptr"),
  362. [(region_v2f32trunc_store GPRV2F64:$val, ADDR:$ptr)]>;
  363. def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  364. !strconcat(asm, " $val $ptr"),
  365. [(region_v2i8trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  366. def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  367. !strconcat(asm, " $val $ptr"),
  368. [(region_v2i16trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  369. def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  370. !strconcat(asm, " $val $ptr"),
  371. [(region_v2i32trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
  372. }
  373. // Multiclass that handles memory store operations
  374. multiclass STORE<string asm, PatFrag OpNode> {
  375. def _i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI8:$val, MEMI32:$ptr),
  376. !strconcat(asm, " $val $ptr"),
  377. [(OpNode GPRI8:$val, ADDR:$ptr)]>;
  378. def _i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI32:$ptr),
  379. !strconcat(asm, " $val $ptr"),
  380. [(OpNode GPRI16:$val, ADDR:$ptr)]>;
  381. def _i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
  382. !strconcat(asm, " $val $ptr"),
  383. [(OpNode GPRI32:$val, ADDR:$ptr)]>;
  384. def _f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF32:$val, MEMI32:$ptr),
  385. !strconcat(asm, " $val $ptr"),
  386. [(OpNode GPRF32:$val, ADDR:$ptr)]>;
  387. def _i64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
  388. !strconcat(asm, " $val $ptr"),
  389. [(OpNode GPRI64:$val, ADDR:$ptr)]>;
  390. def _f64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI32:$ptr),
  391. !strconcat(asm, " $val $ptr"),
  392. [(OpNode GPRF64:$val, ADDR:$ptr)]>;
  393. def _v4f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4F32:$val, MEMI32:$ptr),
  394. !strconcat(asm, " $val $ptr"),
  395. [(OpNode GPRV4F32:$val, ADDR:$ptr)]>;
  396. def _v2f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F32:$val, MEMI32:$ptr),
  397. !strconcat(asm, " $val $ptr"),
  398. [(OpNode GPRV2F32:$val, ADDR:$ptr)]>;
  399. def _v4i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
  400. !strconcat(asm, " $val $ptr"),
  401. [(OpNode GPRV4I32:$val, ADDR:$ptr)]>;
  402. def _v2i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I8:$val, MEMI32:$ptr),
  403. !strconcat(asm, " $val $ptr"),
  404. [(OpNode GPRV2I8:$val, ADDR:$ptr)]>;
  405. def _v2i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI32:$ptr),
  406. !strconcat(asm, " $val $ptr"),
  407. [(OpNode GPRV2I16:$val, ADDR:$ptr)]>;
  408. def _v4i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I8:$val, MEMI32:$ptr),
  409. !strconcat(asm, " $val $ptr"),
  410. [(OpNode GPRV4I8:$val, ADDR:$ptr)]>;
  411. def _v4i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI32:$ptr),
  412. !strconcat(asm, " $val $ptr"),
  413. [(OpNode GPRV4I16:$val, ADDR:$ptr)]>;
  414. def _v2i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
  415. !strconcat(asm, " $val $ptr"),
  416. [(OpNode GPRV2I32:$val, ADDR:$ptr)]>;
  417. def _v2f64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI32:$ptr),
  418. !strconcat(asm, " $val $ptr"),
  419. [(OpNode GPRV2F64:$val, ADDR:$ptr)]>;
  420. def _v2i64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
  421. !strconcat(asm, " $val $ptr"),
  422. [(OpNode GPRV2I64:$val, ADDR:$ptr)]>;
  423. }
  424. // Multiclass that handles load operations
  425. multiclass LOAD<string asm, PatFrag OpNode> {
  426. def _i8 : OneInOneOut<IL_OP_MOV, (outs GPRI8:$dst), (ins MEMI32:$ptr),
  427. !strconcat(asm, " $dst $ptr"),
  428. [(set GPRI8:$dst, (OpNode ADDR:$ptr))]>;
  429. def _i16 : OneInOneOut<IL_OP_MOV, (outs GPRI16:$dst), (ins MEMI32:$ptr),
  430. !strconcat(asm, " $dst $ptr"),
  431. [(set GPRI16:$dst, (OpNode ADDR:$ptr))]>;
  432. def _i32 : OneInOneOut<IL_OP_MOV, (outs GPRI32:$dst), (ins MEMI32:$ptr),
  433. !strconcat(asm, " $dst $ptr"),
  434. [(set GPRI32:$dst, (OpNode ADDR:$ptr))]>;
  435. def _f32 : OneInOneOut<IL_OP_MOV, (outs GPRF32:$dst), (ins MEMI32:$ptr),
  436. !strconcat(asm, " $dst $ptr"),
  437. [(set GPRF32:$dst, (OpNode ADDR:$ptr))]>;
  438. def _i64 : OneInOneOut<IL_OP_MOV, (outs GPRI64:$dst), (ins MEMI32:$ptr),
  439. !strconcat(asm, " $dst $ptr"),
  440. [(set GPRI64:$dst, (OpNode ADDR:$ptr))]>;
  441. def _f64 : OneInOneOut<IL_OP_MOV, (outs GPRF64:$dst), (ins MEMI32:$ptr),
  442. !strconcat(asm, " $dst $ptr"),
  443. [(set GPRF64:$dst, (OpNode ADDR:$ptr))]>;
  444. def _v4f32 : OneInOneOut<IL_OP_MOV, (outs GPRV4F32:$dst), (ins MEMI32:$ptr),
  445. !strconcat(asm, " $dst $ptr"),
  446. [(set GPRV4F32:$dst, (OpNode ADDR:$ptr))]>;
  447. def _v2f32 : OneInOneOut<IL_OP_MOV, (outs GPRV2F32:$dst), (ins MEMI32:$ptr),
  448. !strconcat(asm, " $dst $ptr"),
  449. [(set GPRV2F32:$dst, (OpNode ADDR:$ptr))]>;
  450. def _v2f64 : OneInOneOut<IL_OP_MOV, (outs GPRV2F64:$dst), (ins MEMI32:$ptr),
  451. !strconcat(asm, " $dst $ptr"),
  452. [(set GPRV2F64:$dst, (OpNode ADDR:$ptr))]>;
  453. def _v4i32 : OneInOneOut<IL_OP_MOV, (outs GPRV4I32:$dst), (ins MEMI32:$ptr),
  454. !strconcat(asm, " $dst $ptr"),
  455. [(set GPRV4I32:$dst, (OpNode ADDR:$ptr))]>;
  456. def _v2i8 : OneInOneOut<IL_OP_MOV, (outs GPRV2I8:$dst), (ins MEMI32:$ptr),
  457. !strconcat(asm, " $dst $ptr"),
  458. [(set GPRV2I8:$dst, (OpNode ADDR:$ptr))]>;
  459. def _v2i16 : OneInOneOut<IL_OP_MOV, (outs GPRV2I16:$dst), (ins MEMI32:$ptr),
  460. !strconcat(asm, " $dst $ptr"),
  461. [(set GPRV2I16:$dst, (OpNode ADDR:$ptr))]>;
  462. def _v4i8 : OneInOneOut<IL_OP_MOV, (outs GPRV4I8:$dst), (ins MEMI32:$ptr),
  463. !strconcat(asm, " $dst $ptr"),
  464. [(set GPRV4I8:$dst, (OpNode ADDR:$ptr))]>;
  465. def _v4i16 : OneInOneOut<IL_OP_MOV, (outs GPRV4I16:$dst), (ins MEMI32:$ptr),
  466. !strconcat(asm, " $dst $ptr"),
  467. [(set GPRV4I16:$dst, (OpNode ADDR:$ptr))]>;
  468. def _v2i32 : OneInOneOut<IL_OP_MOV, (outs GPRV2I32:$dst), (ins MEMI32:$ptr),
  469. !strconcat(asm, " $dst $ptr"),
  470. [(set GPRV2I32:$dst, (OpNode ADDR:$ptr))]>;
  471. def _v2i64 : OneInOneOut<IL_OP_MOV, (outs GPRV2I64:$dst), (ins MEMI32:$ptr),
  472. !strconcat(asm, " $dst $ptr"),
  473. [(set GPRV2I64:$dst, (OpNode ADDR:$ptr))]>;
  474. }
  475. // Multiclass that handles memory store operations
  476. multiclass GTRUNCSTORE64<string asm> {
  477. def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI64:$ptr),
  478. !strconcat(asm, " $val $ptr"),
  479. [(global_i8trunc_store GPRI16:$val, ADDR64:$ptr)]>;
  480. def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
  481. !strconcat(asm, " $val $ptr"),
  482. [(global_i8trunc_store GPRI32:$val, ADDR64:$ptr)]>;
  483. def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  484. !strconcat(asm, " $val $ptr"),
  485. [(global_i8trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  486. def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
  487. !strconcat(asm, " $val $ptr"),
  488. [(global_i16trunc_store GPRI32:$val, ADDR64:$ptr)]>;
  489. def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  490. !strconcat(asm, " $val $ptr"),
  491. [(global_i16trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  492. def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  493. !strconcat(asm, " $val $ptr"),
  494. [(global_i32trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  495. def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI64:$ptr),
  496. !strconcat(asm, " $val $ptr"),
  497. [(global_f32trunc_store GPRF64:$val, ADDR64:$ptr)]>;
  498. def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
  499. !strconcat(asm, " $val $ptr"),
  500. [(global_v2i8trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
  501. def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
  502. !strconcat(asm, " $val $ptr"),
  503. [(global_v4i8trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
  504. def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI64:$ptr),
  505. !strconcat(asm, " $val $ptr"),
  506. [(global_v2i8trunc_store GPRV2I16:$val, ADDR64:$ptr)]>;
  507. def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI64:$ptr),
  508. !strconcat(asm, " $val $ptr"),
  509. [(global_v4i8trunc_store GPRV4I16:$val, ADDR64:$ptr)]>;
  510. def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
  511. !strconcat(asm, " $val $ptr"),
  512. [(global_v2i16trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
  513. def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
  514. !strconcat(asm, " $val $ptr"),
  515. [(global_v4i16trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
  516. def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI64:$ptr),
  517. !strconcat(asm, " $val $ptr"),
  518. [(global_v2f32trunc_store GPRV2F64:$val, ADDR64:$ptr)]>;
  519. def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  520. !strconcat(asm, " $val $ptr"),
  521. [(global_v2i8trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  522. def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  523. !strconcat(asm, " $val $ptr"),
  524. [(global_v2i16trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  525. def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  526. !strconcat(asm, " $val $ptr"),
  527. [(global_v2i32trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  528. }
  529. // Multiclass that handles memory store operations
  530. multiclass LTRUNCSTORE64<string asm> {
  531. def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI64:$ptr),
  532. !strconcat(asm, " $val $ptr"),
  533. [(local_i8trunc_store GPRI16:$val, ADDR64:$ptr)]>;
  534. def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
  535. !strconcat(asm, " $val $ptr"),
  536. [(local_i8trunc_store GPRI32:$val, ADDR64:$ptr)]>;
  537. def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  538. !strconcat(asm, " $val $ptr"),
  539. [(local_i8trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  540. def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
  541. !strconcat(asm, " $val $ptr"),
  542. [(local_i16trunc_store GPRI32:$val, ADDR64:$ptr)]>;
  543. def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  544. !strconcat(asm, " $val $ptr"),
  545. [(local_i16trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  546. def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  547. !strconcat(asm, " $val $ptr"),
  548. [(local_i32trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  549. def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI64:$ptr),
  550. !strconcat(asm, " $val $ptr"),
  551. [(local_f32trunc_store GPRF64:$val, ADDR64:$ptr)]>;
  552. def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
  553. !strconcat(asm, " $val $ptr"),
  554. [(local_v2i8trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
  555. def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
  556. !strconcat(asm, " $val $ptr"),
  557. [(local_v4i8trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
  558. def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI64:$ptr),
  559. !strconcat(asm, " $val $ptr"),
  560. [(local_v2i8trunc_store GPRV2I16:$val, ADDR64:$ptr)]>;
  561. def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI64:$ptr),
  562. !strconcat(asm, " $val $ptr"),
  563. [(local_v4i8trunc_store GPRV4I16:$val, ADDR64:$ptr)]>;
  564. def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
  565. !strconcat(asm, " $val $ptr"),
  566. [(local_v2i16trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
  567. def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
  568. !strconcat(asm, " $val $ptr"),
  569. [(local_v4i16trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
  570. def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI64:$ptr),
  571. !strconcat(asm, " $val $ptr"),
  572. [(local_v2f32trunc_store GPRV2F64:$val, ADDR64:$ptr)]>;
  573. def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  574. !strconcat(asm, " $val $ptr"),
  575. [(local_v2i8trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  576. def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  577. !strconcat(asm, " $val $ptr"),
  578. [(local_v2i16trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  579. def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  580. !strconcat(asm, " $val $ptr"),
  581. [(local_v2i32trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  582. }
  583. // Multiclass that handles memory store operations
  584. multiclass PTRUNCSTORE64<string asm> {
  585. def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI64:$ptr),
  586. !strconcat(asm, " $val $ptr"),
  587. [(private_i8trunc_store GPRI16:$val, ADDR64:$ptr)]>;
  588. def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
  589. !strconcat(asm, " $val $ptr"),
  590. [(private_i8trunc_store GPRI32:$val, ADDR64:$ptr)]>;
  591. def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  592. !strconcat(asm, " $val $ptr"),
  593. [(private_i8trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  594. def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
  595. !strconcat(asm, " $val $ptr"),
  596. [(private_i16trunc_store GPRI32:$val, ADDR64:$ptr)]>;
  597. def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  598. !strconcat(asm, " $val $ptr"),
  599. [(private_i16trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  600. def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  601. !strconcat(asm, " $val $ptr"),
  602. [(private_i32trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  603. def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI64:$ptr),
  604. !strconcat(asm, " $val $ptr"),
  605. [(private_f32trunc_store GPRF64:$val, ADDR64:$ptr)]>;
  606. def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
  607. !strconcat(asm, " $val $ptr"),
  608. [(private_v2i8trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
  609. def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
  610. !strconcat(asm, " $val $ptr"),
  611. [(private_v4i8trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
  612. def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI64:$ptr),
  613. !strconcat(asm, " $val $ptr"),
  614. [(private_v2i8trunc_store GPRV2I16:$val, ADDR64:$ptr)]>;
  615. def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI64:$ptr),
  616. !strconcat(asm, " $val $ptr"),
  617. [(private_v4i8trunc_store GPRV4I16:$val, ADDR64:$ptr)]>;
  618. def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
  619. !strconcat(asm, " $val $ptr"),
  620. [(private_v2i16trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
  621. def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
  622. !strconcat(asm, " $val $ptr"),
  623. [(private_v4i16trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
  624. def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI64:$ptr),
  625. !strconcat(asm, " $val $ptr"),
  626. [(private_v2f32trunc_store GPRV2F64:$val, ADDR64:$ptr)]>;
  627. def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  628. !strconcat(asm, " $val $ptr"),
  629. [(private_v2i8trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  630. def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  631. !strconcat(asm, " $val $ptr"),
  632. [(private_v2i16trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  633. def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  634. !strconcat(asm, " $val $ptr"),
  635. [(private_v2i32trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  636. }
  637. // Multiclass that handles memory store operations
  638. multiclass RTRUNCSTORE64<string asm> {
  639. def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI64:$ptr),
  640. !strconcat(asm, " $val $ptr"),
  641. [(region_i8trunc_store GPRI16:$val, ADDR64:$ptr)]>;
  642. def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
  643. !strconcat(asm, " $val $ptr"),
  644. [(region_i8trunc_store GPRI32:$val, ADDR64:$ptr)]>;
  645. def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  646. !strconcat(asm, " $val $ptr"),
  647. [(region_i8trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  648. def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
  649. !strconcat(asm, " $val $ptr"),
  650. [(region_i16trunc_store GPRI32:$val, ADDR64:$ptr)]>;
  651. def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  652. !strconcat(asm, " $val $ptr"),
  653. [(region_i16trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  654. def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  655. !strconcat(asm, " $val $ptr"),
  656. [(region_i32trunc_store GPRI64:$val, ADDR64:$ptr)]>;
  657. def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI64:$ptr),
  658. !strconcat(asm, " $val $ptr"),
  659. [(region_f32trunc_store GPRF64:$val, ADDR64:$ptr)]>;
  660. def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
  661. !strconcat(asm, " $val $ptr"),
  662. [(region_v2i8trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
  663. def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
  664. !strconcat(asm, " $val $ptr"),
  665. [(region_v4i8trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
  666. def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI64:$ptr),
  667. !strconcat(asm, " $val $ptr"),
  668. [(region_v2i8trunc_store GPRV2I16:$val, ADDR64:$ptr)]>;
  669. def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI64:$ptr),
  670. !strconcat(asm, " $val $ptr"),
  671. [(region_v4i8trunc_store GPRV4I16:$val, ADDR64:$ptr)]>;
  672. def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
  673. !strconcat(asm, " $val $ptr"),
  674. [(region_v2i16trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
  675. def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
  676. !strconcat(asm, " $val $ptr"),
  677. [(region_v4i16trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
  678. def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI64:$ptr),
  679. !strconcat(asm, " $val $ptr"),
  680. [(region_v2f32trunc_store GPRV2F64:$val, ADDR64:$ptr)]>;
  681. def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  682. !strconcat(asm, " $val $ptr"),
  683. [(region_v2i8trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  684. def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  685. !strconcat(asm, " $val $ptr"),
  686. [(region_v2i16trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  687. def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  688. !strconcat(asm, " $val $ptr"),
  689. [(region_v2i32trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
  690. }
  691. // Multiclass that handles memory store operations
  692. multiclass STORE64<string asm, PatFrag OpNode> {
  693. def _i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI8:$val, MEMI64:$ptr),
  694. !strconcat(asm, " $val $ptr"),
  695. [(OpNode GPRI8:$val, ADDR64:$ptr)]>;
  696. def _i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI64:$ptr),
  697. !strconcat(asm, " $val $ptr"),
  698. [(OpNode GPRI16:$val, ADDR64:$ptr)]>;
  699. def _i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
  700. !strconcat(asm, " $val $ptr"),
  701. [(OpNode GPRI32:$val, ADDR64:$ptr)]>;
  702. def _f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF32:$val, MEMI64:$ptr),
  703. !strconcat(asm, " $val $ptr"),
  704. [(OpNode GPRF32:$val, ADDR64:$ptr)]>;
  705. def _i64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
  706. !strconcat(asm, " $val $ptr"),
  707. [(OpNode GPRI64:$val, ADDR64:$ptr)]>;
  708. def _f64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI64:$ptr),
  709. !strconcat(asm, " $val $ptr"),
  710. [(OpNode GPRF64:$val, ADDR64:$ptr)]>;
  711. def _v4f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4F32:$val, MEMI64:$ptr),
  712. !strconcat(asm, " $val $ptr"),
  713. [(OpNode GPRV4F32:$val, ADDR64:$ptr)]>;
  714. def _v2f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F32:$val, MEMI64:$ptr),
  715. !strconcat(asm, " $val $ptr"),
  716. [(OpNode GPRV2F32:$val, ADDR64:$ptr)]>;
  717. def _v4i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
  718. !strconcat(asm, " $val $ptr"),
  719. [(OpNode GPRV4I32:$val, ADDR64:$ptr)]>;
  720. def _v2i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I8:$val, MEMI64:$ptr),
  721. !strconcat(asm, " $val $ptr"),
  722. [(OpNode GPRV2I8:$val, ADDR64:$ptr)]>;
  723. def _v2i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI64:$ptr),
  724. !strconcat(asm, " $val $ptr"),
  725. [(OpNode GPRV2I16:$val, ADDR64:$ptr)]>;
  726. def _v4i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I8:$val, MEMI64:$ptr),
  727. !strconcat(asm, " $val $ptr"),
  728. [(OpNode GPRV4I8:$val, ADDR64:$ptr)]>;
  729. def _v4i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI64:$ptr),
  730. !strconcat(asm, " $val $ptr"),
  731. [(OpNode GPRV4I16:$val, ADDR64:$ptr)]>;
  732. def _v2i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
  733. !strconcat(asm, " $val $ptr"),
  734. [(OpNode GPRV2I32:$val, ADDR64:$ptr)]>;
  735. def _v2f64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI64:$ptr),
  736. !strconcat(asm, " $val $ptr"),
  737. [(OpNode GPRV2F64:$val, ADDR64:$ptr)]>;
  738. def _v2i64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
  739. !strconcat(asm, " $val $ptr"),
  740. [(OpNode GPRV2I64:$val, ADDR64:$ptr)]>;
  741. }
  742. // Multiclass that handles load operations
  743. multiclass LOAD64<string asm, PatFrag OpNode> {
  744. def _i8 : OneInOneOut<IL_OP_MOV, (outs GPRI8:$dst), (ins MEMI64:$ptr),
  745. !strconcat(asm, " $dst $ptr"),
  746. [(set GPRI8:$dst, (OpNode ADDR64:$ptr))]>;
  747. def _i16 : OneInOneOut<IL_OP_MOV, (outs GPRI16:$dst), (ins MEMI64:$ptr),
  748. !strconcat(asm, " $dst $ptr"),
  749. [(set GPRI16:$dst, (OpNode ADDR64:$ptr))]>;
  750. def _i32 : OneInOneOut<IL_OP_MOV, (outs GPRI32:$dst), (ins MEMI64:$ptr),
  751. !strconcat(asm, " $dst $ptr"),
  752. [(set GPRI32:$dst, (OpNode ADDR64:$ptr))]>;
  753. def _f32 : OneInOneOut<IL_OP_MOV, (outs GPRF32:$dst), (ins MEMI64:$ptr),
  754. !strconcat(asm, " $dst $ptr"),
  755. [(set GPRF32:$dst, (OpNode ADDR64:$ptr))]>;
  756. def _i64 : OneInOneOut<IL_OP_MOV, (outs GPRI64:$dst), (ins MEMI64:$ptr),
  757. !strconcat(asm, " $dst $ptr"),
  758. [(set GPRI64:$dst, (OpNode ADDR64:$ptr))]>;
  759. def _f64 : OneInOneOut<IL_OP_MOV, (outs GPRF64:$dst), (ins MEMI64:$ptr),
  760. !strconcat(asm, " $dst $ptr"),
  761. [(set GPRF64:$dst, (OpNode ADDR64:$ptr))]>;
  762. def _v4f32 : OneInOneOut<IL_OP_MOV, (outs GPRV4F32:$dst), (ins MEMI64:$ptr),
  763. !strconcat(asm, " $dst $ptr"),
  764. [(set GPRV4F32:$dst, (OpNode ADDR64:$ptr))]>;
  765. def _v2f32 : OneInOneOut<IL_OP_MOV, (outs GPRV2F32:$dst), (ins MEMI64:$ptr),
  766. !strconcat(asm, " $dst $ptr"),
  767. [(set GPRV2F32:$dst, (OpNode ADDR64:$ptr))]>;
  768. def _v2f64 : OneInOneOut<IL_OP_MOV, (outs GPRV2F64:$dst), (ins MEMI64:$ptr),
  769. !strconcat(asm, " $dst $ptr"),
  770. [(set GPRV2F64:$dst, (OpNode ADDR64:$ptr))]>;
  771. def _v4i32 : OneInOneOut<IL_OP_MOV, (outs GPRV4I32:$dst), (ins MEMI64:$ptr),
  772. !strconcat(asm, " $dst $ptr"),
  773. [(set GPRV4I32:$dst, (OpNode ADDR64:$ptr))]>;
  774. def _v2i8 : OneInOneOut<IL_OP_MOV, (outs GPRV2I8:$dst), (ins MEMI64:$ptr),
  775. !strconcat(asm, " $dst $ptr"),
  776. [(set GPRV2I8:$dst, (OpNode ADDR64:$ptr))]>;
  777. def _v2i16 : OneInOneOut<IL_OP_MOV, (outs GPRV2I16:$dst), (ins MEMI64:$ptr),
  778. !strconcat(asm, " $dst $ptr"),
  779. [(set GPRV2I16:$dst, (OpNode ADDR64:$ptr))]>;
  780. def _v4i8 : OneInOneOut<IL_OP_MOV, (outs GPRV4I8:$dst), (ins MEMI64:$ptr),
  781. !strconcat(asm, " $dst $ptr"),
  782. [(set GPRV4I8:$dst, (OpNode ADDR64:$ptr))]>;
  783. def _v4i16 : OneInOneOut<IL_OP_MOV, (outs GPRV4I16:$dst), (ins MEMI64:$ptr),
  784. !strconcat(asm, " $dst $ptr"),
  785. [(set GPRV4I16:$dst, (OpNode ADDR64:$ptr))]>;
  786. def _v2i32 : OneInOneOut<IL_OP_MOV, (outs GPRV2I32:$dst), (ins MEMI64:$ptr),
  787. !strconcat(asm, " $dst $ptr"),
  788. [(set GPRV2I32:$dst, (OpNode ADDR64:$ptr))]>;
  789. def _v2i64 : OneInOneOut<IL_OP_MOV, (outs GPRV2I64:$dst), (ins MEMI64:$ptr),
  790. !strconcat(asm, " $dst $ptr"),
  791. [(set GPRV2I64:$dst, (OpNode ADDR64:$ptr))]>;
  792. }
  793. // Only scalar types should generate flow control
  794. multiclass BranchInstr<ILOpCode opc> {
  795. def _i8 : UnaryOpNoRet<opc, (outs), (ins GPRI8:$src),
  796. !strconcat(opc.Text, " $src"), []>;
  797. def _i16 : UnaryOpNoRet<opc, (outs), (ins GPRI16:$src),
  798. !strconcat(opc.Text, " $src"), []>;
  799. def _i32 : UnaryOpNoRet<opc, (outs), (ins GPRI32:$src),
  800. !strconcat(opc.Text, " $src"), []>;
  801. def _i64 : UnaryOpNoRet<opc, (outs), (ins GPRI64:$src),
  802. !strconcat(opc.Text, " $src"), []>;
  803. def _f32 : UnaryOpNoRet<opc, (outs), (ins GPRF32:$src),
  804. !strconcat(opc.Text, " $src"), []>;
  805. def _f64 : UnaryOpNoRet<opc, (outs), (ins GPRF64:$src),
  806. !strconcat(opc.Text, " $src"), []>;
  807. }
  808. // Only scalar types should generate flow control
  809. multiclass BranchInstr2<ILOpCode opc> {
  810. def _i8 : BinaryOpNoRet<opc, (outs), (ins GPRI8:$src0, GPRI8:$src1),
  811. !strconcat(opc.Text, " $src0, $src1"), []>;
  812. def _i16 : BinaryOpNoRet<opc, (outs), (ins GPRI16:$src0, GPRI16:$src1),
  813. !strconcat(opc.Text, " $src0, $src1"), []>;
  814. def _i32 : BinaryOpNoRet<opc, (outs), (ins GPRI32:$src0, GPRI32:$src1),
  815. !strconcat(opc.Text, " $src0, $src1"), []>;
  816. def _i64 : BinaryOpNoRet<opc, (outs), (ins GPRI64:$src0, GPRI64:$src1),
  817. !strconcat(opc.Text, " $src0, $src1"), []>;
  818. def _f32 : BinaryOpNoRet<opc, (outs), (ins GPRF32:$src0, GPRF32:$src1),
  819. !strconcat(opc.Text, " $src0, $src1"), []>;
  820. def _f64 : BinaryOpNoRet<opc, (outs), (ins GPRF64:$src0, GPRF64:$src1),
  821. !strconcat(opc.Text, " $src0, $src1"), []>;
  822. }
  823. // Class that handles the various vector extract patterns
  824. multiclass VectorExtract<SDNode OpNode> {
  825. def _v2f64 : ExtractVectorClass<GPRF64, GPRV2F64, OpNode>;
  826. def _v4f32: ExtractVectorClass<GPRF32, GPRV4F32, OpNode>;
  827. def _v2f32 : ExtractVectorClass<GPRF32, GPRV2F32, OpNode>;
  828. def _v2i64 : ExtractVectorClass<GPRI64, GPRV2I64, OpNode>;
  829. def _v4i8 : ExtractVectorClass<GPRI8, GPRV4I8, OpNode>;
  830. def _v4i16 : ExtractVectorClass<GPRI16, GPRV4I16, OpNode>;
  831. def _v4i32 : ExtractVectorClass<GPRI32, GPRV4I32, OpNode>;
  832. def _v2i8 : ExtractVectorClass<GPRI8, GPRV2I8, OpNode>;
  833. def _v2i16 : ExtractVectorClass<GPRI16, GPRV2I16, OpNode>;
  834. def _v2i32 : ExtractVectorClass<GPRI32, GPRV2I32, OpNode>;
  835. }
  836. multiclass VectorConcat<SDNode OpNode> {
  837. def _v2f64 : VectorConcatClass<GPRV2F64, GPRF64, OpNode>;
  838. def _v2i64 : VectorConcatClass<GPRV2F64, GPRI64, OpNode>;
  839. def _v4f32 : VectorConcatClass<GPRV4F32, GPRV2F32, OpNode>;
  840. def _v4i32 : VectorConcatClass<GPRV4I32, GPRV2I32, OpNode>;
  841. def _v4i16 : VectorConcatClass<GPRV4I16, GPRV2I16, OpNode>;
  842. def _v4i8 : VectorConcatClass<GPRV4I8, GPRV2I8, OpNode>;
  843. def _v2f32 : VectorConcatClass<GPRV2F32, GPRF32, OpNode>;
  844. def _v2i32 : VectorConcatClass<GPRV2I32, GPRI32, OpNode>;
  845. def _v2i16 : VectorConcatClass<GPRV2I16, GPRI16, OpNode>;
  846. def _v2i8 : VectorConcatClass<GPRV2I8, GPRI8, OpNode>;
  847. }
  848. // Class that handles the various vector insert patterns
  849. multiclass VectorInsert<SDNode OpNode> {
  850. def _v2f64 : InsertVectorClass<IL_OP_I_ADD, GPRV2F64,
  851. GPRF64, OpNode, "iadd">;
  852. def _v4f32: InsertVectorClass<IL_OP_I_ADD, GPRV4F32,
  853. GPRF32, OpNode, "iadd">;
  854. def _v2f32 : InsertVectorClass<IL_OP_I_ADD, GPRV2F32,
  855. GPRF32, OpNode, "iadd">;
  856. def _v2i64 : InsertVectorClass<IL_OP_I_ADD, GPRV2I64,
  857. GPRI64, OpNode, "iadd">;
  858. def _v4i8 : InsertVectorClass<IL_OP_I_ADD, GPRV4I8,
  859. GPRI8, OpNode, "iadd">;
  860. def _v4i16 : InsertVectorClass<IL_OP_I_ADD, GPRV4I16,
  861. GPRI16, OpNode, "iadd">;
  862. def _v4i32 : InsertVectorClass<IL_OP_I_ADD, GPRV4I32,
  863. GPRI32, OpNode, "iadd">;
  864. def _v2i8 : InsertVectorClass<IL_OP_I_ADD, GPRV2I8,
  865. GPRI8, OpNode, "iadd">;
  866. def _v2i16 : InsertVectorClass<IL_OP_I_ADD, GPRV2I16,
  867. GPRI16, OpNode, "iadd">;
  868. def _v2i32 : InsertVectorClass<IL_OP_I_ADD, GPRV2I32,
  869. GPRI32, OpNode, "iadd">;
  870. }
  871. // generic class that handles math instruction for OneInOneOut instruction
  872. // patterns
  873. multiclass UnaryOpMC<ILOpCode OpCode, SDNode OpNode> {
  874. def _i8 : UnaryOp<OpCode, OpNode, GPRI8, GPRI8>;
  875. def _i16 : UnaryOp<OpCode, OpNode, GPRI16, GPRI16>;
  876. def _i32 : UnaryOp<OpCode, OpNode, GPRI32, GPRI32>;
  877. def _f32 : UnaryOp<OpCode, OpNode, GPRF32, GPRF32>;
  878. def _f64 : UnaryOp<OpCode, OpNode, GPRF64, GPRF64>;
  879. def _i64 : UnaryOp<OpCode, OpNode, GPRI64, GPRI64>;
  880. def _v4f32: UnaryOp<OpCode, OpNode, GPRV4F32, GPRV4F32>;
  881. def _v4i16 : UnaryOp<OpCode, OpNode, GPRV4I16, GPRV4I16>;
  882. def _v4i8 : UnaryOp<OpCode, OpNode, GPRV4I8, GPRV4I8>;
  883. def _v4i32 : UnaryOp<OpCode, OpNode, GPRV4I32, GPRV4I32>;
  884. def _v2f32 : UnaryOp<OpCode, OpNode, GPRV2F32, GPRV2F32>;
  885. def _v2i16 : UnaryOp<OpCode, OpNode, GPRV2I16, GPRV2I16>;
  886. def _v2i8 : UnaryOp<OpCode, OpNode, GPRV2I8, GPRV2I8>;
  887. def _v2i32 : UnaryOp<OpCode, OpNode, GPRV2I32, GPRV2I32>;
  888. def _v2f64 : UnaryOp<OpCode, OpNode, GPRV2F64, GPRV2F64>;
  889. def _v2i64 : UnaryOp<OpCode, OpNode, GPRV2I64, GPRV2I64>;
  890. }
  891. multiclass UnaryOpMCVec<ILOpCode OpCode, SDNode OpNode> {
  892. def _v4f32: UnaryOp<OpCode, OpNode, GPRV4F32, GPRF32>;
  893. def _v4i16 : UnaryOp<OpCode, OpNode, GPRV4I16, GPRI16>;
  894. def _v4i8 : UnaryOp<OpCode, OpNode, GPRV4I8, GPRI8>;
  895. def _v4i32 : UnaryOp<OpCode, OpNode, GPRV4I32, GPRI32>;
  896. def _v2f32 : UnaryOp<OpCode, OpNode, GPRV2F32, GPRF32>;
  897. def _v2i16 : UnaryOp<OpCode, OpNode, GPRV2I16, GPRI16>;
  898. def _v2i8 : UnaryOp<OpCode, OpNode, GPRV2I8, GPRI8>;
  899. def _v2i32 : UnaryOp<OpCode, OpNode, GPRV2I32, GPRI32>;
  900. def _v2f64 : UnaryOp<OpCode, OpNode, GPRV2F64, GPRF64>;
  901. def _v2i64 : UnaryOp<OpCode, OpNode, GPRV2I64, GPRI64>;
  902. }
  903. multiclass UnaryOpMCf32<
  904. ILOpCode f32OpCode,
  905. SDNode OpNode> {
  906. def _f32 : UnaryOp<f32OpCode, OpNode, GPRF32, GPRF32>;
  907. def _v4f32: UnaryOp<f32OpCode, OpNode, GPRV4F32, GPRV4F32>;
  908. def _v2f32 : UnaryOp<f32OpCode, OpNode, GPRV2F32, GPRV2F32>;
  909. }
  910. multiclass UnaryOpMCi32<
  911. ILOpCode i32OpCode,
  912. SDNode OpNode> {
  913. def _i8 : UnaryOp<i32OpCode, OpNode, GPRI8, GPRI8>;
  914. def _i16 : UnaryOp<i32OpCode, OpNode, GPRI16, GPRI16>;
  915. def _i32 : UnaryOp<i32OpCode, OpNode, GPRI32, GPRI32>;
  916. def _v4i16 : UnaryOp<i32OpCode, OpNode, GPRV4I16, GPRV4I16>;
  917. def _v4i8 : UnaryOp<i32OpCode, OpNode, GPRV4I8, GPRV4I8>;
  918. def _v4i32 : UnaryOp<i32OpCode, OpNode, GPRV4I32, GPRV4I32>;
  919. def _v2i16 : UnaryOp<i32OpCode, OpNode, GPRV2I16, GPRV2I16>;
  920. def _v2i8 : UnaryOp<i32OpCode, OpNode, GPRV2I8, GPRV2I8>;
  921. def _v2i32 : UnaryOp<i32OpCode, OpNode, GPRV2I32, GPRV2I32>;
  922. }
  923. multiclass BinaryOpMC<ILOpCode OpCode, SDNode OpNode> {
  924. def _i8 : BinaryOp<OpCode, OpNode, GPRI8, GPRI8, GPRI8>;
  925. def _i16 : BinaryOp<OpCode, OpNode, GPRI16, GPRI16, GPRI16>;
  926. def _i32 : BinaryOp<OpCode, OpNode, GPRI32, GPRI32, GPRI32>;
  927. def _f32 : BinaryOp<OpCode, OpNode, GPRF32, GPRF32, GPRF32>;
  928. def _f64 : BinaryOp<OpCode, OpNode, GPRF64, GPRF64, GPRF64>;
  929. def _i64 : BinaryOp<OpCode, OpNode, GPRI64, GPRI64, GPRI64>;
  930. def _v4f32: BinaryOp<OpCode, OpNode, GPRV4F32, GPRV4F32, GPRV4F32>;
  931. def _v4i16 : BinaryOp<OpCode, OpNode, GPRV4I16, GPRV4I16, GPRV4I16>;
  932. def _v4i8 : BinaryOp<OpCode, OpNode, GPRV4I8, GPRV4I8, GPRV4I8>;
  933. def _v4i32 : BinaryOp<OpCode, OpNode, GPRV4I32, GPRV4I32, GPRV4I32>;
  934. def _v2f32 : BinaryOp<OpCode, OpNode, GPRV2F32, GPRV2F32, GPRV2F32>;
  935. def _v2i16 : BinaryOp<OpCode, OpNode, GPRV2I16, GPRV2I16, GPRV2I16>;
  936. def _v2i8 : BinaryOp<OpCode, OpNode, GPRV2I8, GPRV2I8, GPRV2I8>;
  937. def _v2i32 : BinaryOp<OpCode, OpNode, GPRV2I32, GPRV2I32, GPRV2I32>;
  938. def _v2f64 : BinaryOp<OpCode, OpNode, GPRV2F64, GPRV2F64, GPRV2F64>;
  939. def _v2i64 : BinaryOp<OpCode, OpNode, GPRV2I64, GPRV2I64, GPRV2I64>;
  940. }
  941. multiclass BinaryOpMCInt<ILOpCode OpCode, SDNode OpNode> {
  942. def _i8 : BinaryOp<OpCode, OpNode, GPRI8, GPRI8, GPRI8>;
  943. def _i16 : BinaryOp<OpCode, OpNode, GPRI16, GPRI16, GPRI16>;
  944. def _i32 : BinaryOp<OpCode, OpNode, GPRI32, GPRI32, GPRI32>;
  945. def _i64 : BinaryOp<OpCode, OpNode, GPRI64, GPRI64, GPRI64>;
  946. def _v4i16 : BinaryOp<OpCode, OpNode, GPRV4I16, GPRV4I16, GPRV4I16>;
  947. def _v4i8 : BinaryOp<OpCode, OpNode, GPRV4I8, GPRV4I8, GPRV4I8>;
  948. def _v4i32 : BinaryOp<OpCode, OpNode, GPRV4I32, GPRV4I32, GPRV4I32>;
  949. def _v2i16 : BinaryOp<OpCode, OpNode, GPRV2I16, GPRV2I16, GPRV2I16>;
  950. def _v2i8 : BinaryOp<OpCode, OpNode, GPRV2I8, GPRV2I8, GPRV2I8>;
  951. def _v2i32 : BinaryOp<OpCode, OpNode, GPRV2I32, GPRV2I32, GPRV2I32>;
  952. def _v2i64 : BinaryOp<OpCode, OpNode, GPRV2I64, GPRV2I64, GPRV2I64>;
  953. }
  954. // generic class that handles math instruction for ThreeInOneOut
  955. // instruction patterns
  956. multiclass TernaryOpMC<ILOpCode OpCode, SDNode OpNode> {
  957. def _i8 : TernaryOp<OpCode, OpNode, GPRI8, GPRI8, GPRI8, GPRI8>;
  958. def _i16 : TernaryOp<OpCode, OpNode, GPRI16, GPRI16, GPRI16, GPRI16>;
  959. def _i32 : TernaryOp<OpCode, OpNode, GPRI32, GPRI32, GPRI32, GPRI32>;
  960. def _f32 : TernaryOp<OpCode, OpNode, GPRF32, GPRF32, GPRF32, GPRF32>;
  961. def _f64 : TernaryOp<OpCode, OpNode, GPRF64, GPRF64, GPRF64, GPRF64>;
  962. def _i64 : TernaryOp<OpCode, OpNode, GPRI64, GPRI64, GPRI64, GPRI64>;
  963. def _v4f32: TernaryOp<OpCode, OpNode, GPRV4F32, GPRV4F32,
  964. GPRV4F32, GPRV4F32>;
  965. def _v4i8 : TernaryOp<OpCode, OpNode, GPRV4I8, GPRV4I8,
  966. GPRV4I8, GPRV4I8>;
  967. def _v4i16 : TernaryOp<OpCode, OpNode, GPRV4I16, GPRV4I16,
  968. GPRV4I16, GPRV4I16>;
  969. def _v4i32 : TernaryOp<OpCode, OpNode, GPRV4I32, GPRV4I32,
  970. GPRV4I32, GPRV4I32>;
  971. def _v2f32 : TernaryOp<OpCode, OpNode, GPRV2F32, GPRV2F32,
  972. GPRV2F32, GPRV2F32>;
  973. def _v2i8 : TernaryOp<OpCode, OpNode, GPRV2I8, GPRV2I8,
  974. GPRV2I8, GPRV2I8>;
  975. def _v2i16 : TernaryOp<OpCode, OpNode, GPRV2I16, GPRV2I16,
  976. GPRV2I16, GPRV2I16>;
  977. def _v2i32 : TernaryOp<OpCode, OpNode, GPRV2I32, GPRV2I32,
  978. GPRV2I32, GPRV2I32>;
  979. def _v2f64 : TernaryOp<OpCode, OpNode, GPRV2F64, GPRV2F64,
  980. GPRV2F64, GPRV2F64>;
  981. def _v2i64 : TernaryOp<OpCode, OpNode, GPRV2I64, GPRV2I64,
  982. GPRV2I64, GPRV2I64>;
  983. }
  984. multiclass BinaryOpMCi32<ILOpCode i32OpCode, SDNode OpNode> {
  985. def _i8 : BinaryOp<i32OpCode, OpNode, GPRI8, GPRI8, GPRI8>;
  986. def _i16 : BinaryOp<i32OpCode, OpNode, GPRI16, GPRI16, GPRI16>;
  987. def _i32 : BinaryOp<i32OpCode, OpNode, GPRI32, GPRI32, GPRI32>;
  988. def _v4i16 : BinaryOp<i32OpCode, OpNode, GPRV4I16,
  989. GPRV4I16, GPRV4I16>;
  990. def _v4i8 : BinaryOp<i32OpCode, OpNode, GPRV4I8,
  991. GPRV4I8, GPRV4I8>;
  992. def _v4i32 : BinaryOp<i32OpCode, OpNode, GPRV4I32,
  993. GPRV4I32, GPRV4I32>;
  994. def _v2i16 : BinaryOp<i32OpCode, OpNode, GPRV2I16,
  995. GPRV2I16, GPRV2I16>;
  996. def _v2i8 : BinaryOp<i32OpCode, OpNode, GPRV2I8,
  997. GPRV2I8, GPRV2I8>;
  998. def _v2i32 : BinaryOp<i32OpCode, OpNode, GPRV2I32,
  999. GPRV2I32, GPRV2I32>;
  1000. }
  1001. multiclass BinaryOpMCi64<ILOpCode i64OpCode, SDNode OpNode> {
  1002. def _i64 : BinaryOp<i64OpCode, OpNode, GPRI64, GPRI64, GPRI64>;
  1003. def _v2i64 : BinaryOp<i64OpCode, OpNode, GPRV2I64,
  1004. GPRV2I64, GPRV2I64>;
  1005. }
  1006. multiclass BinaryOpMCi32Const<ILOpCode i32OpCode, SDNode OpNode> {
  1007. def _i8 : BinaryOp<i32OpCode, OpNode, GPRI8, GPRI8, GPRI32>;
  1008. def _i16 : BinaryOp<i32OpCode, OpNode, GPRI16, GPRI16, GPRI32>;
  1009. def _i32 : BinaryOp<i32OpCode, OpNode, GPRI32, GPRI32, GPRI32>;
  1010. def _v4i16 : BinaryOp<i32OpCode, OpNode, GPRV4I32,
  1011. GPRV4I32, GPRI32>;
  1012. def _v4i8 : BinaryOp<i32OpCode, OpNode, GPRV4I32,
  1013. GPRV4I32, GPRI32>;
  1014. def _v4i32 : BinaryOp<i32OpCode, OpNode, GPRV4I32,
  1015. GPRV4I32, GPRI32>;
  1016. def _v2i16 : BinaryOp<i32OpCode, OpNode, GPRV2I32,
  1017. GPRV2I32, GPRI32>;
  1018. def _v2i8 : BinaryOp<i32OpCode, OpNode, GPRV2I32,
  1019. GPRV2I32, GPRI32>;
  1020. def _v2i32 : BinaryOp<i32OpCode, OpNode, GPRV2I32,
  1021. GPRV2I32, GPRI32>;
  1022. }
  1023. multiclass BinaryOpMCf32<ILOpCode f32OpCode, SDNode OpNode> {
  1024. def _f32 : BinaryOp<f32OpCode, OpNode, GPRF32,
  1025. GPRF32, GPRF32>;
  1026. def _v4f32: BinaryOp<f32OpCode, OpNode, GPRV4F32,
  1027. GPRV4F32, GPRV4F32>;
  1028. def _v2f32 : BinaryOp<f32OpCode, OpNode, GPRV2F32,
  1029. GPRV2F32, GPRV2F32>;
  1030. }
  1031. multiclass TernaryOpMCf64<ILOpCode f64OpCode, SDNode OpNode> {
  1032. def _f64 : TernaryOp<f64OpCode, OpNode, GPRF64,
  1033. GPRF64, GPRF64, GPRF64>;
  1034. }
  1035. multiclass TernaryOpMCf32<ILOpCode f32OpCode, SDNode OpNode> {
  1036. def _f32 : TernaryOp<f32OpCode, OpNode, GPRF32,
  1037. GPRF32, GPRF32, GPRF32>;
  1038. def _v4f32: TernaryOp<f32OpCode, OpNode, GPRV4F32,
  1039. GPRV4F32, GPRV4F32, GPRV4F32>;
  1040. def _v2f32 : TernaryOp<f32OpCode, OpNode, GPRV2F32,
  1041. GPRV2F32, GPRV2F32, GPRV2F32>;
  1042. }
  1043. multiclass BinaryOpMCFloat<ILOpCode f32OpCode, ILOpCode f64OpCode,
  1044. SDNode OpNode> {
  1045. def _f64 : BinaryOp<f64OpCode, OpNode, GPRF64,
  1046. GPRF64, GPRF64>;
  1047. def _v2f64 : BinaryOp<f64OpCode, OpNode, GPRV2F64,
  1048. GPRV2F64, GPRV2F64>;
  1049. def _f32 : BinaryOp<f32OpCode, OpNode, GPRF32,
  1050. GPRF32, GPRF32>;
  1051. def _v2f32 : BinaryOp<f32OpCode, OpNode, GPRV2F32,
  1052. GPRV2F32, GPRV2F32>;
  1053. def _v4f32: BinaryOp<f32OpCode, OpNode, GPRV4F32,
  1054. GPRV4F32, GPRV4F32>;
  1055. }
  1056. multiclass TernaryOpMCScalar<ILOpCode opcode, SDNode node>
  1057. {
  1058. def _i8: TernaryOp<opcode, node, GPRI8, GPRI8, GPRI8, GPRI8>;
  1059. def _i16: TernaryOp<opcode, node, GPRI16, GPRI8, GPRI16, GPRI16>;
  1060. def _i32: TernaryOp<opcode, node, GPRI32, GPRI8, GPRI32, GPRI32>;
  1061. def _i64: TernaryOp<opcode, node, GPRI64, GPRI8, GPRI64, GPRI64>;
  1062. def _f32: TernaryOp<opcode, node, GPRF32, GPRI8, GPRF32, GPRF32>;
  1063. def _f64: TernaryOp<opcode, node, GPRF64, GPRI8, GPRF64, GPRF64>;
  1064. }
  1065. multiclass BitConversion<ILOpCode opcode, RegisterClass Regs, SDNode OpNode>
  1066. {
  1067. def _i8 : UnaryOp<opcode, OpNode, Regs, GPRI8>;
  1068. def _i16 : UnaryOp<opcode, OpNode, Regs, GPRI16>;
  1069. def _i32 : UnaryOp<opcode, OpNode, Regs, GPRI32>;
  1070. def _f32 : UnaryOp<opcode, OpNode, Regs, GPRF32>;
  1071. def _i64 : UnaryOp<opcode, OpNode, Regs, GPRI64>;
  1072. def _f64 : UnaryOp<opcode, OpNode, Regs, GPRF64>;
  1073. def _v2i8 : UnaryOp<opcode, OpNode, Regs, GPRV2I8>;
  1074. def _v2i16 : UnaryOp<opcode, OpNode, Regs, GPRV2I16>;
  1075. def _v2i32 : UnaryOp<opcode, OpNode, Regs, GPRV2I32>;
  1076. def _v2f32 : UnaryOp<opcode, OpNode, Regs, GPRV2F32>;
  1077. def _v2i64 : UnaryOp<opcode, OpNode, Regs, GPRV2I64>;
  1078. def _v2f64 : UnaryOp<opcode, OpNode, Regs, GPRV2F64>;
  1079. def _v4i8 : UnaryOp<opcode, OpNode, Regs, GPRV4I8>;
  1080. def _v4i16 : UnaryOp<opcode, OpNode, Regs, GPRV4I16>;
  1081. def _v4i32 : UnaryOp<opcode, OpNode, Regs, GPRV4I32>;
  1082. def _v4f32 : UnaryOp<opcode, OpNode, Regs, GPRV4F32>;
  1083. }
  1084. multiclass UnaryIntrinsicInt<ILOpCode opcode, Intrinsic intr>
  1085. {
  1086. def _i32 : OneInOneOut<opcode, (outs GPRI32:$dst),
  1087. (ins GPRI32:$src),
  1088. !strconcat(opcode.Text, " $dst, $src"),
  1089. [(set GPRI32:$dst, (intr GPRI32:$src))]>;
  1090. def _v2i32 : OneInOneOut<opcode, (outs GPRV2I32:$dst),
  1091. (ins GPRV2I32:$src),
  1092. !strconcat(opcode.Text, " $dst, $src"),
  1093. [(set GPRV2I32:$dst, (intr GPRV2I32:$src))]>;
  1094. def _v4i32 : OneInOneOut<opcode, (outs GPRV4I32:$dst),
  1095. (ins GPRV4I32:$src),
  1096. !strconcat(opcode.Text, " $dst, $src"),
  1097. [(set GPRV4I32:$dst, (intr GPRV4I32:$src))]>;
  1098. }
  1099. multiclass IntrConvertF32TOF16<ILOpCode opcode, Intrinsic intr>
  1100. {
  1101. def _i16 : OneInOneOut<opcode, (outs GPRI16:$dst),
  1102. (ins GPRF32:$src),
  1103. !strconcat(opcode.Text, " $dst, $src"),
  1104. [(set GPRI16:$dst, (intr GPRF32:$src))]>;
  1105. def _v2i16 : OneInOneOut<opcode, (outs GPRV2I16:$dst),
  1106. (ins GPRV2F32:$src),
  1107. !strconcat(opcode.Text, " $dst, $src"),
  1108. [(set GPRV2I16:$dst, (intr GPRV2F32:$src))]>;
  1109. def _v4i16 : OneInOneOut<opcode, (outs GPRV4I16:$dst),
  1110. (ins GPRV4F32:$src),
  1111. !strconcat(opcode.Text, " $dst, $src"),
  1112. [(set GPRV4I16:$dst, (intr GPRV4F32:$src))]>;
  1113. }
  1114. multiclass IntrConvertF32TOI32<ILOpCode opcode, Intrinsic intr>
  1115. {
  1116. def _i32 : OneInOneOut<opcode, (outs GPRI32:$dst),
  1117. (ins GPRF32:$src),
  1118. !strconcat(opcode.Text, " $dst, $src"),
  1119. [(set GPRI32:$dst, (intr GPRF32:$src))]>;
  1120. def _v2i32 : OneInOneOut<opcode, (outs GPRV2I32:$dst),
  1121. (ins GPRV2F32:$src),
  1122. !strconcat(opcode.Text, " $dst, $src"),
  1123. [(set GPRV2I32:$dst, (intr GPRV2F32:$src))]>;
  1124. def _v4i32 : OneInOneOut<opcode, (outs GPRV4I32:$dst),
  1125. (ins GPRV4F32:$src),
  1126. !strconcat(opcode.Text, " $dst, $src"),
  1127. [(set GPRV4I32:$dst, (intr GPRV4F32:$src))]>;
  1128. }
  1129. multiclass IntrConvertF64TOI32<ILOpCode opcode, Intrinsic intr>
  1130. {
  1131. def _i32 : OneInOneOut<opcode, (outs GPRI32:$dst),
  1132. (ins GPRF64:$src),
  1133. !strconcat(opcode.Text, " $dst, $src"),
  1134. [(set GPRI32:$dst, (intr GPRF64:$src))]>;
  1135. def _v2i32 : OneInOneOut<opcode, (outs GPRV2I32:$dst),
  1136. (ins GPRV2F64:$src),
  1137. !strconcat(opcode.Text, " $dst, $src"),
  1138. [(set GPRV2I32:$dst, (intr GPRV2F64:$src))]>;
  1139. }
  1140. multiclass IntrConvertF16TOF32<ILOpCode opcode, Intrinsic intr>
  1141. {
  1142. def _f32 : OneInOneOut<opcode, (outs GPRF32:$dst),
  1143. (ins GPRI16:$src),
  1144. !strconcat(opcode.Text, " $dst, $src"),
  1145. [(set GPRF32:$dst, (intr GPRI16:$src))]>;
  1146. def _v2f32 : OneInOneOut<opcode, (outs GPRV2F32:$dst),
  1147. (ins GPRV2I16:$src),
  1148. !strconcat(opcode.Text, " $dst, $src"),
  1149. [(set GPRV2F32:$dst, (intr GPRV2I16:$src))]>;
  1150. def _v4f32 : OneInOneOut<opcode, (outs GPRV4F32:$dst),
  1151. (ins GPRV4I16:$src),
  1152. !strconcat(opcode.Text, " $dst, $src"),
  1153. [(set GPRV4F32:$dst, (intr GPRV4I16:$src))]>;
  1154. }
  1155. multiclass IntrConvertI32TOF32<ILOpCode opcode, Intrinsic intr>
  1156. {
  1157. def _f32 : OneInOneOut<opcode, (outs GPRF32:$dst),
  1158. (ins GPRI32:$src),
  1159. !strconcat(opcode.Text, " $dst, $src"),
  1160. [(set GPRF32:$dst, (intr GPRI32:$src))]>;
  1161. def _v2f32 : OneInOneOut<opcode, (outs GPRV2F32:$dst),
  1162. (ins GPRV2I32:$src),
  1163. !strconcat(opcode.Text, " $dst, $src"),
  1164. [(set GPRV2F32:$dst, (intr GPRV2I32:$src))]>;
  1165. def _v4f32 : OneInOneOut<opcode, (outs GPRV4F32:$dst),
  1166. (ins GPRV4I32:$src),
  1167. !strconcat(opcode.Text, " $dst, $src"),
  1168. [(set GPRV4F32:$dst, (intr GPRV4I32:$src))]>;
  1169. }
  1170. multiclass BinaryIntrinsicLong<ILOpCode opcode, Intrinsic intr>
  1171. {
  1172. def _i64 : TwoInOneOut<opcode, (outs GPRI64:$dst),
  1173. (ins GPRI64:$src, GPRI64:$src2),
  1174. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1175. [(set GPRI64:$dst,
  1176. (intr GPRI64:$src, GPRI64:$src2))]>;
  1177. }
  1178. multiclass BinaryIntrinsicInt<ILOpCode opcode, Intrinsic intr>
  1179. {
  1180. def _i32 : TwoInOneOut<opcode, (outs GPRI32:$dst),
  1181. (ins GPRI32:$src, GPRI32:$src2),
  1182. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1183. [(set GPRI32:$dst,
  1184. (intr GPRI32:$src, GPRI32:$src2))]>;
  1185. def _v2i32 : TwoInOneOut<opcode, (outs GPRV2I32:$dst),
  1186. (ins GPRV2I32:$src, GPRV2I32:$src2),
  1187. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1188. [(set GPRV2I32:$dst,
  1189. (intr GPRV2I32:$src, GPRV2I32:$src2))]>;
  1190. def _v4i32 : TwoInOneOut<opcode, (outs GPRV4I32:$dst),
  1191. (ins GPRV4I32:$src, GPRV4I32:$src2),
  1192. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1193. [(set GPRV4I32:$dst,
  1194. (intr GPRV4I32:$src, GPRV4I32:$src2))]>;
  1195. }
  1196. multiclass TernaryIntrinsicInt<ILOpCode opcode, Intrinsic intr>
  1197. {
  1198. def _i32 : ThreeInOneOut<opcode, (outs GPRI32:$dst),
  1199. (ins GPRI32:$src, GPRI32:$src2, GPRI32:$src3),
  1200. !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
  1201. [(set GPRI32:$dst,
  1202. (intr GPRI32:$src, GPRI32:$src2, GPRI32:$src3))]>;
  1203. def _v2i32 : ThreeInOneOut<opcode, (outs GPRV2I32:$dst),
  1204. (ins GPRV2I32:$src, GPRV2I32:$src2, GPRV2I32:$src3),
  1205. !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
  1206. [(set GPRV2I32:$dst,
  1207. (intr GPRV2I32:$src, GPRV2I32:$src2, GPRV2I32:$src3))]>;
  1208. def _v4i32 : ThreeInOneOut<opcode, (outs GPRV4I32:$dst),
  1209. (ins GPRV4I32:$src, GPRV4I32:$src2, GPRV4I32:$src3),
  1210. !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
  1211. [(set GPRV4I32:$dst,
  1212. (intr GPRV4I32:$src, GPRV4I32:$src2, GPRV4I32:$src3))]>;
  1213. }
  1214. multiclass TernaryIntrinsicFloat<ILOpCode opcode, Intrinsic intr>
  1215. {
  1216. def _f32 : ThreeInOneOut<opcode, (outs GPRF32:$dst),
  1217. (ins GPRF32:$src, GPRF32:$src2, GPRF32:$src3),
  1218. !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
  1219. [(set GPRF32:$dst,
  1220. (intr GPRF32:$src, GPRF32:$src2, GPRF32:$src3))]>;
  1221. def _v2f32 : ThreeInOneOut<opcode, (outs GPRV2F32:$dst),
  1222. (ins GPRV2F32:$src, GPRV2F32:$src2, GPRV2F32:$src3),
  1223. !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
  1224. [(set GPRV2F32:$dst,
  1225. (intr GPRV2F32:$src, GPRV2F32:$src2, GPRV2F32:$src3))]>;
  1226. def _v4f32 : ThreeInOneOut<opcode, (outs GPRV4F32:$dst),
  1227. (ins GPRV4F32:$src, GPRV4F32:$src2, GPRV4F32:$src3),
  1228. !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
  1229. [(set GPRV4F32:$dst,
  1230. (intr GPRV4F32:$src, GPRV4F32:$src2, GPRV4F32:$src3))]>;
  1231. }
  1232. multiclass BinaryIntrinsicDoubleScalar<ILOpCode opcode, Intrinsic intr>
  1233. {
  1234. def _f64 : ThreeInOneOut<opcode, (outs GPRF64:$dst),
  1235. (ins GPRF64:$src, GPRF64:$src2),
  1236. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1237. [(set GPRF64:$dst,
  1238. (intr GPRF64:$src, GPRF64:$src2))]>;
  1239. }
  1240. multiclass TernaryIntrinsicDoubleScalar<ILOpCode opcode, Intrinsic intr>
  1241. {
  1242. def _f64 : ThreeInOneOut<opcode, (outs GPRF64:$dst),
  1243. (ins GPRF64:$src, GPRF64:$src2, GPRF64:$src3),
  1244. !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
  1245. [(set GPRF64:$dst,
  1246. (intr GPRF64:$src, GPRF64:$src2, GPRF64:$src3))]>;
  1247. }
  1248. multiclass TernaryIntrinsicLongScalar<ILOpCode opcode, Intrinsic intr>
  1249. {
  1250. def _i64 : ThreeInOneOut<opcode, (outs GPRI64:$dst),
  1251. (ins GPRI64:$src, GPRI64:$src2, GPRI64:$src3),
  1252. !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
  1253. [(set GPRI64:$dst,
  1254. (intr GPRI64:$src, GPRI64:$src2, GPRI64:$src3))]>;
  1255. }
  1256. multiclass QuaternaryIntrinsicInt<ILOpCode opcode, Intrinsic intr>
  1257. {
  1258. def _i32 : FourInOneOut<opcode, (outs GPRI32:$dst),
  1259. (ins GPRI32:$src, GPRI32:$src2, GPRI32:$src3, GPRI32:$src4),
  1260. !strconcat(opcode.Text, " $dst, $src, $src2, $src3, $src4"),
  1261. [(set GPRI32:$dst,
  1262. (intr GPRI32:$src, GPRI32:$src2, GPRI32:$src3, GPRI32:$src4))]>;
  1263. def _v2i32 : FourInOneOut<opcode, (outs GPRV2I32:$dst),
  1264. (ins GPRV2I32:$src, GPRV2I32:$src2, GPRV2I32:$src3, GPRV2I32:$src4),
  1265. !strconcat(opcode.Text, " $dst, $src, $src2, $src3, $src4"),
  1266. [(set GPRV2I32:$dst,
  1267. (intr GPRV2I32:$src, GPRV2I32:$src2, GPRV2I32:$src3, GPRV2I32:$src4))]>;
  1268. def _v4i32 : FourInOneOut<opcode, (outs GPRV4I32:$dst),
  1269. (ins GPRV4I32:$src, GPRV4I32:$src2, GPRV4I32:$src3, GPRV4I32:$src4),
  1270. !strconcat(opcode.Text, " $dst, $src, $src2, $src3, $src4"),
  1271. [(set GPRV4I32:$dst,
  1272. (intr GPRV4I32:$src, GPRV4I32:$src2, GPRV4I32:$src3, GPRV4I32:$src4))]>;
  1273. }
  1274. multiclass UnaryIntrinsicFloatScalar<ILOpCode opcode, Intrinsic intr>
  1275. {
  1276. def _f32 : OneInOneOut<opcode, (outs GPRF32:$dst),
  1277. (ins GPRF32:$src),
  1278. !strconcat(opcode.Text, " $dst, $src"),
  1279. [(set GPRF32:$dst, (intr GPRF32:$src))]>;
  1280. }
  1281. multiclass UnaryIntrinsicFloat<ILOpCode opcode, Intrinsic intr>
  1282. {
  1283. def _f32 : OneInOneOut<opcode, (outs GPRF32:$dst),
  1284. (ins GPRF32:$src),
  1285. !strconcat(opcode.Text, " $dst, $src"),
  1286. [(set GPRF32:$dst, (intr GPRF32:$src))]>;
  1287. def _v2f32 : OneInOneOut<opcode, (outs GPRV2F32:$dst),
  1288. (ins GPRV2F32:$src),
  1289. !strconcat(opcode.Text, " $dst, $src"),
  1290. [(set GPRV2F32:$dst, (intr GPRV2F32:$src))]>;
  1291. def _v4f32 : OneInOneOut<opcode, (outs GPRV4F32:$dst),
  1292. (ins GPRV4F32:$src),
  1293. !strconcat(opcode.Text, " $dst, $src"),
  1294. [(set GPRV4F32:$dst, (intr GPRV4F32:$src))]>;
  1295. }
  1296. multiclass BinaryIntrinsicFloatScalar<ILOpCode opcode, Intrinsic intr>
  1297. {
  1298. def _f32 : TwoInOneOut<opcode, (outs GPRF32:$dst),
  1299. (ins GPRF32:$src, GPRF32:$src2),
  1300. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1301. [(set GPRF32:$dst,
  1302. (intr GPRF32:$src, GPRF32:$src2))]>;
  1303. }
  1304. multiclass BinaryIntrinsicFloat<ILOpCode opcode, Intrinsic intr>
  1305. {
  1306. def _f32 : TwoInOneOut<opcode, (outs GPRF32:$dst),
  1307. (ins GPRF32:$src, GPRF32:$src2),
  1308. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1309. [(set GPRF32:$dst,
  1310. (intr GPRF32:$src, GPRF32:$src2))]>;
  1311. def _v2f32 : TwoInOneOut<opcode, (outs GPRV2F32:$dst),
  1312. (ins GPRV2F32:$src, GPRV2F32:$src2),
  1313. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1314. [(set GPRV2F32:$dst,
  1315. (intr GPRV2F32:$src, GPRV2F32:$src2))]>;
  1316. def _v4f32 : TwoInOneOut<opcode, (outs GPRV4F32:$dst),
  1317. (ins GPRV4F32:$src, GPRV4F32:$src2),
  1318. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1319. [(set GPRV4F32:$dst,
  1320. (intr GPRV4F32:$src, GPRV4F32:$src2))]>;
  1321. }
  1322. multiclass UnaryIntrinsicDoubleScalar<ILOpCode opcode, Intrinsic intr>
  1323. {
  1324. def _f64 : OneInOneOut<opcode, (outs GPRF64:$dst),
  1325. (ins GPRF64:$src),
  1326. !strconcat(opcode.Text, " $dst, $src"),
  1327. [(set GPRF64:$dst, (intr GPRF64:$src))]>;
  1328. }
  1329. multiclass UnaryIntrinsicDouble<ILOpCode opcode, Intrinsic intr>
  1330. {
  1331. def _f64 : OneInOneOut<opcode, (outs GPRF64:$dst),
  1332. (ins GPRF64:$src),
  1333. !strconcat(opcode.Text, " $dst, $src"),
  1334. [(set GPRF64:$dst, (intr GPRF64:$src))]>;
  1335. def _v2f64 : OneInOneOut<opcode, (outs GPRV2F64:$dst),
  1336. (ins GPRV2F64:$src),
  1337. !strconcat(opcode.Text, " $dst, $src"),
  1338. [(set GPRV2F64:$dst, (intr GPRV2F64:$src))]>;
  1339. }
  1340. multiclass BinaryIntrinsicDouble<ILOpCode opcode, Intrinsic intr>
  1341. {
  1342. def _f64 : TwoInOneOut<opcode, (outs GPRF64:$dst),
  1343. (ins GPRF64:$src, GPRF64:$src2),
  1344. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1345. [(set GPRF64:$dst,
  1346. (intr GPRF64:$src, GPRF64:$src2))]>;
  1347. def _v2f64 : TwoInOneOut<opcode, (outs GPRV2F64:$dst),
  1348. (ins GPRV2F64:$src, GPRV2F64:$src2),
  1349. !strconcat(opcode.Text, " $dst, $src, $src2"),
  1350. [(set GPRV2F64:$dst,
  1351. (intr GPRV2F64:$src, GPRV2F64:$src2))]>;
  1352. }
  1353. multiclass TernaryIntrinsicDouble<ILOpCode opcode, Intrinsic intr>
  1354. {
  1355. def _f64 : TwoInOneOut<opcode, (outs GPRF64:$dst),
  1356. (ins GPRF64:$src, GPRF64:$src2, GPRF64:$src3),
  1357. !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
  1358. [(set GPRF64:$dst,
  1359. (intr GPRF64:$src, GPRF64:$src2, GPRF64:$src3))]>;
  1360. def _v2f64 : TwoInOneOut<opcode, (outs GPRV2F64:$dst),
  1361. (ins GPRV2F64:$src, GPRV2F64:$src2, GPRV2F64:$src3),
  1362. !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
  1363. [(set GPRV2F64:$dst,
  1364. (intr GPRV2F64:$src, GPRV2F64:$src2, GPRV2F64:$src3))]>;
  1365. }