diff options
Diffstat (limited to 'lib/Target/AMDGPU/SIInstrFormats.td')
| -rw-r--r-- | lib/Target/AMDGPU/SIInstrFormats.td | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/lib/Target/AMDGPU/SIInstrFormats.td b/lib/Target/AMDGPU/SIInstrFormats.td index 02c9b4b1f0ee..25917cc06e6a 100644 --- a/lib/Target/AMDGPU/SIInstrFormats.td +++ b/lib/Target/AMDGPU/SIInstrFormats.td @@ -11,9 +11,18 @@ // //===----------------------------------------------------------------------===// +def isGCN : Predicate<"Subtarget->getGeneration() " + ">= SISubtarget::SOUTHERN_ISLANDS">, + AssemblerPredicate<"FeatureGCN">; +def isSI : Predicate<"Subtarget->getGeneration() " + "== SISubtarget::SOUTHERN_ISLANDS">, + AssemblerPredicate<"FeatureSouthernIslands">; + + class InstSI <dag outs, dag ins, string asm = "", list<dag> pattern = []> : AMDGPUInst<outs, ins, asm, pattern>, PredicateControl { + let SubtargetPredicate = isGCN; // Low bits - basic encoding information. field bit SALU = 0; @@ -45,7 +54,7 @@ class InstSI <dag outs, dag ins, string asm = "", field bit FLAT = 0; field bit DS = 0; - // Pseudo instruction formats. + // Pseudo instruction formats. field bit VGPRSpill = 0; field bit SGPRSpill = 0; @@ -79,10 +88,36 @@ class InstSI <dag outs, dag ins, string asm = "", // is unable to infer the encoding from the operands. field bit VOPAsmPrefer32Bit = 0; + // This bit indicates that this is a VOP3 opcode which supports op_sel + // modifier (gfx9 only). + field bit VOP3_OPSEL = 0; + + // Is it possible for this instruction to be atomic? + field bit maybeAtomic = 0; + + // This bit indicates that this is a VI instruction which is renamed + // in GFX9. Required for correct mapping from pseudo to MC. + field bit renamedInGFX9 = 0; + // This bit indicates that this has a floating point result type, so // the clamp modifier has floating point semantics. field bit FPClamp = 0; + // This bit indicates that instruction may support integer clamping + // which depends on GPU features. + field bit IntClamp = 0; + + // This field indicates that the clamp applies to the low component + // of a packed output register. + field bit ClampLo = 0; + + // This field indicates that the clamp applies to the high component + // of a packed output register. + field bit ClampHi = 0; + + // This bit indicates that this is a packed VOP3P instruction + field bit IsPacked = 0; + // These need to be kept in sync with the enum in SIInstrFlags. let TSFlags{0} = SALU; let TSFlags{1} = VALU; @@ -126,7 +161,17 @@ class InstSI <dag outs, dag ins, string asm = "", let TSFlags{39} = ScalarStore; let TSFlags{40} = FixedSize; let TSFlags{41} = VOPAsmPrefer32Bit; - let TSFlags{42} = FPClamp; + let TSFlags{42} = VOP3_OPSEL; + + let TSFlags{43} = maybeAtomic; + let TSFlags{44} = renamedInGFX9; + + let TSFlags{45} = FPClamp; + let TSFlags{46} = IntClamp; + let TSFlags{47} = ClampLo; + let TSFlags{48} = ClampHi; + + let TSFlags{49} = IsPacked; let SchedRW = [Write32Bit]; |
