summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/R600/sint_to_fp.ll
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-05-31 06:47:42 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-05-31 06:47:42 +0000
commitaeca2fa9f7a1c87f63a46e93577ace63f428b726 (patch)
tree62ce3dd2d87ec3918fac51216f578617d73d7dc1 /llvm/test/CodeGen/R600/sint_to_fp.ll
parent363e7c4f42d8517c0df64724fa0fd650ec67c438 (diff)
downloadbcm5719-llvm-aeca2fa9f7a1c87f63a46e93577ace63f428b726.tar.gz
bcm5719-llvm-aeca2fa9f7a1c87f63a46e93577ace63f428b726.zip
R600/SI: Fix [s|u]int_to_fp for i1
llvm-svn: 209971
Diffstat (limited to 'llvm/test/CodeGen/R600/sint_to_fp.ll')
-rw-r--r--llvm/test/CodeGen/R600/sint_to_fp.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/R600/sint_to_fp.ll b/llvm/test/CodeGen/R600/sint_to_fp.ll
index 9241799091c..b27dfda8aea 100644
--- a/llvm/test/CodeGen/R600/sint_to_fp.ll
+++ b/llvm/test/CodeGen/R600/sint_to_fp.ll
@@ -29,3 +29,25 @@ define void @sint_to_fp_v4i32(<4 x float> addrspace(1)* %out, <4 x i32> addrspac
store <4 x float> %result, <4 x float> addrspace(1)* %out
ret void
}
+
+; FUNC-LABEL: @sint_to_fp_i1_f32:
+; SI: V_CMP_EQ_I32_e64 [[CMP:s\[[0-9]+:[0-9]\]]],
+; SI-NEXT: V_CNDMASK_B32_e64 [[RESULT:v[0-9]+]], 0, -1.000000e+00, [[CMP]]
+; SI: BUFFER_STORE_DWORD [[RESULT]],
+; SI: S_ENDPGM
+define void @sint_to_fp_i1_f32(float addrspace(1)* %out, i32 %in) {
+ %cmp = icmp eq i32 %in, 0
+ %fp = uitofp i1 %cmp to float
+ store float %fp, float addrspace(1)* %out, align 4
+ ret void
+}
+
+; FUNC-LABEL: @sint_to_fp_i1_f32_load:
+; SI: V_CNDMASK_B32_e64 [[RESULT:v[0-9]+]], 0, -1.000000e+00
+; SI: BUFFER_STORE_DWORD [[RESULT]],
+; SI: S_ENDPGM
+define void @sint_to_fp_i1_f32_load(float addrspace(1)* %out, i1 %in) {
+ %fp = sitofp i1 %in to float
+ store float %fp, float addrspace(1)* %out, align 4
+ ret void
+}
OpenPOWER on IntegriCloud