PPCInstrMMA.td 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  1. // Mask immediates for MMA instructions (2, 4 and 8 bits).
  2. def Msk2Imm : ImmLeaf<i32, [{ return isUInt<2>(Imm); }]>;
  3. def Msk4Imm : ImmLeaf<i32, [{ return isUInt<4>(Imm); }]>;
  4. def Msk8Imm : ImmLeaf<i32, [{ return isUInt<8>(Imm); }]>;
  5. def MMA : Predicate<"Subtarget->hasMMA()">;
  6. // Multiclass definitions for MMA accumulator instructions.
  7. // ----------------------------------------------------------------------------
  8. // Defines 2 unmasked instructions where the xo field for acc/non-acc version
  9. // is even/odd.
  10. multiclass ACC_UM_XOEO<bits<6> opcode, bits<8> xo, dag IOL, string asmbase,
  11. string asmstr> {
  12. let Predicates = [MMA, IsNotISAFuture] in {
  13. def NAME :
  14. XX3Form_AT3_XAB6<opcode, !or(xo, 0x01), (outs acc:$AT), IOL,
  15. !strconcat(asmbase#" ", asmstr), IIC_VecFP, []>,
  16. RegConstraint<"@earlyclobber $AT">;
  17. def PP :
  18. XX3Form_AT3_XAB6<opcode, xo, (outs acc:$AT), !con((ins acc:$ATi), IOL),
  19. !strconcat(asmbase#"pp ", asmstr), IIC_VecFP, []>,
  20. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  21. }
  22. let Predicates = [MMA, IsISAFuture], isCodeGenOnly = 1 in {
  23. def NAME#W :
  24. XX3Form_AT3_XAB6<opcode, !or(xo, 0x01), (outs wacc:$AT), IOL,
  25. !strconcat(asmbase#" ", asmstr), IIC_VecFP, []>,
  26. RegConstraint<"@earlyclobber $AT">;
  27. def WPP :
  28. XX3Form_AT3_XAB6<opcode, xo, (outs wacc:$AT), !con((ins wacc:$ATi), IOL),
  29. !strconcat(asmbase#"pp ", asmstr), IIC_VecFP, []>,
  30. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  31. }
  32. }
  33. // Defines 4 instructions, masked/unmasked with masks 8, 4, 4 bits.
  34. // The XO field for acc/non-acc version is even/odd.
  35. multiclass ACC_UM_M844_XOEO<bits<6> opcode, bits<8> xo, dag IOL, string asmbase,
  36. string asmstr> {
  37. defm NAME : ACC_UM_XOEO<opcode, xo, IOL, asmbase, asmstr>;
  38. let Predicates = [MMA, PrefixInstrs, IsNotISAFuture] in {
  39. def PM#NAME :
  40. MMIRR_XX3Form_XY4P8_XAB6<
  41. opcode, !or(xo, 0x01), (outs acc:$AT),
  42. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u8imm:$PMSK)),
  43. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
  44. IIC_VecFP, []>,
  45. RegConstraint<"@earlyclobber $AT">;
  46. def PM#NAME#PP :
  47. MMIRR_XX3Form_XY4P8_XAB6<
  48. opcode, xo, (outs acc:$AT),
  49. !con((ins acc:$ATi),
  50. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u8imm:$PMSK))),
  51. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
  52. IIC_VecFP, []>,
  53. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  54. }
  55. let Predicates = [MMA, PrefixInstrs, IsISAFuture], isCodeGenOnly = 1 in {
  56. def PM#NAME#W :
  57. MMIRR_XX3Form_XY4P8_XAB6<
  58. opcode, !or(xo, 0x01), (outs wacc:$AT),
  59. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u8imm:$PMSK)),
  60. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
  61. IIC_VecFP, []>,
  62. RegConstraint<"@earlyclobber $AT">;
  63. def PM#NAME#WPP :
  64. MMIRR_XX3Form_XY4P8_XAB6<
  65. opcode, xo, (outs wacc:$AT),
  66. !con((ins wacc:$ATi),
  67. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u8imm:$PMSK))),
  68. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
  69. IIC_VecFP, []>,
  70. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  71. }
  72. }
  73. // Defines 4 instructions, masked/unmasked with masks 4, 4, 4 bits.
  74. // The XO field for acc/non-acc version is even/odd.
  75. multiclass ACC_UM_M444_XOEO<bits<6> opcode, bits<8> xo, dag IOL, string asmbase,
  76. string asmstr> {
  77. defm NAME : ACC_UM_XOEO<opcode, xo, IOL, asmbase, asmstr>;
  78. let Predicates = [MMA, PrefixInstrs, IsNotISAFuture] in {
  79. def PM#NAME :
  80. MMIRR_XX3Form_XYP4_XAB6<
  81. opcode, !or(xo, 0x01), (outs acc:$AT),
  82. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u4imm:$PMSK)),
  83. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
  84. IIC_VecFP, []>,
  85. RegConstraint<"@earlyclobber $AT">;
  86. def PM#NAME#PP :
  87. MMIRR_XX3Form_XYP4_XAB6<
  88. opcode, xo, (outs acc:$AT),
  89. !con((ins acc:$ATi),
  90. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u4imm:$PMSK))),
  91. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
  92. IIC_VecFP, []>,
  93. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  94. }
  95. let Predicates = [MMA, PrefixInstrs, IsISAFuture], isCodeGenOnly = 1 in {
  96. def PM#NAME#W :
  97. MMIRR_XX3Form_XYP4_XAB6<
  98. opcode, !or(xo, 0x01), (outs wacc:$AT),
  99. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u4imm:$PMSK)),
  100. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
  101. IIC_VecFP, []>,
  102. RegConstraint<"@earlyclobber $AT">;
  103. def PM#NAME#WPP :
  104. MMIRR_XX3Form_XYP4_XAB6<
  105. opcode, xo, (outs wacc:$AT),
  106. !con((ins wacc:$ATi),
  107. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u4imm:$PMSK))),
  108. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
  109. IIC_VecFP, []>,
  110. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  111. }
  112. }
  113. // Defines 4 instructions, masked/unmasked with masks 2, 4, 4 bits.
  114. // The XO field for acc/non-acc version is even/odd.
  115. multiclass ACC_UM_M244_XOEO<bits<6> opcode, bits<8> xo, dag IOL, string asmbase,
  116. string asmstr> {
  117. defm NAME : ACC_UM_XOEO<opcode, xo, IOL, asmbase, asmstr>;
  118. let Predicates = [MMA, PrefixInstrs, IsNotISAFuture] in {
  119. def PM#NAME :
  120. MMIRR_XX3Form_XY4P2_XAB6<
  121. opcode, !or(xo, 0x01), (outs acc:$AT),
  122. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK)),
  123. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
  124. IIC_VecFP, []>,
  125. RegConstraint<"@earlyclobber $AT">;
  126. def PM#NAME#PP :
  127. MMIRR_XX3Form_XY4P2_XAB6<
  128. opcode, xo, (outs acc:$AT),
  129. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
  130. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
  131. IIC_VecFP, []>,
  132. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  133. }
  134. let Predicates = [MMA, PrefixInstrs, IsISAFuture], isCodeGenOnly = 1 in {
  135. def PM#NAME#W :
  136. MMIRR_XX3Form_XY4P2_XAB6<
  137. opcode, !or(xo, 0x01), (outs wacc:$AT),
  138. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK)),
  139. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
  140. IIC_VecFP, []>,
  141. RegConstraint<"@earlyclobber $AT">;
  142. def PM#NAME#WPP :
  143. MMIRR_XX3Form_XY4P2_XAB6<
  144. opcode, xo, (outs wacc:$AT),
  145. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
  146. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
  147. IIC_VecFP, []>,
  148. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  149. }
  150. }
  151. // Defines 4 instructions, masked/unmasked with masks 2, 4, 4 bits.
  152. // Upper nibble of XO field for acc/non-acc version is 0x4/0x6.
  153. multiclass ACC_UM_M244_XO46<bits<6> opcode, bits<8> xo, dag IOL, string asmbase,
  154. string asmstr> {
  155. let Predicates = [MMA, IsNotISAFuture] in {
  156. def NAME :
  157. XX3Form_AT3_XAB6<opcode, xo, (outs acc:$AT), IOL,
  158. !strconcat(asmbase#" ", asmstr), IIC_VecFP, []>,
  159. RegConstraint<"@earlyclobber $AT">;
  160. def PP :
  161. XX3Form_AT3_XAB6<
  162. opcode, !or(xo, 0x20), (outs acc:$AT), !con((ins acc:$ATi), IOL),
  163. !strconcat(asmbase#"pp ", asmstr), IIC_VecFP, []>,
  164. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  165. }
  166. let Predicates = [MMA, PrefixInstrs, IsNotISAFuture] in {
  167. def PM#NAME :
  168. MMIRR_XX3Form_XY4P2_XAB6<
  169. opcode, xo, (outs acc:$AT),
  170. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK)),
  171. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
  172. IIC_VecFP, []>,
  173. RegConstraint<"@earlyclobber $AT">;
  174. def PM#NAME#PP :
  175. MMIRR_XX3Form_XY4P2_XAB6<
  176. opcode, !or(xo, 0x20), (outs acc:$AT),
  177. !con((ins acc:$ATi),
  178. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
  179. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
  180. IIC_VecFP, []>,
  181. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  182. }
  183. let Predicates = [MMA, IsISAFuture], isCodeGenOnly = 1 in {
  184. def NAME#W :
  185. XX3Form_AT3_XAB6<opcode, xo, (outs wacc:$AT), IOL,
  186. !strconcat(asmbase#" ", asmstr), IIC_VecFP, []>,
  187. RegConstraint<"@earlyclobber $AT">;
  188. def WPP :
  189. XX3Form_AT3_XAB6<
  190. opcode, !or(xo, 0x20), (outs wacc:$AT), !con((ins wacc:$ATi), IOL),
  191. !strconcat(asmbase#"pp ", asmstr), IIC_VecFP, []>,
  192. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  193. }
  194. let Predicates = [MMA, PrefixInstrs, IsISAFuture], isCodeGenOnly = 1 in {
  195. def PM#NAME#W :
  196. MMIRR_XX3Form_XY4P2_XAB6<
  197. opcode, xo, (outs wacc:$AT),
  198. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK)),
  199. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK, $PMSK"),
  200. IIC_VecFP, []>,
  201. RegConstraint<"@earlyclobber $AT">;
  202. def PM#NAME#WPP :
  203. MMIRR_XX3Form_XY4P2_XAB6<
  204. opcode, !or(xo, 0x20), (outs acc:$AT),
  205. !con((ins wacc:$ATi),
  206. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
  207. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK, $PMSK"),
  208. IIC_VecFP, []>,
  209. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  210. }
  211. }
  212. // Defines 10 instructions, operand negating, unmasked, masked with 2, 4, 4
  213. // bits. Upper nibble are masked with 0x8, 0x4, 0xC for negating operands.
  214. multiclass ACC_NEG_UM_M244_XOM84C<bits<6> opcode, bits<8> xo, dag IOL,
  215. string asmbase, string asmstr> {
  216. defm NAME : ACC_UM_M244_XOEO<opcode, xo, IOL, asmbase, asmstr>;
  217. let Predicates = [MMA, IsNotISAFuture] in {
  218. def PN : XX3Form_AT3_XAB6<
  219. opcode, !or(xo, 0x80), (outs acc:$AT), !con((ins acc:$ATi), IOL),
  220. !strconcat(asmbase#"pn ", asmstr), IIC_VecFP, []>,
  221. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  222. def NP : XX3Form_AT3_XAB6<
  223. opcode, !or(xo, 0x40), (outs acc:$AT), !con((ins acc:$ATi), IOL),
  224. !strconcat(asmbase#"np ", asmstr), IIC_VecFP, []>,
  225. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  226. def NN : XX3Form_AT3_XAB6<
  227. opcode, !or(xo, 0xC0), (outs acc:$AT), !con((ins acc:$ATi), IOL),
  228. !strconcat(asmbase#"nn ", asmstr), IIC_VecFP, []>,
  229. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  230. }
  231. let Predicates = [MMA, IsISAFuture], isCodeGenOnly = 1 in {
  232. def WPN : XX3Form_AT3_XAB6<
  233. opcode, !or(xo, 0x80), (outs wacc:$AT), !con((ins wacc:$ATi), IOL),
  234. !strconcat(asmbase#"pn ", asmstr), IIC_VecFP, []>,
  235. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  236. def WNP : XX3Form_AT3_XAB6<
  237. opcode, !or(xo, 0x40), (outs wacc:$AT), !con((ins wacc:$ATi), IOL),
  238. !strconcat(asmbase#"np ", asmstr), IIC_VecFP, []>,
  239. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  240. def WNN : XX3Form_AT3_XAB6<
  241. opcode, !or(xo, 0xC0), (outs wacc:$AT), !con((ins wacc:$ATi), IOL),
  242. !strconcat(asmbase#"nn ", asmstr), IIC_VecFP, []>,
  243. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  244. }
  245. let Predicates = [MMA, PrefixInstrs, IsNotISAFuture] in {
  246. def PM#NAME#PN :
  247. MMIRR_XX3Form_XY4P2_XAB6<
  248. opcode, !or(xo, 0x80), (outs acc:$AT),
  249. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
  250. !strconcat("pm"#asmbase#"pn ", asmstr#", $XMSK, $YMSK, $PMSK"),
  251. IIC_VecFP, []>,
  252. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  253. def PM#NAME#NP :
  254. MMIRR_XX3Form_XY4P2_XAB6<
  255. opcode, !or(xo, 0x40), (outs acc:$AT),
  256. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
  257. !strconcat("pm"#asmbase#"np ", asmstr#", $XMSK, $YMSK, $PMSK"),
  258. IIC_VecFP, []>,
  259. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  260. def PM#NAME#NN :
  261. MMIRR_XX3Form_XY4P2_XAB6<
  262. opcode, !or(xo, 0xC0), (outs acc:$AT),
  263. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
  264. !strconcat("pm"#asmbase#"nn ", asmstr#", $XMSK, $YMSK, $PMSK"),
  265. IIC_VecFP, []>,
  266. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  267. }
  268. let Predicates = [MMA, PrefixInstrs, IsISAFuture], isCodeGenOnly = 1 in {
  269. def PM#NAME#WPN :
  270. MMIRR_XX3Form_XY4P2_XAB6<
  271. opcode, !or(xo, 0x80), (outs wacc:$AT),
  272. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
  273. !strconcat("pm"#asmbase#"pn ", asmstr#", $XMSK, $YMSK, $PMSK"),
  274. IIC_VecFP, []>,
  275. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  276. def PM#NAME#WNP :
  277. MMIRR_XX3Form_XY4P2_XAB6<
  278. opcode, !or(xo, 0x40), (outs wacc:$AT),
  279. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
  280. !strconcat("pm"#asmbase#"np ", asmstr#", $XMSK, $YMSK, $PMSK"),
  281. IIC_VecFP, []>,
  282. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  283. def PM#NAME#WNN :
  284. MMIRR_XX3Form_XY4P2_XAB6<
  285. opcode, !or(xo, 0xC0), (outs wacc:$AT),
  286. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK, u2imm:$PMSK))),
  287. !strconcat("pm"#asmbase#"nn ", asmstr#", $XMSK, $YMSK, $PMSK"),
  288. IIC_VecFP, []>,
  289. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  290. }
  291. }
  292. // Defines 5 instructions, unmasked, operand negating.
  293. // Upper nibble are masked with 0x8, 0x4, 0xC for negating operands.
  294. multiclass ACC_NEG_UM_XOM84C<bits<6> opcode, bits<8> xo, dag IOL,
  295. string asmbase, string asmstr> {
  296. defm NAME : ACC_UM_XOEO<opcode, xo, IOL, asmbase, asmstr>;
  297. let Predicates = [MMA, IsNotISAFuture] in {
  298. def PN : XX3Form_AT3_XAB6<opcode, !or(xo, 0x80), (outs acc:$AT),
  299. !con((ins acc:$ATi), IOL),
  300. !strconcat(asmbase#"pn ", asmstr), IIC_VecFP, []>,
  301. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  302. def NP : XX3Form_AT3_XAB6<opcode, !or(xo, 0x40), (outs acc:$AT),
  303. !con((ins acc:$ATi), IOL),
  304. !strconcat(asmbase#"np ", asmstr), IIC_VecFP, []>,
  305. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  306. def NN : XX3Form_AT3_XAB6<opcode, !or(xo, 0xC0), (outs acc:$AT),
  307. !con((ins acc:$ATi), IOL),
  308. !strconcat(asmbase#"nn ", asmstr), IIC_VecFP, []>,
  309. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  310. }
  311. let Predicates = [MMA, IsISAFuture], isCodeGenOnly = 1 in {
  312. def WPN : XX3Form_AT3_XAB6<opcode, !or(xo, 0x80), (outs wacc:$AT),
  313. !con((ins wacc:$ATi), IOL),
  314. !strconcat(asmbase#"pn ", asmstr), IIC_VecFP, []>,
  315. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  316. def WNP : XX3Form_AT3_XAB6<opcode, !or(xo, 0x40), (outs wacc:$AT),
  317. !con((ins wacc:$ATi), IOL),
  318. !strconcat(asmbase#"np ", asmstr), IIC_VecFP, []>,
  319. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  320. def WNN : XX3Form_AT3_XAB6<opcode, !or(xo, 0xC0), (outs wacc:$AT),
  321. !con((ins wacc:$ATi), IOL),
  322. !strconcat(asmbase#"nn ", asmstr), IIC_VecFP, []>,
  323. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  324. }
  325. }
  326. // Defines 10 instructions, operand negating, unmasked, masked with 4, 4 bits.
  327. // Upper nibble are masked with 0x8, 0x4, 0xC for negating operands.
  328. multiclass ACC_NEG_UM_M44_XOM84C<bits<6> opcode, bits<8> xo, dag IOL,
  329. string asmbase, string asmstr> {
  330. defm NAME : ACC_NEG_UM_XOM84C<opcode, xo, IOL, asmbase, asmstr>;
  331. let Predicates = [MMA, PrefixInstrs, IsNotISAFuture] in {
  332. def PM#NAME :
  333. MMIRR_XX3Form_XY4_XAB6<
  334. opcode, !or(xo, 0x01), (outs acc:$AT),
  335. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK)),
  336. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK"),
  337. IIC_VecFP, []>,
  338. RegConstraint<"@earlyclobber $AT">;
  339. def PM#NAME#PP :
  340. MMIRR_XX3Form_XY4_XAB6<
  341. opcode, xo, (outs acc:$AT),
  342. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK))),
  343. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK"),
  344. IIC_VecFP, []>,
  345. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  346. def PM#NAME#PN :
  347. MMIRR_XX3Form_XY4_XAB6<
  348. opcode, !or(xo, 0x80), (outs acc:$AT),
  349. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK))),
  350. !strconcat("pm"#asmbase#"pn ", asmstr#", $XMSK, $YMSK"),
  351. IIC_VecFP, []>,
  352. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  353. def PM#NAME#NP :
  354. MMIRR_XX3Form_XY4_XAB6<
  355. opcode, !or(xo, 0x40), (outs acc:$AT),
  356. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK))),
  357. !strconcat("pm"#asmbase#"np ", asmstr#", $XMSK, $YMSK"),
  358. IIC_VecFP, []>,
  359. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  360. def PM#NAME#NN :
  361. MMIRR_XX3Form_XY4_XAB6<
  362. opcode, !or(xo, 0xC0), (outs acc:$AT),
  363. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK))),
  364. !strconcat("pm"#asmbase#"nn ", asmstr#", $XMSK, $YMSK"),
  365. IIC_VecFP, []>,
  366. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  367. }
  368. let Predicates = [MMA, PrefixInstrs, IsISAFuture], isCodeGenOnly = 1 in {
  369. def PM#NAME#W :
  370. MMIRR_XX3Form_XY4_XAB6<
  371. opcode, !or(xo, 0x01), (outs wacc:$AT),
  372. !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK)),
  373. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK"),
  374. IIC_VecFP, []>,
  375. RegConstraint<"@earlyclobber $AT">;
  376. def PM#NAME#WPP :
  377. MMIRR_XX3Form_XY4_XAB6<
  378. opcode, xo, (outs wacc:$AT),
  379. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK))),
  380. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK"),
  381. IIC_VecFP, []>,
  382. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  383. def PM#NAME#WPN :
  384. MMIRR_XX3Form_XY4_XAB6<
  385. opcode, !or(xo, 0x80), (outs wacc:$AT),
  386. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK))),
  387. !strconcat("pm"#asmbase#"pn ", asmstr#", $XMSK, $YMSK"),
  388. IIC_VecFP, []>,
  389. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  390. def PM#NAME#WNP :
  391. MMIRR_XX3Form_XY4_XAB6<
  392. opcode, !or(xo, 0x40), (outs wacc:$AT),
  393. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK))),
  394. !strconcat("pm"#asmbase#"np ", asmstr#", $XMSK, $YMSK"),
  395. IIC_VecFP, []>,
  396. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  397. def PM#NAME#WNN :
  398. MMIRR_XX3Form_XY4_XAB6<
  399. opcode, !or(xo, 0xC0), (outs wacc:$AT),
  400. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u4imm:$YMSK))),
  401. !strconcat("pm"#asmbase#"nn ", asmstr#", $XMSK, $YMSK"),
  402. IIC_VecFP, []>,
  403. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  404. }
  405. }
  406. // Defines 10 instructions, operand negating, unmasked, masked with 4, 2 bits.
  407. // Upper nibble are masked with 0x8, 0x4, 0xC for negating operands.
  408. multiclass ACC_NEG_UM_M42_XOM84C<bits<6> opcode, bits<8> xo, dag IOL,
  409. string asmbase, string asmstr> {
  410. defm NAME : ACC_NEG_UM_XOM84C<opcode, xo, IOL, asmbase, asmstr>;
  411. let Predicates = [MMA, PrefixInstrs, IsNotISAFuture] in {
  412. def PM#NAME :
  413. MMIRR_XX3Form_X4Y2_XAB6<
  414. opcode, !or(xo, 0x01), (outs acc:$AT),
  415. !con(IOL, (ins u4imm:$XMSK, u2imm:$YMSK)),
  416. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK"),
  417. IIC_VecFP, []>,
  418. RegConstraint<"@earlyclobber $AT">;
  419. def PM#NAME#PP :
  420. MMIRR_XX3Form_X4Y2_XAB6<
  421. opcode, xo, (outs acc:$AT),
  422. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u2imm:$YMSK))),
  423. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK"),
  424. IIC_VecFP, []>,
  425. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  426. def PM#NAME#PN :
  427. MMIRR_XX3Form_X4Y2_XAB6<
  428. opcode, !or(xo, 0x80), (outs acc:$AT),
  429. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u2imm:$YMSK))),
  430. !strconcat("pm"#asmbase#"pn ", asmstr#", $XMSK, $YMSK"),
  431. IIC_VecFP, []>,
  432. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  433. def PM#NAME#NP :
  434. MMIRR_XX3Form_X4Y2_XAB6<
  435. opcode, !or(xo, 0x40), (outs acc:$AT),
  436. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u2imm:$YMSK))),
  437. !strconcat("pm"#asmbase#"np ", asmstr#", $XMSK, $YMSK"),
  438. IIC_VecFP, []>,
  439. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  440. def PM#NAME#NN :
  441. MMIRR_XX3Form_X4Y2_XAB6<
  442. opcode, !or(xo, 0xC0), (outs acc:$AT),
  443. !con((ins acc:$ATi), !con(IOL, (ins u4imm:$XMSK, u2imm:$YMSK))),
  444. !strconcat("pm"#asmbase#"nn ", asmstr#", $XMSK, $YMSK"),
  445. IIC_VecFP, []>,
  446. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  447. }
  448. let Predicates = [MMA, PrefixInstrs, IsISAFuture], isCodeGenOnly = 1 in {
  449. def PM#NAME#W :
  450. MMIRR_XX3Form_X4Y2_XAB6<
  451. opcode, !or(xo, 0x01), (outs wacc:$AT),
  452. !con(IOL, (ins u4imm:$XMSK, u2imm:$YMSK)),
  453. !strconcat("pm"#asmbase#" ", asmstr#", $XMSK, $YMSK"),
  454. IIC_VecFP, []>,
  455. RegConstraint<"@earlyclobber $AT">;
  456. def PM#NAME#WPP :
  457. MMIRR_XX3Form_X4Y2_XAB6<
  458. opcode, xo, (outs wacc:$AT),
  459. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u2imm:$YMSK))),
  460. !strconcat("pm"#asmbase#"pp ", asmstr#", $XMSK, $YMSK"),
  461. IIC_VecFP, []>,
  462. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  463. def PM#NAME#WPN :
  464. MMIRR_XX3Form_X4Y2_XAB6<
  465. opcode, !or(xo, 0x80), (outs wacc:$AT),
  466. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u2imm:$YMSK))),
  467. !strconcat("pm"#asmbase#"pn ", asmstr#", $XMSK, $YMSK"),
  468. IIC_VecFP, []>,
  469. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  470. def PM#NAME#WNP :
  471. MMIRR_XX3Form_X4Y2_XAB6<
  472. opcode, !or(xo, 0x40), (outs wacc:$AT),
  473. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u2imm:$YMSK))),
  474. !strconcat("pm"#asmbase#"np ", asmstr#", $XMSK, $YMSK"),
  475. IIC_VecFP, []>,
  476. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  477. def PM#NAME#WNN :
  478. MMIRR_XX3Form_X4Y2_XAB6<
  479. opcode, !or(xo, 0xC0), (outs wacc:$AT),
  480. !con((ins wacc:$ATi), !con(IOL, (ins u4imm:$XMSK, u2imm:$YMSK))),
  481. !strconcat("pm"#asmbase#"nn ", asmstr#", $XMSK, $YMSK"),
  482. IIC_VecFP, []>,
  483. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  484. }
  485. }
  486. // End of class definitions.
  487. //-----------------------------------------------------------------------------
  488. let Predicates = [MMA, IsNotISAFuture] in {
  489. def XXMFACC :
  490. XForm_AT3<31, 0, 177, (outs acc:$ASo), (ins acc:$AS), "xxmfacc $AS",
  491. IIC_VecGeneral,
  492. [(set v512i1:$ASo, (int_ppc_mma_xxmfacc v512i1:$AS))]>,
  493. RegConstraint<"$ASo = $AS">, NoEncode<"$ASo">;
  494. def XXMTACC :
  495. XForm_AT3<31, 1, 177, (outs acc:$AT), (ins acc:$ATi), "xxmtacc $AT",
  496. IIC_VecGeneral,
  497. [(set v512i1:$AT, (int_ppc_mma_xxmtacc v512i1:$ATi))]>,
  498. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  499. def KILL_PAIR : PPCPostRAExpPseudo<(outs vsrprc:$XTp), (ins vsrprc:$XSp),
  500. "#KILL_PAIR", []>,
  501. RegConstraint<"$XTp = $XSp">;
  502. def BUILD_UACC : PPCPostRAExpPseudo<(outs acc:$AT), (ins uacc:$AS),
  503. "#BUILD_UACC $AT, $AS", []>;
  504. // We define XXSETACCZ as rematerializable to undo CSE of that intrinsic in
  505. // the backend. We avoid CSE here because it generates a copy of the acc
  506. // register and this copy is more expensive than calling the intrinsic again.
  507. let isAsCheapAsAMove = 1, isReMaterializable = 1 in {
  508. def XXSETACCZ :
  509. XForm_AT3<31, 3, 177, (outs acc:$AT), (ins), "xxsetaccz $AT", IIC_VecGeneral,
  510. [(set v512i1:$AT, (int_ppc_mma_xxsetaccz))]>;
  511. }
  512. def XVI8GER4SPP :
  513. XX3Form_AT3_XAB6<59, 99, (outs acc:$AT), (ins acc:$ATi, vsrc:$XA, vsrc:$XB),
  514. "xvi8ger4spp $AT, $XA, $XB", IIC_VecGeneral, []>,
  515. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  516. let mayStore = 1 in {
  517. def SPILL_ACC: PPCEmitTimePseudo<(outs), (ins acc:$AT, memrix16:$dst),
  518. "#SPILL_ACC", []>;
  519. def SPILL_UACC: PPCEmitTimePseudo<(outs), (ins uacc:$AT, memrix16:$dst),
  520. "#SPILL_UACC", []>;
  521. }
  522. let mayLoad = 1, hasSideEffects = 0 in {
  523. def RESTORE_ACC: PPCEmitTimePseudo<(outs acc:$AT), (ins memrix16:$src),
  524. "#RESTORE_ACC", []>;
  525. def RESTORE_UACC: PPCEmitTimePseudo<(outs uacc:$AT), (ins memrix16:$src),
  526. "#RESTORE_UACC", []>;
  527. }
  528. }
  529. let Predicates = [MMA, IsISAFuture], isCodeGenOnly = 1 in {
  530. // For Future and up XXMFACCW and XXMTACCW will not have patterns.
  531. // On Future CPU the wacc registers no longer overlap with the vsr registers
  532. // and so register allocation would have to know to match 4 vsr registers
  533. // with one wacc register.
  534. // On top of that Future CPU has a more convenient way to move between vsrs
  535. // and wacc registers using xxextfdmr512 and xxinstdmr512.
  536. def XXMFACCW :
  537. XForm_AT3<31, 0, 177, (outs wacc:$ASo), (ins wacc:$AS), "xxmfacc $AS",
  538. IIC_VecGeneral, []>,
  539. RegConstraint<"$ASo = $AS">, NoEncode<"$ASo">;
  540. def XXMTACCW :
  541. XForm_AT3<31, 1, 177, (outs wacc:$AT), (ins wacc:$ATi), "xxmtacc $AT",
  542. IIC_VecGeneral, []>,
  543. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  544. let isAsCheapAsAMove = 1, isReMaterializable = 1 in {
  545. def XXSETACCZW :
  546. XForm_AT3<31, 3, 177, (outs wacc:$AT), (ins), "xxsetaccz $AT",
  547. IIC_VecGeneral, [(set v512i1:$AT, (int_ppc_mma_xxsetaccz))]>;
  548. }
  549. def XVI8GER4WSPP :
  550. XX3Form_AT3_XAB6<59, 99, (outs wacc:$AT),
  551. (ins wacc:$ATi, vsrc:$XA, vsrc:$XB),
  552. "xvi8ger4spp $AT, $XA, $XB", IIC_VecGeneral, []>,
  553. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  554. let mayStore = 1 in {
  555. def SPILL_WACC: PPCEmitTimePseudo<(outs), (ins wacc:$AT, memrix16:$dst),
  556. "#SPILL_WACC", []>;
  557. }
  558. let mayLoad = 1, hasSideEffects = 0 in {
  559. def RESTORE_WACC: PPCEmitTimePseudo<(outs wacc:$AT), (ins memrix16:$src),
  560. "#RESTORE_WACC", []>;
  561. }
  562. }
  563. let Predicates = [MMA, PrefixInstrs, IsNotISAFuture] in {
  564. def PMXVI8GER4SPP :
  565. MMIRR_XX3Form_XYP4_XAB6<59, 99, (outs acc:$AT),
  566. (ins acc:$ATi, vsrc:$XA,vsrc:$XB, u4imm:$XMSK,
  567. u4imm:$YMSK, u4imm:$PMSK),
  568. "pmxvi8ger4spp $AT, $XA, $XB, $XMSK, $YMSK, $PMSK",
  569. IIC_VecGeneral, []>,
  570. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  571. }
  572. let Predicates = [MMA, PrefixInstrs, IsISAFuture], isCodeGenOnly = 1 in {
  573. def PMXVI8GER4WSPP :
  574. MMIRR_XX3Form_XYP4_XAB6<59, 99, (outs wacc:$AT),
  575. (ins wacc:$ATi, vsrc:$XA,vsrc:$XB, u4imm:$XMSK,
  576. u4imm:$YMSK, u4imm:$PMSK),
  577. "pmxvi8ger4spp $AT, $XA, $XB, $XMSK, $YMSK, $PMSK",
  578. IIC_VecGeneral, []>,
  579. RegConstraint<"$ATi = $AT">, NoEncode<"$ATi">;
  580. }
  581. // MMA accumulating/non-accumulating instructions.
  582. //------------------------------------------------------------------------------
  583. // XVBF16GER2, XVBF16GER2PP, XVBF16GER2PN, XVBF16GER2NP, XVBF16GER2NN
  584. // PMXVBF16GER2, PMXVBF16GER2PP, PMXVBF16GER2PN, PMXVBF16GER2NP, PMXVBF16GER2NN
  585. defm XVBF16GER2 : ACC_NEG_UM_M244_XOM84C<59, 50, (ins vsrc:$XA, vsrc:$XB),
  586. "xvbf16ger2", "$AT, $XA, $XB">;
  587. // XVI4GER8, XVI4GER8PP, PMXVI4GER8, PMXVI4GER8PP
  588. defm XVI4GER8 : ACC_UM_M844_XOEO<59, 34, (ins vsrc:$XA, vsrc:$XB),
  589. "xvi4ger8", "$AT, $XA, $XB">;
  590. // XVI8GER4, XVI8GER4PP, PMXVI8GER4, PMXVI8GER4PP
  591. defm XVI8GER4 : ACC_UM_M444_XOEO<59, 2, (ins vsrc:$XA, vsrc:$XB),
  592. "xvi8ger4", "$AT, $XA, $XB">;
  593. // XVI16GER2, XVI16GER2PP, PMXVI16GER2, PMXVI16GER2PP
  594. defm XVI16GER2 : ACC_UM_M244_XO46<59, 75, (ins vsrc:$XA, vsrc:$XB),
  595. "xvi16ger2", "$AT, $XA, $XB">;
  596. // XVI16GER2S, XVI16GER2SPP, PMXVI16GER2S, PMXVI16GER2SPP
  597. defm XVI16GER2S : ACC_UM_M244_XOEO<59, 42, (ins vsrc:$XA, vsrc:$XB),
  598. "xvi16ger2s", "$AT, $XA, $XB">;
  599. // XVF16GER2, XVF16GER2PP, XVF16GER2PN, XVF16GER2NP, XVF16GER2NN
  600. // PMXVF16GER2, PMXVF16GER2PP, PMXVF16GER2PN, PMXVF16GER2NP, PMXVF16GER2NN
  601. defm XVF16GER2 : ACC_NEG_UM_M244_XOM84C<59, 18, (ins vsrc:$XA, vsrc:$XB),
  602. "xvf16ger2", "$AT, $XA, $XB">;
  603. // XVF32GER, XVF32GERPP, XVF32GERPN, XVF32GERNP, XVF32GERPP
  604. // PMXVF32GER, PMXVF32GERPP, PMXVF32GERPN, PMXVF32GERNP, PMXVF32GERPP
  605. defm XVF32GER : ACC_NEG_UM_M44_XOM84C<59, 26, (ins vsrc:$XA, vsrc:$XB),
  606. "xvf32ger", "$AT, $XA, $XB">;
  607. // XVF64GER, XVF64GERPP, XVF64GERPN, XVF64GERNP, XVF64GERNN
  608. // PMXVF64GER, PMXVF64GERPP, PMXVF64GERPN, PMXVF64GERNP, PMXVF64GERNN
  609. defm XVF64GER : ACC_NEG_UM_M42_XOM84C<59, 58, (ins vsrpevenrc:$XA, vsrc:$XB),
  610. "xvf64ger", "$AT, $XA, $XB">;
  611. //------------------------------------------------------------------------------
  612. // MMA Intrinsics
  613. let Predicates = [MMA, IsNotISAFuture] in {
  614. def : Pat<(v512i1 (int_ppc_mma_xvi4ger8 v16i8:$XA, v16i8:$XB)),
  615. (XVI4GER8 RCCp.AToVSRC, RCCp.BToVSRC)>;
  616. def : Pat<(v512i1 (int_ppc_mma_xvi4ger8pp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  617. (XVI4GER8PP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  618. def : Pat<(v512i1 (int_ppc_mma_xvi8ger4 v16i8:$XA, v16i8:$XB)),
  619. (XVI8GER4 RCCp.AToVSRC, RCCp.BToVSRC)>;
  620. def : Pat<(v512i1 (int_ppc_mma_xvi8ger4pp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  621. (XVI8GER4PP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  622. def : Pat<(v512i1 (int_ppc_mma_xvi16ger2s v16i8:$XA, v16i8:$XB)),
  623. (XVI16GER2S RCCp.AToVSRC, RCCp.BToVSRC)>;
  624. def : Pat<(v512i1 (int_ppc_mma_xvi16ger2spp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  625. (XVI16GER2SPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  626. }
  627. let Predicates = [MMA, IsISAFuture] in {
  628. def : Pat<(v512i1 (int_ppc_mma_xvi4ger8 v16i8:$XA, v16i8:$XB)),
  629. (XVI4GER8W RCCp.AToVSRC, RCCp.BToVSRC)>;
  630. def : Pat<(v512i1 (int_ppc_mma_xvi4ger8pp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  631. (XVI4GER8WPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  632. def : Pat<(v512i1 (int_ppc_mma_xvi8ger4 v16i8:$XA, v16i8:$XB)),
  633. (XVI8GER4W RCCp.AToVSRC, RCCp.BToVSRC)>;
  634. def : Pat<(v512i1 (int_ppc_mma_xvi8ger4pp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  635. (XVI8GER4WPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  636. def : Pat<(v512i1 (int_ppc_mma_xvi16ger2s v16i8:$XA, v16i8:$XB)),
  637. (XVI16GER2SW RCCp.AToVSRC, RCCp.BToVSRC)>;
  638. def : Pat<(v512i1 (int_ppc_mma_xvi16ger2spp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  639. (XVI16GER2SWPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  640. }
  641. let Predicates = [MMA, IsNotISAFuture] in {
  642. def : Pat<(v512i1 (int_ppc_mma_xvf16ger2 v16i8:$XA, v16i8:$XB)),
  643. (XVF16GER2 RCCp.AToVSRC, RCCp.BToVSRC)>;
  644. def : Pat<(v512i1 (int_ppc_mma_xvf16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  645. (XVF16GER2PP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  646. def : Pat<(v512i1 (int_ppc_mma_xvf16ger2pn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  647. (XVF16GER2PN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  648. def : Pat<(v512i1 (int_ppc_mma_xvf16ger2np v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  649. (XVF16GER2NP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  650. def : Pat<(v512i1 (int_ppc_mma_xvf16ger2nn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  651. (XVF16GER2NN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  652. }
  653. let Predicates = [MMA, IsISAFuture] in {
  654. def : Pat<(v512i1 (int_ppc_mma_xvf16ger2 v16i8:$XA, v16i8:$XB)),
  655. (XVF16GER2W RCCp.AToVSRC, RCCp.BToVSRC)>;
  656. def : Pat<(v512i1 (int_ppc_mma_xvf16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  657. (XVF16GER2WPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  658. def : Pat<(v512i1 (int_ppc_mma_xvf16ger2pn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  659. (XVF16GER2WPN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  660. def : Pat<(v512i1 (int_ppc_mma_xvf16ger2np v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  661. (XVF16GER2WNP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  662. def : Pat<(v512i1 (int_ppc_mma_xvf16ger2nn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  663. (XVF16GER2WNN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  664. }
  665. let Predicates = [MMA, IsNotISAFuture] in {
  666. def : Pat<(v512i1 (int_ppc_mma_xvf32ger v16i8:$XA, v16i8:$XB)),
  667. (XVF32GER RCCp.AToVSRC, RCCp.BToVSRC)>;
  668. def : Pat<(v512i1 (int_ppc_mma_xvf32gerpp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  669. (XVF32GERPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  670. def : Pat<(v512i1 (int_ppc_mma_xvf32gerpn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  671. (XVF32GERPN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  672. def : Pat<(v512i1 (int_ppc_mma_xvf32gernp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  673. (XVF32GERNP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  674. def : Pat<(v512i1 (int_ppc_mma_xvf32gernn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  675. (XVF32GERNN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  676. def : Pat<(v512i1 (int_ppc_mma_xvf64ger v256i1:$XA, v16i8:$XB)),
  677. (XVF64GER $XA, RCCp.BToVSRC)>;
  678. def : Pat<(v512i1 (int_ppc_mma_xvf64gerpp v512i1:$ATi, v256i1:$XA, v16i8:$XB)),
  679. (XVF64GERPP $ATi, $XA, RCCp.BToVSRC)>;
  680. def : Pat<(v512i1 (int_ppc_mma_xvf64gerpn v512i1:$ATi, v256i1:$XA, v16i8:$XB)),
  681. (XVF64GERPN $ATi, $XA, RCCp.BToVSRC)>;
  682. def : Pat<(v512i1 (int_ppc_mma_xvf64gernp v512i1:$ATi, v256i1:$XA, v16i8:$XB)),
  683. (XVF64GERNP $ATi, $XA, RCCp.BToVSRC)>;
  684. def : Pat<(v512i1 (int_ppc_mma_xvf64gernn v512i1:$ATi, v256i1:$XA, v16i8:$XB)),
  685. (XVF64GERNN $ATi, $XA, RCCp.BToVSRC)>;
  686. def : Pat<(v512i1 (int_ppc_mma_xvbf16ger2 v16i8:$XA, v16i8:$XB)),
  687. (XVBF16GER2 RCCp.AToVSRC, RCCp.BToVSRC)>;
  688. def : Pat<(v512i1 (int_ppc_mma_xvbf16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  689. (XVBF16GER2PP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  690. def : Pat<(v512i1 (int_ppc_mma_xvbf16ger2pn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  691. (XVBF16GER2PN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  692. def : Pat<(v512i1 (int_ppc_mma_xvbf16ger2np v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  693. (XVBF16GER2NP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  694. def : Pat<(v512i1 (int_ppc_mma_xvbf16ger2nn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  695. (XVBF16GER2NN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  696. def : Pat<(v512i1 (int_ppc_mma_xvi16ger2 v16i8:$XA, v16i8:$XB)),
  697. (XVI16GER2 RCCp.AToVSRC, RCCp.BToVSRC)>;
  698. def : Pat<(v512i1 (int_ppc_mma_xvi16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  699. (XVI16GER2PP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  700. def : Pat<(v512i1 (int_ppc_mma_xvi8ger4spp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  701. (XVI8GER4SPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  702. }
  703. let Predicates = [MMA, IsISAFuture] in {
  704. def : Pat<(v512i1 (int_ppc_mma_xvf32ger v16i8:$XA, v16i8:$XB)),
  705. (XVF32GERW RCCp.AToVSRC, RCCp.BToVSRC)>;
  706. def : Pat<(v512i1 (int_ppc_mma_xvf32gerpp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  707. (XVF32GERWPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  708. def : Pat<(v512i1 (int_ppc_mma_xvf32gerpn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  709. (XVF32GERWPN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  710. def : Pat<(v512i1 (int_ppc_mma_xvf32gernp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  711. (XVF32GERWNP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  712. def : Pat<(v512i1 (int_ppc_mma_xvf32gernn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  713. (XVF32GERWNN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  714. def : Pat<(v512i1 (int_ppc_mma_xvf64ger v256i1:$XA, v16i8:$XB)),
  715. (XVF64GERW $XA, RCCp.BToVSRC)>;
  716. def : Pat<(v512i1 (int_ppc_mma_xvf64gerpp v512i1:$ATi, v256i1:$XA, v16i8:$XB)),
  717. (XVF64GERWPP $ATi, $XA, RCCp.BToVSRC)>;
  718. def : Pat<(v512i1 (int_ppc_mma_xvf64gerpn v512i1:$ATi, v256i1:$XA, v16i8:$XB)),
  719. (XVF64GERWPN $ATi, $XA, RCCp.BToVSRC)>;
  720. def : Pat<(v512i1 (int_ppc_mma_xvf64gernp v512i1:$ATi, v256i1:$XA, v16i8:$XB)),
  721. (XVF64GERNP $ATi, $XA, RCCp.BToVSRC)>;
  722. def : Pat<(v512i1 (int_ppc_mma_xvf64gernn v512i1:$ATi, v256i1:$XA, v16i8:$XB)),
  723. (XVF64GERWNN $ATi, $XA, RCCp.BToVSRC)>;
  724. def : Pat<(v512i1 (int_ppc_mma_xvbf16ger2 v16i8:$XA, v16i8:$XB)),
  725. (XVBF16GER2W RCCp.AToVSRC, RCCp.BToVSRC)>;
  726. def : Pat<(v512i1 (int_ppc_mma_xvbf16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  727. (XVBF16GER2WPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  728. def : Pat<(v512i1 (int_ppc_mma_xvbf16ger2pn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  729. (XVBF16GER2WPN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  730. def : Pat<(v512i1 (int_ppc_mma_xvbf16ger2np v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  731. (XVBF16GER2WNP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  732. def : Pat<(v512i1 (int_ppc_mma_xvbf16ger2nn v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  733. (XVBF16GER2WNN $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  734. def : Pat<(v512i1 (int_ppc_mma_xvi16ger2 v16i8:$XA, v16i8:$XB)),
  735. (XVI16GER2W RCCp.AToVSRC, RCCp.BToVSRC)>;
  736. def : Pat<(v512i1 (int_ppc_mma_xvi16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  737. (XVI16GER2WPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  738. def : Pat<(v512i1 (int_ppc_mma_xvi8ger4spp v512i1:$ATi, v16i8:$XA, v16i8:$XB)),
  739. (XVI8GER4WSPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC)>;
  740. }
  741. // MMA Intrinsics
  742. let Predicates = [MMA, PrefixInstrs, IsNotISAFuture] in {
  743. def : Pat<(v512i1 (int_ppc_mma_pmxvi4ger8 v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  744. Msk4Imm:$YMSK, Msk8Imm:$PMSK)),
  745. (PMXVI4GER8 RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  746. Msk4Imm:$YMSK, Msk8Imm:$PMSK)>;
  747. def : Pat<(v512i1 (int_ppc_mma_pmxvi4ger8pp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  748. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  749. Msk8Imm:$PMSK)),
  750. (PMXVI4GER8PP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  751. Msk4Imm:$YMSK, Msk8Imm:$PMSK)>;
  752. def : Pat<(v512i1 (int_ppc_mma_pmxvi8ger4 v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  753. Msk4Imm:$YMSK, Msk4Imm:$PMSK)),
  754. (PMXVI8GER4 RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  755. Msk4Imm:$YMSK, Msk4Imm:$PMSK)>;
  756. def : Pat<(v512i1 (int_ppc_mma_pmxvi8ger4pp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  757. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  758. Msk4Imm:$PMSK)),
  759. (PMXVI8GER4PP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  760. Msk4Imm:$YMSK, Msk4Imm:$PMSK)>;
  761. def : Pat<(v512i1 (int_ppc_mma_pmxvi16ger2s v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  762. Msk4Imm:$YMSK, Msk2Imm:$PMSK)),
  763. (PMXVI16GER2S RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  764. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  765. def : Pat<(v512i1 (int_ppc_mma_pmxvi16ger2spp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  766. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  767. Msk2Imm:$PMSK)),
  768. (PMXVI16GER2SPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  769. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  770. def : Pat<(v512i1 (int_ppc_mma_pmxvf16ger2 v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  771. Msk4Imm:$YMSK, Msk2Imm:$PMSK)),
  772. (PMXVF16GER2 RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  773. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  774. def : Pat<(v512i1 (int_ppc_mma_pmxvf16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  775. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  776. Msk2Imm:$PMSK)),
  777. (PMXVF16GER2PP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  778. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  779. def : Pat<(v512i1 (int_ppc_mma_pmxvf16ger2pn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  780. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  781. Msk2Imm:$PMSK)),
  782. (PMXVF16GER2PN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  783. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  784. def : Pat<(v512i1 (int_ppc_mma_pmxvf16ger2np v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  785. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  786. Msk2Imm:$PMSK)),
  787. (PMXVF16GER2NP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  788. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  789. def : Pat<(v512i1 (int_ppc_mma_pmxvf16ger2nn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  790. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  791. Msk2Imm:$PMSK)),
  792. (PMXVF16GER2NN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  793. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  794. def : Pat<(v512i1 (int_ppc_mma_pmxvf32ger v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  795. Msk4Imm:$YMSK)),
  796. (PMXVF32GER RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  797. Msk4Imm:$YMSK)>;
  798. def : Pat<(v512i1 (int_ppc_mma_pmxvf32gerpp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  799. Msk4Imm:$XMSK, Msk4Imm:$YMSK)),
  800. (PMXVF32GERPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  801. Msk4Imm:$YMSK)>;
  802. def : Pat<(v512i1 (int_ppc_mma_pmxvf32gerpn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  803. Msk4Imm:$XMSK, Msk4Imm:$YMSK)),
  804. (PMXVF32GERPN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  805. Msk4Imm:$YMSK)>;
  806. def : Pat<(v512i1 (int_ppc_mma_pmxvf32gernp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  807. Msk4Imm:$XMSK, Msk4Imm:$YMSK)),
  808. (PMXVF32GERNP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  809. Msk4Imm:$YMSK)>;
  810. def : Pat<(v512i1 (int_ppc_mma_pmxvf32gernn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  811. Msk4Imm:$XMSK, Msk4Imm:$YMSK)),
  812. (PMXVF32GERNN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  813. Msk4Imm:$YMSK)>;
  814. def : Pat<(v512i1 (int_ppc_mma_pmxvf64ger v256i1:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  815. Msk2Imm:$YMSK)),
  816. (PMXVF64GER $XA, RCCp.BToVSRC, Msk4Imm:$XMSK, Msk2Imm:$YMSK)>;
  817. def : Pat<(v512i1 (int_ppc_mma_pmxvf64gerpp v512i1:$ATi, v256i1:$XA, v16i8:$XB,
  818. Msk4Imm:$XMSK, Msk2Imm:$YMSK)),
  819. (PMXVF64GERPP $ATi, $XA, RCCp.BToVSRC, Msk4Imm:$XMSK,
  820. Msk2Imm:$YMSK)>;
  821. def : Pat<(v512i1 (int_ppc_mma_pmxvf64gerpn v512i1:$ATi, v256i1:$XA, v16i8:$XB,
  822. Msk4Imm:$XMSK, Msk2Imm:$YMSK)),
  823. (PMXVF64GERPN $ATi, $XA, RCCp.BToVSRC, Msk4Imm:$XMSK,
  824. Msk2Imm:$YMSK)>;
  825. def : Pat<(v512i1 (int_ppc_mma_pmxvf64gernp v512i1:$ATi, v256i1:$XA, v16i8:$XB,
  826. Msk4Imm:$XMSK, Msk2Imm:$YMSK)),
  827. (PMXVF64GERNP $ATi, $XA, RCCp.BToVSRC, Msk4Imm:$XMSK,
  828. Msk2Imm:$YMSK)>;
  829. def : Pat<(v512i1 (int_ppc_mma_pmxvf64gernn v512i1:$ATi, v256i1:$XA, v16i8:$XB,
  830. Msk4Imm:$XMSK, Msk2Imm:$YMSK)),
  831. (PMXVF64GERNN $ATi, $XA, RCCp.BToVSRC, Msk4Imm:$XMSK,
  832. Msk2Imm:$YMSK)>;
  833. def : Pat<(v512i1 (int_ppc_mma_pmxvbf16ger2 v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  834. Msk4Imm:$YMSK, Msk2Imm:$PMSK)),
  835. (PMXVBF16GER2 RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  836. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  837. def : Pat<(v512i1 (int_ppc_mma_pmxvbf16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  838. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  839. Msk2Imm:$PMSK)),
  840. (PMXVBF16GER2PP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  841. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  842. def : Pat<(v512i1 (int_ppc_mma_pmxvbf16ger2pn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  843. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  844. Msk2Imm:$PMSK)),
  845. (PMXVBF16GER2PN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  846. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  847. def : Pat<(v512i1 (int_ppc_mma_pmxvbf16ger2np v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  848. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  849. Msk2Imm:$PMSK)),
  850. (PMXVBF16GER2NP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  851. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  852. def : Pat<(v512i1 (int_ppc_mma_pmxvbf16ger2nn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  853. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  854. Msk2Imm:$PMSK)),
  855. (PMXVBF16GER2NN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  856. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  857. def : Pat<(v512i1 (int_ppc_mma_pmxvi16ger2 v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  858. Msk4Imm:$YMSK, Msk2Imm:$PMSK)),
  859. (PMXVI16GER2 RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  860. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  861. def : Pat<(v512i1 (int_ppc_mma_pmxvi8ger4spp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  862. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  863. Msk2Imm:$PMSK)),
  864. (PMXVI8GER4SPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  865. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  866. def : Pat<(v512i1 (int_ppc_mma_pmxvi16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  867. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  868. Msk2Imm:$PMSK)),
  869. (PMXVI16GER2PP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  870. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  871. }
  872. let Predicates = [MMA, PrefixInstrs, IsISAFuture] in {
  873. def : Pat<(v512i1 (int_ppc_mma_pmxvi4ger8 v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  874. Msk4Imm:$YMSK, Msk8Imm:$PMSK)),
  875. (PMXVI4GER8W RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  876. Msk4Imm:$YMSK, Msk8Imm:$PMSK)>;
  877. def : Pat<(v512i1 (int_ppc_mma_pmxvi4ger8pp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  878. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  879. Msk8Imm:$PMSK)),
  880. (PMXVI4GER8WPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  881. Msk4Imm:$YMSK, Msk8Imm:$PMSK)>;
  882. def : Pat<(v512i1 (int_ppc_mma_pmxvi8ger4 v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  883. Msk4Imm:$YMSK, Msk4Imm:$PMSK)),
  884. (PMXVI8GER4W RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  885. Msk4Imm:$YMSK, Msk4Imm:$PMSK)>;
  886. def : Pat<(v512i1 (int_ppc_mma_pmxvi8ger4pp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  887. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  888. Msk4Imm:$PMSK)),
  889. (PMXVI8GER4WPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  890. Msk4Imm:$YMSK, Msk4Imm:$PMSK)>;
  891. def : Pat<(v512i1 (int_ppc_mma_pmxvi16ger2s v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  892. Msk4Imm:$YMSK, Msk2Imm:$PMSK)),
  893. (PMXVI16GER2SW RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  894. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  895. def : Pat<(v512i1 (int_ppc_mma_pmxvi16ger2spp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  896. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  897. Msk2Imm:$PMSK)),
  898. (PMXVI16GER2SWPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  899. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  900. def : Pat<(v512i1 (int_ppc_mma_pmxvf16ger2 v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  901. Msk4Imm:$YMSK, Msk2Imm:$PMSK)),
  902. (PMXVF16GER2W RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  903. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  904. def : Pat<(v512i1 (int_ppc_mma_pmxvf16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  905. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  906. Msk2Imm:$PMSK)),
  907. (PMXVF16GER2WPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  908. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  909. def : Pat<(v512i1 (int_ppc_mma_pmxvf16ger2pn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  910. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  911. Msk2Imm:$PMSK)),
  912. (PMXVF16GER2WPN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  913. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  914. def : Pat<(v512i1 (int_ppc_mma_pmxvf16ger2np v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  915. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  916. Msk2Imm:$PMSK)),
  917. (PMXVF16GER2WNP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  918. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  919. def : Pat<(v512i1 (int_ppc_mma_pmxvf16ger2nn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  920. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  921. Msk2Imm:$PMSK)),
  922. (PMXVF16GER2WNN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  923. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  924. def : Pat<(v512i1 (int_ppc_mma_pmxvf32ger v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  925. Msk4Imm:$YMSK)),
  926. (PMXVF32GERW RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  927. Msk4Imm:$YMSK)>;
  928. def : Pat<(v512i1 (int_ppc_mma_pmxvf32gerpp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  929. Msk4Imm:$XMSK, Msk4Imm:$YMSK)),
  930. (PMXVF32GERWPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  931. Msk4Imm:$YMSK)>;
  932. def : Pat<(v512i1 (int_ppc_mma_pmxvf32gerpn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  933. Msk4Imm:$XMSK, Msk4Imm:$YMSK)),
  934. (PMXVF32GERWPN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  935. Msk4Imm:$YMSK)>;
  936. def : Pat<(v512i1 (int_ppc_mma_pmxvf32gernp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  937. Msk4Imm:$XMSK, Msk4Imm:$YMSK)),
  938. (PMXVF32GERWNP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  939. Msk4Imm:$YMSK)>;
  940. def : Pat<(v512i1 (int_ppc_mma_pmxvf32gernn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  941. Msk4Imm:$XMSK, Msk4Imm:$YMSK)),
  942. (PMXVF32GERWNN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  943. Msk4Imm:$YMSK)>;
  944. def : Pat<(v512i1 (int_ppc_mma_pmxvf64ger v256i1:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  945. Msk2Imm:$YMSK)),
  946. (PMXVF64GERW $XA, RCCp.BToVSRC, Msk4Imm:$XMSK, Msk2Imm:$YMSK)>;
  947. def : Pat<(v512i1 (int_ppc_mma_pmxvf64gerpp v512i1:$ATi, v256i1:$XA, v16i8:$XB,
  948. Msk4Imm:$XMSK, Msk2Imm:$YMSK)),
  949. (PMXVF64GERWPP $ATi, $XA, RCCp.BToVSRC, Msk4Imm:$XMSK,
  950. Msk2Imm:$YMSK)>;
  951. def : Pat<(v512i1 (int_ppc_mma_pmxvf64gerpn v512i1:$ATi, v256i1:$XA, v16i8:$XB,
  952. Msk4Imm:$XMSK, Msk2Imm:$YMSK)),
  953. (PMXVF64GERWPN $ATi, $XA, RCCp.BToVSRC, Msk4Imm:$XMSK,
  954. Msk2Imm:$YMSK)>;
  955. def : Pat<(v512i1 (int_ppc_mma_pmxvf64gernp v512i1:$ATi, v256i1:$XA, v16i8:$XB,
  956. Msk4Imm:$XMSK, Msk2Imm:$YMSK)),
  957. (PMXVF64GERWNP $ATi, $XA, RCCp.BToVSRC, Msk4Imm:$XMSK,
  958. Msk2Imm:$YMSK)>;
  959. def : Pat<(v512i1 (int_ppc_mma_pmxvf64gernn v512i1:$ATi, v256i1:$XA, v16i8:$XB,
  960. Msk4Imm:$XMSK, Msk2Imm:$YMSK)),
  961. (PMXVF64GERWNN $ATi, $XA, RCCp.BToVSRC, Msk4Imm:$XMSK,
  962. Msk2Imm:$YMSK)>;
  963. def : Pat<(v512i1 (int_ppc_mma_pmxvbf16ger2 v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  964. Msk4Imm:$YMSK, Msk2Imm:$PMSK)),
  965. (PMXVBF16GER2W RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  966. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  967. def : Pat<(v512i1 (int_ppc_mma_pmxvbf16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  968. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  969. Msk2Imm:$PMSK)),
  970. (PMXVBF16GER2WPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  971. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  972. def : Pat<(v512i1 (int_ppc_mma_pmxvbf16ger2pn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  973. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  974. Msk2Imm:$PMSK)),
  975. (PMXVBF16GER2WPN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  976. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  977. def : Pat<(v512i1 (int_ppc_mma_pmxvbf16ger2np v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  978. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  979. Msk2Imm:$PMSK)),
  980. (PMXVBF16GER2WNP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  981. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  982. def : Pat<(v512i1 (int_ppc_mma_pmxvbf16ger2nn v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  983. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  984. Msk2Imm:$PMSK)),
  985. (PMXVBF16GER2WNN $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  986. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  987. def : Pat<(v512i1 (int_ppc_mma_pmxvi16ger2 v16i8:$XA, v16i8:$XB, Msk4Imm:$XMSK,
  988. Msk4Imm:$YMSK, Msk2Imm:$PMSK)),
  989. (PMXVI16GER2W RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  990. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  991. def : Pat<(v512i1 (int_ppc_mma_pmxvi8ger4spp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  992. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  993. Msk2Imm:$PMSK)),
  994. (PMXVI8GER4WSPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  995. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  996. def : Pat<(v512i1 (int_ppc_mma_pmxvi16ger2pp v512i1:$ATi, v16i8:$XA, v16i8:$XB,
  997. Msk4Imm:$XMSK, Msk4Imm:$YMSK,
  998. Msk2Imm:$PMSK)),
  999. (PMXVI16GER2WPP $ATi, RCCp.AToVSRC, RCCp.BToVSRC, Msk4Imm:$XMSK,
  1000. Msk4Imm:$YMSK, Msk2Imm:$PMSK)>;
  1001. }
  1002. def ConcatsMMA {
  1003. dag VecsToVecPair0 =
  1004. (v256i1 (INSERT_SUBREG
  1005. (INSERT_SUBREG (IMPLICIT_DEF), $vs0, sub_vsx1),
  1006. $vs1, sub_vsx0));
  1007. dag VecsToVecPair1 =
  1008. (v256i1 (INSERT_SUBREG
  1009. (INSERT_SUBREG (IMPLICIT_DEF), $vs2, sub_vsx1),
  1010. $vs3, sub_vsx0));
  1011. dag VecsToVecQuad =
  1012. (BUILD_UACC (INSERT_SUBREG
  1013. (INSERT_SUBREG (v512i1 (IMPLICIT_DEF)),
  1014. (KILL_PAIR VecsToVecPair0), sub_pair0),
  1015. (KILL_PAIR VecsToVecPair1), sub_pair1));
  1016. }
  1017. def Extracts {
  1018. dag Pair0 = (v256i1 (EXTRACT_SUBREG $v, sub_pair0));
  1019. dag Pair1 = (v256i1 (EXTRACT_SUBREG $v, sub_pair1));
  1020. dag Vec0 = (v4i32 (EXTRACT_SUBREG Pair0, sub_vsx0));
  1021. dag Vec1 = (v4i32 (EXTRACT_SUBREG Pair0, sub_vsx1));
  1022. dag Vec2 = (v4i32 (EXTRACT_SUBREG Pair1, sub_vsx0));
  1023. dag Vec3 = (v4i32 (EXTRACT_SUBREG Pair1, sub_vsx1));
  1024. }
  1025. let Predicates = [MMA, IsNotISAFuture] in {
  1026. def : Pat<(v512i1 (PPCAccBuild v4i32:$vs1, v4i32:$vs0, v4i32:$vs3, v4i32:$vs2)),
  1027. (XXMTACC ConcatsMMA.VecsToVecQuad)>;
  1028. def : Pat<(v512i1 (int_ppc_mma_assemble_acc v16i8:$vs1, v16i8:$vs0,
  1029. v16i8:$vs3, v16i8:$vs2)),
  1030. (XXMTACC ConcatsMMA.VecsToVecQuad)>;
  1031. def : Pat<(v512i1 (PPCxxmfacc v512i1:$AS)), (XXMFACC acc:$AS)>;
  1032. def : Pat<(v4i32 (PPCAccExtractVsx acc:$v, 0)),
  1033. Extracts.Vec0>;
  1034. def : Pat<(v4i32 (PPCAccExtractVsx acc:$v, 1)),
  1035. Extracts.Vec1>;
  1036. def : Pat<(v4i32 (PPCAccExtractVsx acc:$v, 2)),
  1037. Extracts.Vec2>;
  1038. def : Pat<(v4i32 (PPCAccExtractVsx acc:$v, 3)),
  1039. Extracts.Vec3>;
  1040. }
  1041. let Predicates = [MMA, IsISAFuture] in {
  1042. def : Pat<(v512i1 (PPCAccBuild v4i32:$vs1, v4i32:$vs0, v4i32:$vs3, v4i32:$vs2)),
  1043. (DMXXINSTFDMR512 ConcatsMMA.VecsToVecPair0, ConcatsMMA.VecsToVecPair1)>;
  1044. def : Pat<(v512i1 (int_ppc_mma_assemble_acc v16i8:$vs1, v16i8:$vs0,
  1045. v16i8:$vs3, v16i8:$vs2)),
  1046. (DMXXINSTFDMR512 ConcatsMMA.VecsToVecPair0, ConcatsMMA.VecsToVecPair1)>;
  1047. def : Pat<(v512i1 immAllZerosV), (XXSETACCZW)>;
  1048. }