[Mesa-dev] [PATCH 12/12] R600/SI: Add pattern to simplify i64 loading

Christian König deathsimple at vodafone.de
Thu Feb 14 09:34:25 PST 2013


From: Christian König <christian.koenig at amd.com>

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 lib/Target/R600/SIInstrInfo.td    |    4 ++++
 lib/Target/R600/SIInstructions.td |    5 +++++
 2 files changed, 9 insertions(+)

diff --git a/lib/Target/R600/SIInstrInfo.td b/lib/Target/R600/SIInstrInfo.td
index efc6015..8c4e5af 100644
--- a/lib/Target/R600/SIInstrInfo.td
+++ b/lib/Target/R600/SIInstrInfo.td
@@ -40,6 +40,10 @@ def IMM12bit : ImmLeaf <
   [{return isUInt<12>(Imm);}]
 >;
 
+class InlineImm <ValueType vt> : ImmLeaf <vt, [{
+  return -16 <= Imm && Imm <= 64;
+}]>;
+
 class InstSI <dag outs, dag ins, string asm, list<dag> pattern> :
     AMDGPUInst<outs, ins, asm, pattern> {
 
diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
index 9838567..7a30d8d 100644
--- a/lib/Target/R600/SIInstructions.td
+++ b/lib/Target/R600/SIInstructions.td
@@ -1290,6 +1290,11 @@ def : Pat <
   (S_MOV_B32 fpimm:$imm)
 >;
 
+def : Pat <
+  (i64 InlineImm<i64>:$imm),
+  (S_MOV_B64 InlineImm<i64>:$imm)
+>;
+
 // i64 immediates aren't supported in hardware, split it into two 32bit values
 def : Pat <
   (i64 imm:$imm),
-- 
1.7.10.4



More information about the mesa-dev mailing list