@@ -182,10 +182,113 @@ class XX3Form_XTAB6<bits<6> opcode, bits<8> xo, dag OOL, dag IOL, string asmstr,
182182 let Inst{31} = XT{5};
183183}
184184
185+ class XX3Form_XTAB6_S<bits<5> xo, dag OOL, dag IOL, string asmstr,
186+ list<dag> pattern>
187+ : I<59, OOL, IOL, asmstr, NoItinerary> {
188+ bits<6> XT;
189+ bits<6> XA;
190+ bits<6> XB;
191+
192+ let Pattern = pattern;
193+
194+ let Inst{6...10} = XT{4...0};
195+ let Inst{11...15} = XA{4...0};
196+ let Inst{16...20} = XB{4...0};
197+ let Inst{24...28} = xo;
198+ let Inst{29} = XA{5};
199+ let Inst{30} = XB{5};
200+ let Inst{31} = XT{5};
201+ }
202+
203+ class XX3Form_XTAB6_S3<bits<5> xo, dag OOL, dag IOL, string asmstr,
204+ list<dag> pattern>
205+ : XX3Form_XTAB6_S<xo, OOL, IOL, asmstr, pattern> {
206+
207+ bits<3> S;
208+ let Inst{21...23} = S;
209+ }
210+
211+ class XX3Form_XTAB6_3S1<bits<5> xo, dag OOL, dag IOL, string asmstr,
212+ list<dag> pattern>
213+ : XX3Form_XTAB6_S<xo, OOL, IOL, asmstr, pattern> {
214+
215+ bits<1> S0;
216+ bits<1> S1;
217+ bits<1> S2;
218+
219+ let Inst{21} = S0;
220+ let Inst{22} = S1;
221+ let Inst{23} = S2;
222+ }
223+
224+ class XX3Form_XTAB6_2S1<bits<5> xo, dag OOL, dag IOL, string asmstr,
225+ list<dag> pattern>
226+ : XX3Form_XTAB6_S<xo, OOL, IOL, asmstr, pattern> {
227+
228+ bits<1> S1;
229+ bits<1> S2;
230+
231+ let Inst{21} = 0;
232+ let Inst{22} = S1;
233+ let Inst{23} = S2;
234+ }
235+
236+ class XX3Form_XTAB6_P<bits<7> xo, dag OOL, dag IOL, string asmstr,
237+ list<dag> pattern>
238+ : I<59, OOL, IOL, asmstr, NoItinerary> {
239+
240+ bits<6> XT;
241+ bits<6> XA;
242+ bits<6> XB;
243+ bits<1> P;
244+
245+ let Pattern = pattern;
246+
247+ let Inst{6...10} = XT{4...0};
248+ let Inst{11...15} = XA{4...0};
249+ let Inst{16...20} = XB{4...0};
250+ let Inst{21} = P;
251+ let Inst{22...28} = xo;
252+ let Inst{29} = XA{5};
253+ let Inst{30} = XB{5};
254+ let Inst{31} = XT{5};
255+ }
256+
257+ // Prefix instruction classes.
258+
259+ class 8RR_XX4Form_XTABC6_P<bits<6> opcode, dag OOL, dag IOL, string asmstr,
260+ InstrItinClass itin, list<dag> pattern>
261+ : PI<1, opcode, OOL, IOL, asmstr, itin> {
262+ bits<6> XT;
263+ bits<6> XA;
264+ bits<6> XB;
265+ bits<6> XC;
266+ bits<1> P;
267+
268+ let Pattern = pattern;
269+
270+ // The prefix.
271+ let Inst{6...7} = 1;
272+ let Inst{8...11} = 0;
273+
274+ // The instruction.
275+ let Inst{38...42} = XT{4...0};
276+ let Inst{43...47} = XA{4...0};
277+ let Inst{48...52} = XB{4...0};
278+ let Inst{53...57} = XC{4...0};
279+ let Inst{58} = 1;
280+ let Inst{59} = P;
281+ let Inst{60} = XC{5};
282+ let Inst{61} = XA{5};
283+ let Inst{62} = XB{5};
284+ let Inst{63} = XT{5};
285+ }
286+
185287//-------------------------- Instruction definitions -------------------------//
186288// Predicate combinations available:
187289// [IsISAFuture]
188290// [HasVSX, IsISAFuture]
291+ // [HasVSX, PrefixInstrs, IsISAFuture]
189292
190293let Predicates = [IsISAFuture] in {
191294 defm SUBFUS : XOForm_RTAB5_L1r<31, 72, (outs g8rc:$RT),
@@ -294,6 +397,78 @@ let Predicates = [HasVSX, IsISAFuture] in {
294397 "xvmulhuw $XT, $XA, $XB", []>;
295398 def XVMULHUH: XX3Form_XTAB6<60, 122, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
296399 "xvmulhuh $XT, $XA, $XB", []>;
400+
401+ // Elliptic Curve Cryptography Acceleration Instructions.
402+ def XXMULMUL
403+ : XX3Form_XTAB6_S3<1, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB, u3imm:$S),
404+ "xxmulmul $XT, $XA, $XB, $S", []>;
405+ def XXMULMULHIADD
406+ : XX3Form_XTAB6_3S1<9, (outs vsrc:$XT),
407+ (ins vsrc:$XA, vsrc:$XB, u1imm:$S0, u1imm:$S1,
408+ u1imm:$S2),
409+ "xxmulmulhiadd $XT, $XA, $XB, $S0, $S1, $S2", []>;
410+ def XXMULMULLOADD
411+ : XX3Form_XTAB6_2S1<17, (outs vsrc:$XT),
412+ (ins vsrc:$XA, vsrc:$XB, u1imm:$S1, u1imm:$S2),
413+ "xxmulmulloadd $XT, $XA, $XB, $S1, $S2", []>;
414+ def XXSSUMUDM
415+ : XX3Form_XTAB6_P<25, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB, u1imm:$P),
416+ "xxssumudm $XT, $XA, $XB, $P", []>;
417+ def XXSSUMUDMC
418+ : XX3Form_XTAB6_P<57, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB, u1imm:$P),
419+ "xxssumudmc $XT, $XA, $XB, $P", []>;
420+ def XSADDADDUQM
421+ : XX3Form_XTAB6<59, 96, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
422+ "xsaddadduqm $XT, $XA, $XB", []>;
423+ def XSADDADDSUQM
424+ : XX3Form_XTAB6<59, 104, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
425+ "xsaddaddsuqm $XT, $XA, $XB", []>;
426+ def XSADDSUBUQM
427+ : XX3Form_XTAB6<59, 112, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
428+ "xsaddsubuqm $XT, $XA, $XB", []>;
429+ def XSADDSUBSUQM
430+ : XX3Form_XTAB6<59, 224, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
431+ "xsaddsubsuqm $XT, $XA, $XB", []>;
432+ def XSMERGE2T1UQM
433+ : XX3Form_XTAB6<59, 232, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
434+ "xsmerge2t1uqm $XT, $XA, $XB", []>;
435+ def XSMERGE2T2UQM
436+ : XX3Form_XTAB6<59, 240, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
437+ "xsmerge2t2uqm $XT, $XA, $XB", []>;
438+ def XSMERGE2T3UQM
439+ : XX3Form_XTAB6<59, 89, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
440+ "xsmerge2t3uqm $XT, $XA, $XB", []>;
441+ def XSMERGE3T1UQM
442+ : XX3Form_XTAB6<59, 121, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
443+ "xsmerge3t1uqm $XT, $XA, $XB", []>;
444+ def XSREBASE2T1UQM
445+ : XX3Form_XTAB6<59, 145, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
446+ "xsrebase2t1uqm $XT, $XA, $XB", []>;
447+ def XSREBASE2T2UQM
448+ : XX3Form_XTAB6<59, 177, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
449+ "xsrebase2t2uqm $XT, $XA, $XB", []>;
450+ def XSREBASE2T3UQM
451+ : XX3Form_XTAB6<59, 209, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
452+ "xsrebase2t3uqm $XT, $XA, $XB", []>;
453+ def XSREBASE2T4UQM
454+ : XX3Form_XTAB6<59, 217, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
455+ "xsrebase2t4uqm $XT, $XA, $XB", []>;
456+ def XSREBASE3T1UQM
457+ : XX3Form_XTAB6<59, 241, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
458+ "xsrebase3t1uqm $XT, $XA, $XB", []>;
459+ def XSREBASE3T2UQM
460+ : XX3Form_XTAB6<59, 249, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
461+ "xsrebase3t2uqm $XT, $XA, $XB", []>;
462+ def XSREBASE3T3UQM
463+ : XX3Form_XTAB6<59, 195, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB),
464+ "xsrebase3t3uqm $XT, $XA, $XB", []>;
465+ }
466+
467+ let Predicates = [HasVSX, PrefixInstrs, IsISAFuture] in {
468+ def XXSSUMUDMCEXT
469+ : 8RR_XX4Form_XTABC6_P<
470+ 34, (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB, vsrc:$XC, u1imm:$P),
471+ "xxssumudmcext $XT, $XA, $XB, $XC, $P", IIC_VecGeneral, []>;
297472}
298473
299474//---------------------------- Anonymous Patterns ----------------------------//
0 commit comments