[Mesa-dev] [PATCH 2/2] R600/SI: Merge offset0 and offset1 fields for single address DS instructions
Tom Stellard
tom at stellard.net
Thu Sep 5 11:36:28 PDT 2013
From: Tom Stellard <thomas.stellard at amd.com>
Also remove unused data fields from the DS_Load_Helper class.
---
lib/Target/R600/SIInstrInfo.td | 28 ++++++++++++++++++++--------
lib/Target/R600/SIInstructions.td | 6 +++---
2 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/lib/Target/R600/SIInstrInfo.td b/lib/Target/R600/SIInstrInfo.td
index 09d5f01..292d650 100644
--- a/lib/Target/R600/SIInstrInfo.td
+++ b/lib/Target/R600/SIInstrInfo.td
@@ -339,13 +339,22 @@ class VOP3_64 <bits<9> op, string opName, list<dag> pattern> : VOP3 <
// Vector I/O classes
//===----------------------------------------------------------------------===//
-class DS_Load_Helper <bits<8> op, string asm, RegisterClass regClass> : DS <
+class DS_1A <bits<8> op, dag outs, dag ins, string asm, list<dag> pat> :
+ DS <op, outs, ins, asm, pat> {
+ bits<16> offset;
+
+ let offset0 = offset{7-0};
+ let offset1 = offset{15-8};
+}
+
+class DS_Load_Helper <bits<8> op, string asm, RegisterClass regClass> : DS_1A <
op,
(outs regClass:$vdst),
- (ins i1imm:$gds, VReg_32:$addr, VReg_32:$data0, VReg_32:$data1,
- i8imm:$offset0, i8imm:$offset1),
- asm#" $vdst, $gds, $addr, $data0, $data1, $offset0, $offset1, [M0]",
+ (ins i1imm:$gds, VReg_32:$addr, i16imm:$offset),
+ asm#" $vdst, $gds, $addr, $offset, [M0]",
[]> {
+ let data0 = 0;
+ let data1 = 0;
let mayLoad = 1;
let mayStore = 0;
}
@@ -362,16 +371,19 @@ class DS_Store_Helper <bits<8> op, string asm, RegisterClass regClass> : DS <
let vdst = 0;
}
-class DS_1A1D_RET <bits<8> op, string asm, RegisterClass rc> : DS <
+class DS_1A1D_RET <bits<8> op, string asm, RegisterClass rc> : DS_1A <
op,
(outs rc:$vdst),
- (ins i1imm:$gds, VReg_32:$addr, VReg_32:$data0, i8imm:$offset0,
- i8imm:$offset1),
- asm#" $gds, $vdst, $addr, $data0, $offset0, $offset1, [M0]",
+ (ins i1imm:$gds, VReg_32:$addr, VReg_32:$data0, i16imm:$offset),
+ asm#" $gds, $vdst, $addr, $data0, $offset, [M0]",
[]> {
+ bits<16> offset;
+
let mayStore = 1;
let mayLoad = 1;
let data1 = 0;
+ let offset0 = offset{7-0};
+ let offset1 = offset{15-8};
}
class MTBUF_Store_Helper <bits<3> op, string asm, RegisterClass regClass> : MTBUF <
diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
index 31a5ad2..94dcf2c 100644
--- a/lib/Target/R600/SIInstructions.td
+++ b/lib/Target/R600/SIInstructions.td
@@ -1754,7 +1754,7 @@ def : Pat <
class DSReadPat <DS inst, ValueType vt, PatFrag frag> : Pat <
(frag i32:$src0),
- (vt (inst 0, $src0, $src0, $src0, 0, 0))
+ (vt (inst 0, $src0, 0))
>;
def : DSReadPat <DS_READ_I8, i32, sextloadi8_local>;
@@ -1764,7 +1764,7 @@ def : DSReadPat <DS_READ_U16, i32, az_extloadi16_local>;
def : DSReadPat <DS_READ_B32, i32, local_load>;
def : Pat <
(local_load i32:$src0),
- (i32 (DS_READ_B32 0, $src0, $src0, $src0, 0, 0))
+ (i32 (DS_READ_B32 0, $src0, 0))
>;
class DSWritePat <DS inst, ValueType vt, PatFrag frag> : Pat <
@@ -1777,7 +1777,7 @@ def : DSWritePat <DS_WRITE_B16, i32, truncstorei16_local>;
def : DSWritePat <DS_WRITE_B32, i32, local_store>;
def : Pat <(atomic_load_add_local i32:$ptr, i32:$val),
- (DS_ADD_U32_RTN 0, $ptr, $val, 0, 0)>;
+ (DS_ADD_U32_RTN 0, $ptr, $val, 0)>;
/********** ================== **********/
/********** SMRD Patterns **********/
--
1.8.1.5
More information about the mesa-dev
mailing list