summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AMDGPU
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2016-04-29 14:34:26 +0000
committerTom Stellard <thomas.stellard@amd.com>2016-04-29 14:34:26 +0000
commit92b24f324be33b982d87814bc8b721f8c0e55ae7 (patch)
treed6137bf33a1de1e395ca0a1dac77c007c6d86919 /llvm/test/CodeGen/AMDGPU
parentfba875f90287e2c1037bb8cf0acffafba87cf8c7 (diff)
downloadbcm5719-llvm-92b24f324be33b982d87814bc8b721f8c0e55ae7.tar.gz
bcm5719-llvm-92b24f324be33b982d87814bc8b721f8c0e55ae7.zip
AMDGPU/SI: Add offset field to ds_permute/ds_bpermute instructions
Summary: These instructions can add an immediate offset to the address, like other ds instructions. Reviewers: arsenm Subscribers: arsenm, scchan Differential Revision: http://reviews.llvm.org/D19233 llvm-svn: 268043
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU')
-rw-r--r--llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll10
-rw-r--r--llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.permute.ll12
2 files changed, 21 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll
index fa12ee2fe92..e2c535baaa8 100644
--- a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll
+++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll
@@ -11,4 +11,14 @@ define void @ds_bpermute(i32 addrspace(1)* %out, i32 %index, i32 %src) nounwind
ret void
}
+; CHECK-LABEL: {{^}}ds_bpermute_imm_offset:
+; CHECK: ds_bpermute_b32 v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}} offset:4
+; CHECK: s_waitcnt lgkmcnt
+define void @ds_bpermute_imm_offset(i32 addrspace(1)* %out, i32 %base_index, i32 %src) nounwind {
+ %index = add i32 %base_index, 4
+ %bpermute = call i32 @llvm.amdgcn.ds.bpermute(i32 %index, i32 %src) #0
+ store i32 %bpermute, i32 addrspace(1)* %out, align 4
+ ret void
+}
+
attributes #0 = { nounwind readnone convergent }
diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.permute.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.permute.ll
index f0ee48ff448..6d9c9419153 100644
--- a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.permute.ll
+++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.permute.ll
@@ -2,7 +2,7 @@
declare i32 @llvm.amdgcn.ds.permute(i32, i32) #0
-; FUNC-LABEL: {{^}}ds_permute:
+; CHECK-LABEL: {{^}}ds_permute:
; CHECK: ds_permute_b32 v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}
; CHECK: s_waitcnt lgkmcnt
define void @ds_permute(i32 addrspace(1)* %out, i32 %index, i32 %src) nounwind {
@@ -11,4 +11,14 @@ define void @ds_permute(i32 addrspace(1)* %out, i32 %index, i32 %src) nounwind {
ret void
}
+; CHECK-LABEL: {{^}}ds_permute_imm_offset:
+; CHECK: ds_permute_b32 v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}} offset:4
+; CHECK: s_waitcnt lgkmcnt
+define void @ds_permute_imm_offset(i32 addrspace(1)* %out, i32 %base_index, i32 %src) nounwind {
+ %index = add i32 %base_index, 4
+ %bpermute = call i32 @llvm.amdgcn.ds.permute(i32 %index, i32 %src) #0
+ store i32 %bpermute, i32 addrspace(1)* %out, align 4
+ ret void
+}
+
attributes #0 = { nounwind readnone convergent }
OpenPOWER on IntegriCloud