Index: llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td @@ -19,17 +19,28 @@ let OperandType = "OPERAND_IMMEDIATE"; } +class SOP_Pseudo pattern=[]> : + InstSI, + SIMCInstr { + + let isPseudo = 1; + let isCodeGenOnly = 1; + let SubtargetPredicate = isGCN; + + string Mnemonic = opName; + string AsmOperands = asmOps; + + bits<1> has_sdst = 0; +} + //===----------------------------------------------------------------------===// // SOP1 Instructions //===----------------------------------------------------------------------===// class SOP1_Pseudo pattern=[]> : - InstSI , - SIMCInstr { - let isPseudo = 1; - let isCodeGenOnly = 1; - let SubtargetPredicate = isGCN; + SOP_Pseudo { let mayLoad = 0; let mayStore = 0; @@ -40,9 +51,6 @@ let Size = 4; let UseNamedOperandTable = 1; - string Mnemonic = opName; - string AsmOperands = asmOps; - bits<1> has_src0 = 1; bits<1> has_sdst = 1; } @@ -253,11 +261,8 @@ class SOP2_Pseudo pattern=[]> : - InstSI, - SIMCInstr { - let isPseudo = 1; - let isCodeGenOnly = 1; - let SubtargetPredicate = isGCN; + SOP_Pseudo { + let mayLoad = 0; let mayStore = 0; let hasSideEffects = 0; @@ -266,10 +271,7 @@ let SchedRW = [WriteSALU]; let UseNamedOperandTable = 1; - string Mnemonic = opName; - string AsmOperands = asmOps; - - bits<1> has_sdst = 1; + let has_sdst = 1; // Pseudo instructions have no encodings, but adding this field here allows // us to do: @@ -279,7 +281,7 @@ // let Size = 4; // Do we need size here? } -class SOP2_Real op, SOP2_Pseudo ps> : +class SOP2_Real op, SOP_Pseudo ps> : InstSI , Enc32 { Index: llvm/trunk/lib/Target/AMDGPU/VOP1Instructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/VOP1Instructions.td +++ llvm/trunk/lib/Target/AMDGPU/VOP1Instructions.td @@ -40,17 +40,9 @@ } class VOP1_Pseudo pattern=[], bit VOP1Only = 0> : - InstSI , - VOP , - SIMCInstr , - MnemonicAlias { + VOP_Pseudo { - let isPseudo = 1; - let isCodeGenOnly = 1; - let UseNamedOperandTable = 1; - - string Mnemonic = opName; - string AsmOperands = P.Asm32; + let AsmOperands = P.Asm32; let Size = 4; let mayLoad = 0; @@ -63,8 +55,6 @@ let Uses = [EXEC]; let AsmVariantName = AMDGPUAsmVariants.Default; - - VOPProfile Pfl = P; } class VOP1_Real : Index: llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td +++ llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td @@ -61,17 +61,9 @@ } class VOP2_Pseudo pattern=[], string suffix = "_e32"> : - InstSI , - VOP , - SIMCInstr , - MnemonicAlias { - - let isPseudo = 1; - let isCodeGenOnly = 1; - let UseNamedOperandTable = 1; + VOP_Pseudo { - string Mnemonic = opName; - string AsmOperands = P.Asm32; + let AsmOperands = P.Asm32; let Size = 4; let mayLoad = 0; @@ -84,8 +76,6 @@ let Uses = [EXEC]; let AsmVariantName = AMDGPUAsmVariants.Default; - - VOPProfile Pfl = P; } class VOP2_Real : Index: llvm/trunk/lib/Target/AMDGPU/VOP3Instructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/VOP3Instructions.td +++ llvm/trunk/lib/Target/AMDGPU/VOP3Instructions.td @@ -718,9 +718,9 @@ } multiclass VOP3_Real_gfx9 op, string AsmName> { - def _gfx9 : VOP3_Real(NAME), SIEncodingFamily.GFX9>, - VOP3e_vi (NAME).Pfl> { - VOP3_Pseudo ps = !cast(NAME); + def _gfx9 : VOP3_Real(NAME), SIEncodingFamily.GFX9>, + VOP3e_vi (NAME).Pfl> { + VOP_Pseudo ps = !cast(NAME); let AsmString = AsmName # ps.AsmOperands; } } Index: llvm/trunk/lib/Target/AMDGPU/VOP3PInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/VOP3PInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/VOP3PInstructions.td @@ -144,8 +144,8 @@ } // End SubtargetPredicate = [HasMadMixInsts] multiclass VOP3P_Real_vi op> { - def _vi : VOP3P_Real(NAME), SIEncodingFamily.VI>, - VOP3Pe (NAME).Pfl> { + def _vi : VOP3P_Real(NAME), SIEncodingFamily.VI>, + VOP3Pe (NAME).Pfl> { let AssemblerPredicates = [HasVOP3PInsts]; let DecoderNamespace = "VI"; } Index: llvm/trunk/lib/Target/AMDGPU/VOPInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/VOPInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/VOPInstructions.td @@ -38,6 +38,23 @@ let Uses = [EXEC]; } +class VOP_Pseudo pattern> : + InstSI , + VOP , + SIMCInstr , + MnemonicAlias { + + let isPseudo = 1; + let isCodeGenOnly = 1; + let UseNamedOperandTable = 1; + + string Mnemonic = opName; + VOPProfile Pfl = P; + + string AsmOperands; +} + class VOP3Common pattern = [], bit HasMods = 0, bit VOP3Only = 0> : @@ -66,26 +83,18 @@ class VOP3_Pseudo pattern = [], bit VOP3Only = 0, bit isVOP3P = 0, bit isVop3OpSel = 0> : - InstSI , - VOP , - SIMCInstr, - MnemonicAlias { + VOP_Pseudo { - 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 @@ !if(!or(P.HasModifiers, !or(P.HasOMod, P.HasIntClamp)), "cvtVOP3", "")); - - VOPProfile Pfl = P; } class VOP3P_Pseudo pattern = []> : @@ -129,7 +136,7 @@ let VOP3P = 1; } -class VOP3_Real : +class VOP3_Real : InstSI , SIMCInstr { @@ -156,7 +163,7 @@ // XXX - Is there any reason to distingusih this from regular VOP3 // here? -class VOP3P_Real : +class VOP3P_Real : VOP3_Real; class VOP3a : Enc64 {