R600/SI: Add isMUBUF / isMTBUF
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 29 Jul 2014 18:51:56 +0000 (18:51 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 29 Jul 2014 18:51:56 +0000 (18:51 +0000)
Also add missing comments about how the flags work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214195 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/R600/SIDefines.h
lib/Target/R600/SIInstrFormats.td
lib/Target/R600/SIInstrInfo.cpp
lib/Target/R600/SIInstrInfo.h

index b7e7a2d000b377f2f5778fcc9e47393663ba94d0..6ae580c8614068d5481229309ab761eb1c9d74b5 100644 (file)
@@ -12,6 +12,7 @@
 #define SIDEFINES_H_
 
 namespace SIInstrFlags {
+// This needs to be kept in sync with the field bits in InstSI.
 enum {
   MIMG = 1 << 3,
   SMRD = 1 << 4,
@@ -19,7 +20,9 @@ enum {
   VOP2 = 1 << 6,
   VOP3 = 1 << 7,
   VOPC = 1 << 8,
-  SALU = 1 << 9
+  SALU = 1 << 9,
+  MUBUF = 1 << 10,
+  MTBUF = 1 << 11
 };
 }
 
index d7b593d4a60053decb50f3f0c06baffc913c09da..a2d8ee67c3ed839ebe61201aed4735b8ed3f1f30 100644 (file)
@@ -24,7 +24,10 @@ class InstSI <dag outs, dag ins, string asm, list<dag> pattern> :
   field bits<1> VOP3 = 0;
   field bits<1> VOPC = 0;
   field bits<1> SALU = 0;
+  field bits<1> MUBUF = 0;
+  field bits<1> MTBUF = 0;
 
+  // These need to be kept in sync with the enum in SIInstrFlags.
   let TSFlags{0} = VM_CNT;
   let TSFlags{1} = EXP_CNT;
   let TSFlags{2} = LGKM_CNT;
@@ -35,6 +38,8 @@ class InstSI <dag outs, dag ins, string asm, list<dag> pattern> :
   let TSFlags{7} = VOP3;
   let TSFlags{8} = VOPC;
   let TSFlags{9} = SALU;
+  let TSFlags{10} = MUBUF;
+  let TSFlags{11} = MTBUF;
 }
 
 class Enc32 {
@@ -503,6 +508,7 @@ class MUBUF <bits<7> op, dag outs, dag ins, string asm, list<dag> pattern> :
 
   let VM_CNT = 1;
   let EXP_CNT = 1;
+  let MUBUF = 1;
 
   let neverHasSideEffects = 1;
   let UseNamedOperandTable = 1;
@@ -513,6 +519,7 @@ class MTBUF <bits<3> op, dag outs, dag ins, string asm, list<dag> pattern> :
 
   let VM_CNT = 1;
   let EXP_CNT = 1;
+  let MTBUF = 1;
 
   let neverHasSideEffects = 1;
 }
index 872b7cef859744c02cae6aae570d7b720e41aa3d..0bd54ec33700d7dbcf825e1f6095402e75eee437 100644 (file)
@@ -483,6 +483,14 @@ bool SIInstrInfo::isSMRD(uint16_t Opcode) const {
   return get(Opcode).TSFlags & SIInstrFlags::SMRD;
 }
 
+bool SIInstrInfo::isMUBUF(uint16_t Opcode) const {
+  return get(Opcode).TSFlags & SIInstrFlags::MUBUF;
+}
+
+bool SIInstrInfo::isMTBUF(uint16_t Opcode) const {
+  return get(Opcode).TSFlags & SIInstrFlags::MTBUF;
+}
+
 bool SIInstrInfo::isVOP1(uint16_t Opcode) const {
   return get(Opcode).TSFlags & SIInstrFlags::VOP1;
 }
index 914138bfb6a1fecd1141a9588d15d3145b1bf72b..5b9b5a59126ea3f6e9694ad2abf3d906f3edb870 100644 (file)
@@ -98,6 +98,8 @@ public:
   bool isDS(uint16_t Opcode) const;
   bool isMIMG(uint16_t Opcode) const;
   bool isSMRD(uint16_t Opcode) const;
+  bool isMUBUF(uint16_t Opcode) const;
+  bool isMTBUF(uint16_t Opcode) const;
   bool isVOP1(uint16_t Opcode) const;
   bool isVOP2(uint16_t Opcode) const;
   bool isVOP3(uint16_t Opcode) const;