summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichel Danzer <michel.daenzer@amd.com>2013-07-10 16:36:52 +0000
committerMichel Danzer <michel.daenzer@amd.com>2013-07-10 16:36:52 +0000
commit0a9e22b86366caee81c32dbbd942a32634993955 (patch)
treeece8aa6c631ad158e380efcb8492302dd924aacd /test
parent7740daa8ba053294b7448556c049cf6778711d66 (diff)
downloadllvm-0a9e22b86366caee81c32dbbd942a32634993955.tar.gz
llvm-0a9e22b86366caee81c32dbbd942a32634993955.tar.bz2
llvm-0a9e22b86366caee81c32dbbd942a32634993955.tar.xz
R600/SI: Add intrinsic for retrieving the current thread ID
Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186010 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/R600/llvm.SI.tid.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/R600/llvm.SI.tid.ll b/test/CodeGen/R600/llvm.SI.tid.ll
new file mode 100644
index 0000000000..238d9f2e00
--- /dev/null
+++ b/test/CodeGen/R600/llvm.SI.tid.ll
@@ -0,0 +1,16 @@
+;RUN: llc < %s -march=r600 -mcpu=verde | FileCheck %s
+
+;CHECK: V_MBCNT_LO_U32_B32_e64
+;CHECK: V_MBCNT_HI_U32_B32_e32
+
+define void @main(<16 x i8> addrspace(2)* inreg, <16 x i8> addrspace(2)* inreg, <32 x i8> addrspace(2)* inreg, i32 inreg) "ShaderType"="0" {
+main_body:
+ %4 = call i32 @llvm.SI.tid()
+ %5 = bitcast i32 %4 to float
+ call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 1, float %5, float %5, float %5, float %5)
+ ret void
+}
+
+declare i32 @llvm.SI.tid() readnone
+
+declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)