Mesa (master): radeon/llvm: Move SMRD IMM pattern before SMRD SGPR pattern

Tom Stellard tstellar at kemper.freedesktop.org
Tue Jul 31 20:38:42 UTC 2012


Module: Mesa
Branch: master
Commit: 056b77ca22a3e7a2e24a32941daf65313f604042
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=056b77ca22a3e7a2e24a32941daf65313f604042

Author: Tom Stellard <thomas.stellard at amd.com>
Date:   Tue Jul 31 16:42:15 2012 +0000

radeon/llvm: Move SMRD IMM pattern before SMRD SGPR pattern

In tablegen, if two patterns match, the one that comes first in the file
is given preference.  We want the SMRD IMM pattern to be given
preference, because it encodes the pointer offset in its immediate
field, which saves us an add instruction.

---

 src/gallium/drivers/radeon/SIInstrInfo.td |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/radeon/SIInstrInfo.td b/src/gallium/drivers/radeon/SIInstrInfo.td
index 78b1a37..36496f0 100644
--- a/src/gallium/drivers/radeon/SIInstrInfo.td
+++ b/src/gallium/drivers/radeon/SIInstrInfo.td
@@ -475,21 +475,20 @@ class MTBUF_Store_Helper <bits<3> op, string asm, RegisterClass regClass> : MTBU
 
 multiclass SMRD_Helper <bits<5> op, string asm, RegisterClass dstClass,
 			ValueType vt> {
-
-  def _SGPR : SMRD <
+  def _IMM : SMRD <
               op,
               (outs dstClass:$dst),
-              (ins SMRDmemrr:$src0),
+              (ins SMRDmemri:$src0),
               asm,
-              [(set (vt dstClass:$dst), (constant_load ADDR_Reg:$src0))]
+              [(set (vt dstClass:$dst), (constant_load ADDR_Offset8:$src0))]
   >;
 
-  def _IMM : SMRD <
+  def _SGPR : SMRD <
               op,
               (outs dstClass:$dst),
-              (ins SMRDmemri:$src0),
+              (ins SMRDmemrr:$src0),
               asm,
-              [(set (vt dstClass:$dst), (constant_load ADDR_Offset8:$src0))]
+              [(set (vt dstClass:$dst), (constant_load ADDR_Reg:$src0))]
   >;
 }
 




More information about the mesa-commit mailing list