summaryrefslogtreecommitdiff
path: root/test/CodeGen/R600/mubuf.ll
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-02-06 18:36:39 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-02-06 18:36:39 +0000
commit603cd56372769416346e817f14454f6b796abae3 (patch)
tree3b76f4fefd2b1cd06bc7fd96ddd433a812ba1328 /test/CodeGen/R600/mubuf.ll
parentbecac0f183be5743a27ced2a59cb2ce191206b71 (diff)
downloadllvm-603cd56372769416346e817f14454f6b796abae3.tar.gz
llvm-603cd56372769416346e817f14454f6b796abae3.tar.bz2
llvm-603cd56372769416346e817f14454f6b796abae3.tar.xz
R600/SI: Add a MUBUF store pattern for Imm offsets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/R600/mubuf.ll')
-rw-r--r--test/CodeGen/R600/mubuf.ll35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/CodeGen/R600/mubuf.ll b/test/CodeGen/R600/mubuf.ll
index 0f2f19c946..fd03961110 100644
--- a/test/CodeGen/R600/mubuf.ll
+++ b/test/CodeGen/R600/mubuf.ll
@@ -49,3 +49,38 @@ entry:
store i32 %2, i32 addrspace(1)* %out
ret void
}
+
+;;;==========================================================================;;;
+;;; MUBUF STORE TESTS
+;;;==========================================================================;;;
+
+; MUBUF store with an immediate byte offset that fits into 12-bits
+; CHECK-LABEL: @mubuf_store0
+; CHECK: BUFFER_STORE_DWORD v{{[0-9]}}, s[{{[0-9]:[0-9]}}] + v[{{[0-9]:[0-9]}}] + 4 ; encoding: [0x04,0x80
+define void @mubuf_store0(i32 addrspace(1)* %out) {
+entry:
+ %0 = getelementptr i32 addrspace(1)* %out, i64 1
+ store i32 0, i32 addrspace(1)* %0
+ ret void
+}
+
+; MUBUF store with the largest possible immediate offset
+; CHECK-LABEL: @mubuf_store1
+; CHECK: BUFFER_STORE_BYTE v{{[0-9]}}, s[{{[0-9]:[0-9]}}] + v[{{[0-9]:[0-9]}}] + 4095 ; encoding: [0xff,0x8f
+
+define void @mubuf_store1(i8 addrspace(1)* %out) {
+entry:
+ %0 = getelementptr i8 addrspace(1)* %out, i64 4095
+ store i8 0, i8 addrspace(1)* %0
+ ret void
+}
+
+; MUBUF store with an immediate byte offset that doesn't fit into 12-bits
+; CHECK-LABEL: @mubuf_store2
+; CHECK: BUFFER_STORE_DWORD v{{[0-9]}}, s[{{[0-9]:[0-9]}}] + v[{{[0-9]:[0-9]}}] + 0 ; encoding: [0x00,0x80
+define void @mubuf_store2(i32 addrspace(1)* %out) {
+entry:
+ %0 = getelementptr i32 addrspace(1)* %out, i64 1024
+ store i32 0, i32 addrspace(1)* %0
+ ret void
+}