summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AMDGPU/DSInstructions.td8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/DSInstructions.td b/llvm/lib/Target/AMDGPU/DSInstructions.td
index 93308e6d78a..e39f565fd22 100644
--- a/llvm/lib/Target/AMDGPU/DSInstructions.td
+++ b/llvm/lib/Target/AMDGPU/DSInstructions.td
@@ -38,6 +38,8 @@ class DS_Pseudo <string opName, dag outs, dag ins, string asmOps, list<dag> patt
bits<1> has_data0 = 1;
bits<1> has_data1 = 1;
+ bits<1> has_gws_data0 = 0; // data0 is encoded as addr
+
bits<1> has_offset = 1; // has "offset" that should be split to offset0,1
bits<1> has_offset0 = 1;
bits<1> has_offset1 = 1;
@@ -320,7 +322,7 @@ class DS_GWS_1D <string opName>
: DS_GWS<opName,
(ins VGPR_32:$data0, offset:$offset, gds:$gds), "$data0$offset gds"> {
- let has_data0 = 1;
+ let has_gws_data0 = 1;
}
class DS_VOID <string opName> : DS_Pseudo<opName,
@@ -832,7 +834,7 @@ class Base_DS_Real_gfx6_gfx7_gfx10<bits<8> op, DS_Pseudo ps, int ef> :
let Inst{17} = !if(ps.has_gds, gds, ps.gdsValue);
let Inst{25-18} = op;
let Inst{31-26} = 0x36;
- let Inst{39-32} = !if(ps.has_addr, addr, 0);
+ let Inst{39-32} = !if(ps.has_addr, addr, !if(ps.has_gws_data0, data0, 0));
let Inst{47-40} = !if(ps.has_data0, data0, 0);
let Inst{55-48} = !if(ps.has_data1, data1, 0);
let Inst{63-56} = !if(ps.has_vdst, vdst, 0);
@@ -1051,7 +1053,7 @@ class DS_Real_vi <bits<8> op, DS_Pseudo ds> :
let Inst{16} = !if(ds.has_gds, gds, ds.gdsValue);
let Inst{24-17} = op;
let Inst{31-26} = 0x36; // ds prefix
- let Inst{39-32} = !if(ds.has_addr, addr, 0);
+ let Inst{39-32} = !if(ds.has_addr, addr, !if(ds.has_gws_data0, data0, 0));
let Inst{47-40} = !if(ds.has_data0, data0, 0);
let Inst{55-48} = !if(ds.has_data1, data1, 0);
let Inst{63-56} = !if(ds.has_vdst, vdst, 0);
OpenPOWER on IntegriCloud