diff --git a/llvm/lib/Target/R600/SIInstrFormats.td b/llvm/lib/Target/R600/SIInstrFormats.td index c1fc4b3a9741..333f6a1cc283 100644 --- a/llvm/lib/Target/R600/SIInstrFormats.td +++ b/llvm/lib/Target/R600/SIInstrFormats.td @@ -206,8 +206,8 @@ class SOPP op, dag ins, string asm, list pattern> : let UseNamedOperandTable = 1; } -class SMRD op, bits<1> imm, dag outs, dag ins, string asm, - list pattern> : InstSI, SMRDe { +class SMRD pattern> : + InstSI { let LGKM_CNT = 1; let SMRD = 1; diff --git a/llvm/lib/Target/R600/SIInstrInfo.td b/llvm/lib/Target/R600/SIInstrInfo.td index 6b7da98e4bcc..8cb9e1c92289 100644 --- a/llvm/lib/Target/R600/SIInstrInfo.td +++ b/llvm/lib/Target/R600/SIInstrInfo.td @@ -250,6 +250,11 @@ def DSTOMOD { // //===----------------------------------------------------------------------===// +class SIMCInstr { + string PseudoInstr = pseudo; + int Subtarget = subtarget; +} + //===----------------------------------------------------------------------===// // Scalar classes //===----------------------------------------------------------------------===// @@ -307,18 +312,43 @@ class SOPK_64 op, string opName, list pattern> : SOPK < opName#" $dst, $src0", pattern >; -multiclass SMRD_Helper op, string asm, RegisterClass baseClass, +//===----------------------------------------------------------------------===// +// SMRD classes +//===----------------------------------------------------------------------===// + +class SMRD_Pseudo pattern> : + SMRD , + SIMCInstr { + let isPseudo = 1; +} + +class SMRD_Real_si op, string opName, bit imm, dag outs, dag ins, + string asm> : + SMRD , + SMRDe , + SIMCInstr; + +multiclass SMRD_m op, string opName, bit imm, dag outs, dag ins, + string asm, list pattern> { + + def "" : SMRD_Pseudo ; + + def _si : SMRD_Real_si ; + +} + +multiclass SMRD_Helper op, string opName, RegisterClass baseClass, RegisterClass dstClass> { - def _IMM : SMRD < - op, 1, (outs dstClass:$dst), + defm _IMM : SMRD_m < + op, opName#"_IMM", 1, (outs dstClass:$dst), (ins baseClass:$sbase, u32imm:$offset), - asm#" $dst, $sbase, $offset", [] + opName#" $dst, $sbase, $offset", [] >; - def _SGPR : SMRD < - op, 0, (outs dstClass:$dst), + defm _SGPR : SMRD_m < + op, opName#"_SGPR", 0, (outs dstClass:$dst), (ins baseClass:$sbase, SReg_32:$soff), - asm#" $dst, $sbase, $soff", [] + opName#" $dst, $sbase, $soff", [] >; } @@ -531,11 +561,6 @@ class AtomicNoRet { bit IsRet = isRet; } -class SIMCInstr { - string PseudoInstr = pseudo; - int Subtarget = subtarget; -} - class VOP3DisableFields { bits<2> src0_modifiers = !if(HasModifiers, ?, 0);