aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-08-14 22:22:09 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-08-14 22:22:09 +0000
commita7b7ab32998f6a643b63e7a82cf98c3498960d90 (patch)
treec5e8f347d886d864cbfb8bd447683b9228b34a58 /test
parent9735dc6c1b20ae311bba50fbf28feb8c41810d3c (diff)
downloadexternal_llvm-a7b7ab32998f6a643b63e7a82cf98c3498960d90.zip
external_llvm-a7b7ab32998f6a643b63e7a82cf98c3498960d90.tar.gz
external_llvm-a7b7ab32998f6a643b63e7a82cf98c3498960d90.tar.bz2
R600/SI: Allow conversion between v32i8 and v8i32
Patch by: Marek Olšák Signed-off-by: Marek Olšák <marek.olsak@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/R600/bitcast.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGen/R600/bitcast.ll b/test/CodeGen/R600/bitcast.ll
new file mode 100644
index 0000000..399444b
--- /dev/null
+++ b/test/CodeGen/R600/bitcast.ll
@@ -0,0 +1,21 @@
+; RUN: llc < %s -march=r600 -mcpu=SI | FileCheck %s
+
+; This test just checks that the compiler doesn't crash.
+; CHECK-LABEL: @v32i8_to_v8i32
+; CHECK: S_ENDPGM
+
+define void @v32i8_to_v8i32(<32 x i8> addrspace(2)* inreg) #0 {
+entry:
+ %1 = load <32 x i8> addrspace(2)* %0
+ %2 = bitcast <32 x i8> %1 to <8 x i32>
+ %3 = extractelement <8 x i32> %2, i32 1
+ %4 = icmp ne i32 %3, 0
+ %5 = select i1 %4, float 0.0, float 1.0
+ 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 void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float)
+
+attributes #0 = { "ShaderType"="0" }
+