diff options
Diffstat (limited to 'contrib/llvm/lib/Target/AMDGPU/VOPInstructions.td')
-rw-r--r-- | contrib/llvm/lib/Target/AMDGPU/VOPInstructions.td | 64 |
1 files changed, 36 insertions, 28 deletions
diff --git a/contrib/llvm/lib/Target/AMDGPU/VOPInstructions.td b/contrib/llvm/lib/Target/AMDGPU/VOPInstructions.td index f24ff5ce8dea..f0f7f259f71d 100644 --- a/contrib/llvm/lib/Target/AMDGPU/VOPInstructions.td +++ b/contrib/llvm/lib/Target/AMDGPU/VOPInstructions.td @@ -38,6 +38,23 @@ class VOPAnyCommon <dag outs, dag ins, string asm, list<dag> pattern> : let Uses = [EXEC]; } +class VOP_Pseudo <string opName, string suffix, VOPProfile P, dag outs, dag ins, + string asm, list<dag> pattern> : + InstSI <outs, ins, asm, pattern>, + VOP <opName>, + SIMCInstr <opName#suffix, SIEncodingFamily.NONE>, + MnemonicAlias<opName#suffix, opName> { + + let isPseudo = 1; + let isCodeGenOnly = 1; + let UseNamedOperandTable = 1; + + string Mnemonic = opName; + VOPProfile Pfl = P; + + string AsmOperands; +} + class VOP3Common <dag outs, dag ins, string asm = "", list<dag> pattern = [], bit HasMods = 0, bit VOP3Only = 0> : @@ -66,26 +83,18 @@ class VOP3Common <dag outs, dag ins, string asm = "", class VOP3_Pseudo <string opName, VOPProfile P, list<dag> pattern = [], bit VOP3Only = 0, bit isVOP3P = 0, bit isVop3OpSel = 0> : - InstSI <P.Outs64, - !if(isVop3OpSel, - P.InsVOP3OpSel, - !if(!and(isVOP3P, P.IsPacked), P.InsVOP3P, P.Ins64)), - "", - pattern>, - VOP <opName>, - SIMCInstr<opName#"_e64", SIEncodingFamily.NONE>, - MnemonicAlias<opName#"_e64", opName> { + VOP_Pseudo <opName, "_e64", P, P.Outs64, + !if(isVop3OpSel, + P.InsVOP3OpSel, + !if(!and(isVOP3P, P.IsPacked), P.InsVOP3P, P.Ins64)), + "", pattern> { - let isPseudo = 1; - let isCodeGenOnly = 1; - let UseNamedOperandTable = 1; let VOP3_OPSEL = isVop3OpSel; let IsPacked = P.IsPacked; - string Mnemonic = opName; - string AsmOperands = !if(isVop3OpSel, - P.AsmVOP3OpSel, - !if(!and(isVOP3P, P.IsPacked), P.AsmVOP3P, P.Asm64)); + let AsmOperands = !if(isVop3OpSel, + P.AsmVOP3OpSel, + !if(!and(isVOP3P, P.IsPacked), P.AsmVOP3P, P.Asm64)); let Size = 8; let mayLoad = 0; @@ -120,8 +129,6 @@ class VOP3_Pseudo <string opName, VOPProfile P, list<dag> pattern = [], !if(!or(P.HasModifiers, !or(P.HasOMod, P.HasIntClamp)), "cvtVOP3", "")); - - VOPProfile Pfl = P; } class VOP3P_Pseudo <string opName, VOPProfile P, list<dag> pattern = []> : @@ -129,7 +136,7 @@ class VOP3P_Pseudo <string opName, VOPProfile P, list<dag> pattern = []> : let VOP3P = 1; } -class VOP3_Real <VOP3_Pseudo ps, int EncodingFamily> : +class VOP3_Real <VOP_Pseudo ps, int EncodingFamily> : InstSI <ps.OutOperandList, ps.InOperandList, ps.Mnemonic # ps.AsmOperands, []>, SIMCInstr <ps.PseudoInstr, EncodingFamily> { @@ -149,13 +156,14 @@ class VOP3_Real <VOP3_Pseudo ps, int EncodingFamily> : let TSFlags = ps.TSFlags; let UseNamedOperandTable = ps.UseNamedOperandTable; let Uses = ps.Uses; + let Defs = ps.Defs; VOPProfile Pfl = ps.Pfl; } // XXX - Is there any reason to distingusih this from regular VOP3 // here? -class VOP3P_Real<VOP3P_Pseudo ps, int EncodingFamily> : +class VOP3P_Real<VOP_Pseudo ps, int EncodingFamily> : VOP3_Real<ps, EncodingFamily>; class VOP3a<VOPProfile P> : Enc64 { @@ -324,13 +332,13 @@ class VOP_SDWAe<VOPProfile P> : Enc64 { bits<1> clamp; let Inst{39-32} = !if(P.HasSrc0, src0{7-0}, 0); - let Inst{42-40} = !if(P.EmitDst, dst_sel{2-0}, SDWA.DWORD); - let Inst{44-43} = !if(P.EmitDst, dst_unused{1-0}, SDWA.UNUSED_PRESERVE); + let Inst{42-40} = !if(P.EmitDst, dst_sel{2-0}, 0); + let Inst{44-43} = !if(P.EmitDst, dst_unused{1-0}, 0); let Inst{45} = !if(P.HasSDWAClamp, clamp{0}, 0); - let Inst{50-48} = !if(P.HasSrc0, src0_sel{2-0}, SDWA.DWORD); + let Inst{50-48} = !if(P.HasSrc0, src0_sel{2-0}, 0); let Inst{51} = !if(P.HasSrc0IntMods, src0_modifiers{0}, 0); let Inst{53-52} = !if(P.HasSrc0FloatMods, src0_modifiers{1-0}, 0); - let Inst{58-56} = !if(P.HasSrc1, src1_sel{2-0}, SDWA.DWORD); + let Inst{58-56} = !if(P.HasSrc1, src1_sel{2-0}, 0); let Inst{59} = !if(P.HasSrc1IntMods, src1_modifiers{0}, 0); let Inst{61-60} = !if(P.HasSrc1FloatMods, src1_modifiers{1-0}, 0); } @@ -358,11 +366,11 @@ class VOP_SDWA9e<VOPProfile P> : Enc64 { bits<1> src1_sgpr; let Inst{39-32} = !if(P.HasSrc0, src0{7-0}, 0); - let Inst{50-48} = !if(P.HasSrc0, src0_sel{2-0}, SDWA.DWORD); + let Inst{50-48} = !if(P.HasSrc0, src0_sel{2-0}, 0); let Inst{51} = !if(P.HasSrc0IntMods, src0_modifiers{0}, 0); let Inst{53-52} = !if(P.HasSrc0FloatMods, src0_modifiers{1-0}, 0); let Inst{55} = !if(P.HasSrc0, src0{8}, 0); - let Inst{58-56} = !if(P.HasSrc1, src1_sel{2-0}, SDWA.DWORD); + let Inst{58-56} = !if(P.HasSrc1, src1_sel{2-0}, 0); let Inst{59} = !if(P.HasSrc1IntMods, src1_modifiers{0}, 0); let Inst{61-60} = !if(P.HasSrc1FloatMods, src1_modifiers{1-0}, 0); let Inst{63} = 0; // src1_sgpr - should be specified in subclass @@ -375,8 +383,8 @@ class VOP_SDWA9Ae<VOPProfile P> : VOP_SDWA9e<P> { bits<1> clamp; bits<2> omod; - let Inst{42-40} = !if(P.EmitDst, dst_sel{2-0}, SDWA.DWORD); - let Inst{44-43} = !if(P.EmitDst, dst_unused{1-0}, SDWA.UNUSED_PRESERVE); + let Inst{42-40} = !if(P.EmitDst, dst_sel{2-0}, 0); + let Inst{44-43} = !if(P.EmitDst, dst_unused{1-0}, 0); let Inst{45} = !if(P.HasSDWAClamp, clamp{0}, 0); let Inst{47-46} = !if(P.HasSDWAOMod, omod{1-0}, 0); } |