Skip to content

Commit 20aba40

Browse files
committed
replace opsel profile to vop3base
1 parent 2680afb commit 20aba40

File tree

3 files changed

+5
-55
lines changed

3 files changed

+5
-55
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.td

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,41 +2242,6 @@ class getAsmVOP3P <bit HasDst, int NumSrcArgs, bit HasNeg,
22422242
string ret = dst#src0#src1#src2#opsel#mods#clamp;
22432243
}
22442244

2245-
// FIXME-TRUE16 AsmVOP3OpSel will be deprecated after all
2246-
// VOP3 16 bit instructions are replaced to true16 format
2247-
class getAsmVOP3OpSel <int NumSrcArgs,
2248-
bit HasClamp,
2249-
bit HasOMod,
2250-
bit Src0HasMods,
2251-
bit Src1HasMods,
2252-
bit Src2HasMods,
2253-
bit HasByteSel = 0,
2254-
bit HasBitOp3 = 0> {
2255-
string dst = "$vdst";
2256-
2257-
string isrc0 = !if(!eq(NumSrcArgs, 1), "$src0", "$src0,");
2258-
string isrc1 = !if(!eq(NumSrcArgs, 1), "",
2259-
!if(!eq(NumSrcArgs, 2), " $src1",
2260-
" $src1,"));
2261-
string isrc2 = !if(!eq(NumSrcArgs, 3), " $src2", "");
2262-
2263-
string fsrc0 = !if(!eq(NumSrcArgs, 1), "$src0_modifiers", "$src0_modifiers,");
2264-
string fsrc1 = !if(!eq(NumSrcArgs, 1), "",
2265-
!if(!eq(NumSrcArgs, 2), " $src1_modifiers",
2266-
" $src1_modifiers,"));
2267-
string fsrc2 = !if(!eq(NumSrcArgs, 3), " $src2_modifiers", "");
2268-
2269-
string src0 = !if(Src0HasMods, fsrc0, isrc0);
2270-
string src1 = !if(Src1HasMods, fsrc1, isrc1);
2271-
string src2 = !if(Src2HasMods, fsrc2, isrc2);
2272-
2273-
string bytesel = !if(HasByteSel, "$byte_sel", "");
2274-
string clamp = !if(HasClamp, "$clamp", "");
2275-
string omod = !if(HasOMod, "$omod", "");
2276-
string bitop3 = !if(HasBitOp3, "$bitop3", "");
2277-
string ret = dst#", "#src0#src1#src2#bitop3#"$op_sel"#bytesel#clamp#omod;
2278-
}
2279-
22802245
class getAsmDPP <bit HasDst, int NumSrcArgs, bit HasModifiers, ValueType DstVT = i32> {
22812246
string dst = !if(HasDst,
22822247
!if(!eq(DstVT.Size, 1),
@@ -2687,14 +2652,7 @@ class VOPProfile <list<ValueType> _ArgVT, bit _EnableClamp = 0> {
26872652
HasSrc2Mods, DstVT, HasFP8ByteSel, HasBitOp3>.ret;
26882653
field string Asm64 = AsmVOP3Base;
26892654
field string AsmVOP3P = getAsmVOP3P<HasDst, NumSrcArgs, HasNeg, HasClamp, HasOpSel>.ret;
2690-
field string AsmVOP3OpSel = getAsmVOP3OpSel<NumSrcArgs,
2691-
HasClamp,
2692-
HasOMod,
2693-
HasSrc0FloatMods,
2694-
HasSrc1FloatMods,
2695-
HasSrc2FloatMods,
2696-
HasFP8ByteSel,
2697-
HasBitOp3>.ret;
2655+
field string AsmVOP3OpSel = AsmVOP3Base;
26982656
field string AsmVOP3DPP = getAsmVOP3DPP<AsmVOP3Base>.ret;
26992657
field string AsmVOP3DPP16 = getAsmVOP3DPP16<AsmVOP3Base>.ret;
27002658
field string AsmVOP3DPP8 = getAsmVOP3DPP8<AsmVOP3Base>.ret;

llvm/lib/Target/AMDGPU/VOP3Instructions.td

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,6 @@ def VOP3_CVT_SR_F8_F32_Profile : VOP3_Profile<VOPProfile<[i32, f32, i32, f32]>,
626626
let HasOpSel = 1;
627627
let HasFP8DstByteSel = 1;
628628
let HasFP8ByteSel = 0; // It works as a dst-bytesel, but does not have byte_sel operand.
629-
let AsmVOP3OpSel = !subst(", $src2_modifiers", "",
630-
getAsmVOP3OpSel<3, HasClamp, HasOMod,
631-
HasSrc0FloatMods, HasSrc1FloatMods,
632-
HasSrc2FloatMods>.ret);
633629
let AsmVOP3Base = !subst(", $src2_modifiers", "",
634630
getAsmVOP3Base<NumSrcArgs, HasDst, HasClamp,
635631
HasOpSel, HasOMod, IsVOP3P, HasModifiers, HasModifiers, 0/*Src1Mods*/,
@@ -1066,12 +1062,10 @@ class VOP3_CVT_SCALE_FP4_F16BF16_TiedInput_Profile<VOPProfile P> : VOP3_Profile<
10661062
let HasSrc2 = 0;
10671063
let HasSrc2Mods = 1;
10681064
let HasOpSel = 1;
1069-
let AsmVOP3OpSel = !subst(", $src2_modifiers", "",
1070-
getAsmVOP3OpSel<3, HasClamp, HasOMod,
1071-
HasSrc0FloatMods, HasSrc1FloatMods,
1072-
HasSrc2FloatMods>.ret);
1065+
let Asm64 = !subst(", $src2_modifiers", "", AsmVOP3Base);
10731066
let HasExtVOP3DPP = 0;
10741067
let HasFP8DstByteSel = 1;
1068+
let HasFP8ByteSel = 0;
10751069
}
10761070

10771071
class VOP3_CVT_SCALE_SR_PK_F4_F16BF16_TiedInput_Profile<ValueType Src0Ty> :

llvm/lib/Target/AMDGPU/VOPInstructions.td

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ class VOP3_Pseudo <string opName, VOPProfile P, list<dag> pattern = [],
112112
bit HasFP8DstByteSel = P.HasFP8DstByteSel;
113113
bit HasFP4DstByteSel = P.HasFP4DstByteSel;
114114

115-
let AsmOperands = !if(!and(!not(P.IsTrue16), isVop3OpSel),
116-
P.AsmVOP3OpSel,
117-
!if(!and(isVOP3P, P.IsPacked), P.AsmVOP3P, P.Asm64));
115+
let AsmOperands = !if(!and(isVOP3P, P.IsPacked), P.AsmVOP3P, P.Asm64);
118116

119117
let Size = 8;
120118
let mayLoad = 0;
@@ -1484,7 +1482,7 @@ class VOP3_Profile_Base<VOPProfile P, VOP3Features Features = VOP3_REGULAR> : VO
14841482

14851483
let HasModifiers =
14861484
!if (Features.IsMAI, 0,
1487-
!or(Features.IsPacked, Features.HasOpSel, P.HasModifiers));
1485+
!or(Features.IsPacked, P.HasModifiers));
14881486
}
14891487

14901488
class VOP3_Profile<VOPProfile P, VOP3Features Features = VOP3_REGULAR> : VOP3_Profile_Base<P, Features> {

0 commit comments

Comments
 (0)