Lines Matching +full:vcc +full:- +full:p

1 //===-- VOP2Instructions.td - Vector Instruction Definitions --------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 class VOP2e <bits<6> op, VOPProfile P> : Enc32 {
18 let Inst{8-0} = !if(P.HasSrc0, src0, 0);
19 let Inst{16-9} = !if(P.HasSrc1, src1, 0);
20 let Inst{24-17} = !if(P.EmitDst, vdst, 0);
21 let Inst{30-25} = op;
25 class VOP2_MADKe <bits<6> op, VOPProfile P> : Enc64 {
31 let Inst{8-0} = !if(P.HasSrc0, src0, 0);
32 let Inst{16-9} = !if(P.HasSrc1, src1, 0);
33 let Inst{24-17} = !if(P.EmitDst, vdst, 0);
34 let Inst{30-25} = op;
36 let Inst{63-32} = imm;
39 class VOP2_SDWAe <bits<6> op, VOPProfile P> : VOP_SDWAe <P> {
43 let Inst{8-0} = 0xf9; // sdwa
44 let Inst{16-9} = !if(P.HasSrc1, src1{7-0}, 0);
45 let Inst{24-17} = !if(P.EmitDst, vdst{7-0}, 0);
46 let Inst{30-25} = op;
50 class VOP2_SDWA9Ae <bits<6> op, VOPProfile P> : VOP_SDWA9Ae <P> {
54 let Inst{8-0} = 0xf9; // sdwa
55 let Inst{16-9} = !if(P.HasSrc1, src1{7-0}, 0);
56 let Inst{24-17} = !if(P.EmitDst, vdst{7-0}, 0);
57 let Inst{30-25} = op;
59 let Inst{63} = !if(P.HasSrc1, src1{8}, 0); // src1_sgpr
62 class VOP2_Pseudo <string opName, VOPProfile P, list<dag> pattern=[], string suffix = "_e32"> :
63 VOP_Pseudo <opName, suffix, P, P.Outs32, P.Ins32, "", pattern> {
65 let AsmOperands = P.Asm32;
72 let ReadsModeReg = !or(P.DstVT.isFP, P.Src0VT.isFP);
120 class VOP2_SDWA_Pseudo <string OpName, VOPProfile P, list<dag> pattern=[]> :
121 VOP_SDWA_Pseudo <OpName, P, pattern> {
125 class VOP2_DPP_Pseudo <string OpName, VOPProfile P, list<dag> pattern=[]> :
126 VOP_DPP_Pseudo <OpName, P, pattern> {
130 class getVOP2Pat64 <SDPatternOperator node, VOPProfile P> : LetDummies {
131 list<dag> ret = !if(P.HasModifiers,
132 [(set P.DstVT:$vdst,
133 (node (P.Src0VT
134 !if(P.HasOMod,
135 (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod),
136 (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp))),
137 (P.Src1VT (VOP3Mods P.Src1VT:$src1, i32:$src1_modifiers))))],
138 [(set P.DstVT:$vdst, (node P.Src0VT:$src0, P.Src1VT:$src1))]);
142 VOPProfile P,
147 def _e32 : VOP2_Pseudo <opName, P, VOPPatOrNull<node,P>.ret>,
152 VOP2Inst_e32_VOPD<string opName, VOPProfile P, bits<5> VOPDOp,
155 defm NAME : VOP2Inst_e32<opName, P, node, revOp, GFX9Renamed>,
159 VOPProfile P,
164 def _e64 : VOP3InstBase <opName, P, node, 1>,
168 if P.HasExtVOP3DPP then
169 def _e64_dpp : VOP3_DPP_Pseudo <opName, P>;
175 VOPProfile P,
178 if P.HasExtSDWA then
179 def _sdwa : VOP2_SDWA_Pseudo <opName, P>;
184 VOPProfile P,
188 VOP2Inst_e32<opName, P, node, revOp, GFX9Renamed>,
189 VOP2Inst_e64<opName, P, node, revOp, GFX9Renamed>,
190 VOP2Inst_sdwa<opName, P, GFX9Renamed> {
192 if P.HasExtDPP then
193 def _dpp : VOP2_DPP_Pseudo <opName, P>;
198 VOPProfile P,
203 defm NAME : VOP2Inst<opName, P, node, revOp, GFX9Renamed>;
206 defm _t16 : VOP2Inst<opName#"_t16", VOPProfile_True16<P>, node, revOp#"_t16", GFX9Renamed>;
209 …defm _fake16 : VOP2Inst<opName#"_fake16", VOPProfile_Fake16<P>, node, revOp#"_fake16", GFX9Renamed…
214 // any subtarget is a problem. It makes getMCOpcodeGen return -1, which we
218 VOPProfile P,
223 defm NAME : VOP2Inst<opName, P, node, revOp, GFX9Renamed>;
226 defm _t16 : VOP2Inst_e64<opName#"_t16", VOPProfile_Fake16<P>, node, revOp#"_t16", GFX9Renamed>;
231 VOPProfile P,
237 VOP2Inst_e32_VOPD<opName, P, VOPDOp, VOPDName, node, revOp, GFX9Renamed>,
238 VOP2Inst_e64<opName, P, node, revOp, GFX9Renamed>,
239 VOP2Inst_sdwa<opName, P, GFX9Renamed> {
241 if P.HasExtDPP then
242 def _dpp : VOP2_DPP_Pseudo <opName, P>;
247 VOPProfile P,
251 bit useSGPRInput = !eq(P.NumSrcArgs, 3)> {
254 let Uses = !if(useSGPRInput, [VCC, EXEC], [EXEC]), Defs = [VCC] in {
255 def _e32 : VOP2_Pseudo <opName, P, VOPPatOrNull<node,P>.ret>,
260 if P.HasExtSDWA then
261 def _sdwa : VOP2_SDWA_Pseudo <opName, P> {
264 if P.HasExtDPP then
265 def _dpp : VOP2_DPP_Pseudo <opName, P>;
266 } // End Uses = !if(useSGPRInput, [VCC, EXEC], [EXEC]), Defs = [VCC]
268 def _e64 : VOP3InstBase <opName, P, node, 1>,
272 if P.HasExtVOP3DPP then
273 def _e64_dpp : VOP3_DPP_Pseudo <opName, P>;
281 InstAlias <OpName#" "#!subst("vcc", opnd, ps.Pfl.Asm32),
293 def : VOP2bInstAlias<ps, inst, OpName, "vcc">;
298 VOP2eInst_Base<string opName, VOPProfile P, bits<5> VOPDOp, string VOPDName,
302 let Uses = !if(useSGPRInput, [VCC, EXEC], [EXEC]) in {
303 if !eq(VOPDOp, -1) then
304 def _e32 : VOP2_Pseudo <opName, P>,
307 def _e32 : VOP2_Pseudo <opName, P>,
311 if P.HasExtSDWA then
312 def _sdwa : VOP2_SDWA_Pseudo <opName, P> {
316 if P.HasExtDPP then
317 def _dpp : VOP2_DPP_Pseudo <opName, P>;
320 def _e64 : VOP3InstBase <opName, P, node, 1>,
326 if P.HasExtVOP3DPP then
327 def _e64_dpp : VOP3_DPP_Pseudo <opName, P>;
333 VOP2eInst<string opName, VOPProfile P, SDPatternOperator node = null_frag,
334 string revOp = opName, bit useSGPRInput = !eq(P.NumSrcArgs, 3)>
335 : VOP2eInst_Base<opName, P, -1, "", node, revOp, useSGPRInput>;
338 VOP2eInst_VOPD<string opName, VOPProfile P, bits<5> VOPDOp, string VOPDName,
340 bit useSGPRInput = !eq(P.NumSrcArgs, 3)>
341 : VOP2eInst_Base<opName, P, VOPDOp, VOPDName, node, revOp, useSGPRInput>;
362 def : VOP2eInstAlias<ps, inst, "vcc">;
542 // Write out to vcc or arbitrary SGPR.
544 let Asm32 = "$vdst, vcc, $src0, $src1";
546 …let AsmSDWA = "$vdst, vcc, $src0_modifiers, $src1_modifiers$clamp $dst_sel $dst_unused $src0_sel $…
547 …let AsmSDWA9 = "$vdst, vcc, $src0_modifiers, $src1_modifiers$clamp $dst_sel $dst_unused $src0_sel …
548 let AsmDPP = "$vdst, vcc, $src0, $src1 $dpp_ctrl$row_mask$bank_mask$bound_ctrl";
549 let AsmDPP8 = "$vdst, vcc, $src0, $src1 $dpp8$fi";
567 // Write out to vcc or arbitrary SGPR and read in from vcc or
571 let Asm32 = "$vdst, vcc, $src0, $src1, vcc";
572 …let AsmSDWA = "$vdst, vcc, $src0_modifiers, $src1_modifiers, vcc$clamp $dst_sel $dst_unused $src0_…
573 …let AsmSDWA9 = "$vdst, vcc, $src0_modifiers, $src1_modifiers, vcc$clamp $dst_sel $dst_unused $src0…
574 let AsmDPP = "$vdst, vcc, $src0, $src1, vcc $dpp_ctrl$row_mask$bank_mask$bound_ctrl";
575 let AsmDPP8 = "$vdst, vcc, $src0, $src1, vcc $dpp8$fi";
583 // Suppress src2 implied by type since the 32-bit encoding uses an
584 // implicit VCC use.
611 // Read in from vcc or arbitrary SGPR.
614 …let AsmSDWA = "$vdst, $src0_modifiers, $src1_modifiers, vcc$clamp $dst_sel $dst_unused $src0_sel $…
615 …let AsmSDWA9 = "$vdst, $src0_modifiers, $src1_modifiers, vcc$clamp $dst_sel $dst_unused $src0_sel …
616 …let AsmDPP = "$vdst, $src0_modifiers, $src1_modifiers, vcc $dpp_ctrl$row_mask$bank_mask$bound_ctrl…
617 let AsmDPP8 = "$vdst, $src0, $src1, vcc $dpp8$fi";
624 // Suppress src2 implied by type since the 32-bit encoding uses an
625 // implicit VCC use.
712 //===----------------------------------------------------------------------===//
714 //===----------------------------------------------------------------------===//
901 //===----------------------------------------------------------------------===//
902 // 16-Bit Operand Instructions
903 //===----------------------------------------------------------------------===//
950 class LDEXP_F16_Pat <SDPatternOperator op, VOP_Pseudo inst, VOPProfile P = inst.Pfl> : GCNPat <
951 (P.DstVT (op (P.Src0VT (VOP3Mods0 P.Src0VT:$src0, i32:$src0_modifiers, i1:$clamp, i32:$omod)),
952 (i16 (VOP3Mods0 P.Src1VT:$src1, i32:$src1_modifiers)))),
1142 // Note: 16-bit instructions produce a 0 result in the high 16-bits
1185 // Undo sub x, c -> add x, -c canonicalization since c is more likely
1186 // an inline immediate than -c.
1187 // TODO: Also do for 64-bit.
1219 /*src1mod*/(i32 0), /*src1*/(i32 -1), $src)
1232 let AddedComplexity = 1 in { // Prefer over form with carry-out.
1257 //===----------------------------------------------------------------------===//
1259 //===----------------------------------------------------------------------===//
1262 string opName = ps.OpName, VOPProfile p = ps.Pfl,
1264 VOP_DPP<opName, p, IsDPP16> {
1272 let Inst{8-0} = 0xfa;
1273 let Inst{16-9} = !if(p.HasSrc1, src1{7-0}, 0);
1274 let Inst{24-17} = !if(p.EmitDst, vdst{7-0}, 0);
1275 let Inst{30-25} = op;
1280 string opName = ps.OpName, VOPProfile p = ps.Pfl> :
1281 VOP2_DPP<op, ps, opName, p, 1> {
1288 string opName = ps.OpName, VOPProfile p = ps.Pfl> :
1289 Base_VOP2_DPP16<op, ps, opName, p>,
1293 string opName = ps.OpName, VOPProfile p = ps.Pfl> :
1294 VOP2_DPP16<op, ps, Gen.Subtarget, opName, p> {
1302 VOPProfile p = ps.Pfl> :
1303 VOP_DPP8<ps.OpName, p> {
1312 let Inst{8-0} = fi;
1313 let Inst{16-9} = !if(p.HasSrc1, src1{7-0}, 0);
1314 let Inst{24-17} = !if(p.EmitDst, vdst{7-0}, 0);
1315 let Inst{30-25} = op;
1323 VOPProfile p = ps.Pfl> :
1324 VOP2_DPP8<op, ps, p> {
1331 //===----------------------------------------------------------------------===//
1333 //===----------------------------------------------------------------------===//
1335 //===------------------------------- VOP2 -------------------------------===//
1339 VOP2_MADKe<op{5-0}, !cast<VOP2_Pseudo>(NAME).Pfl>;
1346 VOP2_MADKe<op{5-0}, !cast<VOP2_Pseudo>(opName).Pfl> {
1355 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(NAME#"_e32").Pfl>;
1366 VOP3e_gfx11_gfx12<{0, 1, 0, 0, op{5-0}}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>;
1379 //===------------------------- VOP2 (with name) -------------------------===//
1385 VOP2e<op{5-0}, ps.Pfl> {
1395 VOP3e_gfx11_gfx12<{0, 1, 0, 0, op{5-0}}, ps.Pfl> {
1417 //===------------------------------ VOP2be ------------------------------===//
1422 VOP2e<op{5-0}, ps.Pfl> {
1423 let AsmString = asmName # !subst(", vcc", "", ps.AsmOperands);
1431 let AsmString = asmName # !subst(", vcc", "", AsmDPP);
1437 let AsmString = asmName # !subst("vcc", "vcc_lo", AsmDPP);
1459 let AsmString = asmName # !subst(", vcc", "", AsmDPP8);
1465 let AsmString = asmName # !subst("vcc", "vcc_lo", AsmDPP8);
1485 defm NAME : VOP3_Realtriple<Gen, {0, 1, 0, 0, op{5-0}}, /*isSingle=*/ 0, NAME> ;
1490 defm NAME : VOP3_Realtriple_with_name<Gen, {0, 1, 0, 0, op{5-0}}, opName, asmName> ;
1495 VOP3be_Realtriple<Gen, {0, 1, 0, 0, op{5-0}}, /*isSingle=*/ 0, opName, asmName>,
1551 //===----------------------------------------------------------------------===//
1553 //===----------------------------------------------------------------------===//
1613 //===----------------------------------------------------------------------===//
1615 //===----------------------------------------------------------------------===//
1741 //===----------------------------------------------------------------------===//
1743 //===----------------------------------------------------------------------===//
1746 //===------------------------------- VOP2 -------------------------------===//
1750 VOP2_MADKe<op{5-0}, !cast<VOP2_Pseudo>(NAME).Pfl>;
1756 VOP2_MADKe<op{5-0}, !cast<VOP2_Pseudo>(opName).Pfl> {
1764 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(NAME#"_e32").Pfl>;
1769 VOP3e_gfx10<{0, 1, 0, 0, op{5-0}}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>;
1775 VOP2_SDWA9Ae<op{5-0}, !cast<VOP2_SDWA_Pseudo>(NAME#"_sdwa").Pfl>;
1786 //===------------------------- VOP2 (with name) -------------------------===//
1791 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(opName#"_e32").Pfl> {
1800 VOP3e_gfx10<{0, 1, 0, 0, op{5-0}},
1811 VOP2_SDWA9Ae<op{5-0}, !cast<VOP2_SDWA_Pseudo>(opName#"_sdwa").Pfl> {
1833 //===------------------------------ VOP2be ------------------------------===//
1837 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(opName#"_e32").Pfl> {
1839 let AsmString = asmName # !subst(", vcc", "", Ps.AsmOperands);
1845 VOP3be_gfx10<{0, 1, 0, 0, op{5-0}},
1855 VOP2_SDWA9Ae<op{5-0}, !cast<VOP2_SDWA_Pseudo>(opName#"_sdwa").Pfl> {
1857 let AsmString = asmName # !subst(", vcc", "", Ps.AsmOperands);
1862 VOP2_SDWA9Ae<op{5-0}, !cast<VOP2_SDWA_Pseudo>(opName#"_sdwa").Pfl> {
1864 let AsmString = asmName # !subst("vcc", "vcc_lo", Ps.AsmOperands);
1871 VOP2_SDWA9Ae<op{5-0}, !cast<VOP2_SDWA_Pseudo>(opName#"_sdwa").Pfl> {
1883 let AsmString = asmName # !subst(", vcc", "", AsmDPP);
1889 let AsmString = asmName # !subst("vcc", "vcc_lo", AsmDPP);
1907 let AsmString = asmName # !subst(", vcc", "", AsmDPP8);
1913 let AsmString = asmName # !subst("vcc", "vcc_lo", AsmDPP8);
1927 //===----------------------------- VOP3Only -----------------------------===//
1936 //===---------------------------- VOP3beOnly ----------------------------===//
2013 // VOP2 no carry-in, carry-out.
2021 // VOP2 carry-in, carry-out.
2043 // VOP3 carry-out.
2059 //===----------------------------------------------------------------------===//
2061 //===----------------------------------------------------------------------===//
2063 class VOP2_DPPe <bits<6> op, VOP2_DPP_Pseudo ps, VOPProfile P = ps.Pfl> :
2064 VOP_DPPe <P> {
2067 let Inst{8-0} = 0xfa; //dpp
2068 let Inst{16-9} = !if(P.HasSrc1, src1{7-0}, 0);
2069 let Inst{24-17} = !if(P.EmitDst, vdst{7-0}, 0);
2070 let Inst{30-25} = op;
2078 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(NAME).Pfl>;
2083 VOP2_MADKe<op{5-0}, !cast<VOP2_Pseudo>(NAME).Pfl>;
2088 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(opName#"_e32").Pfl>;
2093 VOP3e_gfx6_gfx7<{1, 0, 0, op{5-0}}, !cast<VOP3_Pseudo>(opName#"_e64").Pfl>;
2098 VOP3be_gfx6_gfx7<{1, 0, 0, op{5-0}}, !cast<VOP3_Pseudo>(opName#"_e64").Pfl>;
2204 //===----------------------------------------------------------------------===//
2206 //===----------------------------------------------------------------------===//
2212 VOP2_MADKe<op{5-0}, !cast<VOP2_Pseudo>(NAME).Pfl>;
2217 VOP2_MADKe<op{5-0}, !cast<VOP2_Pseudo>(NAME).Pfl> {
2225 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(NAME#"_e32").Pfl>;
2244 VOP2_Real_e64_vi<{0, 1, 0, 0, op{5-0}}>;
2252 VOP2_SDWAe <op{5-0}, !cast<VOP2_SDWA_Pseudo>(NAME#"_sdwa").Pfl>;
2259 VOP2_SDWA9Ae <op{5-0}, !cast<VOP2_SDWA_Pseudo>(NAME#"_sdwa").Pfl>;
2267 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(OpName#"_e32").Pfl> {
2273 VOP3be_vi <{0, 1, 0, 0, op{5-0}}, !cast<VOP3_Pseudo>(OpName#"_e64").Pfl> {
2280 VOP2_SDWAe <op{5-0}, !cast<VOP2_SDWA_Pseudo>(OpName#"_sdwa").Pfl> {
2300 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(OpName#"_e32").Pfl> {
2306 VOP3be_vi <{0, 1, 0, 0, op{5-0}}, !cast<VOP3_Pseudo>(OpName#"_e64").Pfl> {
2313 VOP2_SDWA9Ae <op{5-0}, !cast<VOP2_SDWA_Pseudo>(OpName#"_sdwa").Pfl> {
2329 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(NAME#"_e32").Pfl>;
2332 VOP3e_vi <{0, 1, 0, 0, op{5-0}}, !cast<VOP3_Pseudo>(NAME#"_e64").Pfl>;
2336 VOP2_SDWA9Ae <op{5-0}, !cast<VOP2_SDWA_Pseudo>(NAME#"_sdwa").Pfl> {
2436 // Aliases to simplify matching of floating-point instructions that
2480 VOP2e<op{5-0}, !cast<VOP2_Pseudo>(NAME#"_e32").Pfl>;
2491 VOP2_Real_e64_gfx90a<{0, 1, 0, 0, op{5-0}}>;