R600: Fix trunc store from i64 to i1
[oota-llvm.git] / test / CodeGen / R600 / trunc-store-i1.ll
1 ; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck -check-prefix=SI %s
2
3
4 ; SI-LABEL: @global_truncstore_i32_to_i1
5 ; SI: S_LOAD_DWORD [[LOAD:s[0-9]+]],
6 ; SI: V_AND_B32_e64 [[VREG:v[0-9]+]], 1, [[LOAD]], 0, 0, 0, 0
7 ; SI: BUFFER_STORE_BYTE [[VREG]],
8 define void @global_truncstore_i32_to_i1(i1 addrspace(1)* %out, i32 %val) nounwind {
9   %trunc = trunc i32 %val to i1
10   store i1 %trunc, i1 addrspace(1)* %out, align 1
11   ret void
12 }
13
14 ; SI-LABEL: @global_truncstore_i64_to_i1
15 ; SI: BUFFER_STORE_BYTE
16 define void @global_truncstore_i64_to_i1(i1 addrspace(1)* %out, i64 %val) nounwind {
17   %trunc = trunc i64 %val to i1
18   store i1 %trunc, i1 addrspace(1)* %out, align 1
19   ret void
20 }
21
22 ; SI-LABEL: @global_truncstore_i16_to_i1
23 ; SI: S_LOAD_DWORD [[LOAD:s[0-9]+]],
24 ; SI: V_AND_B32_e64 [[VREG:v[0-9]+]], 1, [[LOAD]], 0, 0, 0, 0
25 ; SI: BUFFER_STORE_BYTE [[VREG]],
26 define void @global_truncstore_i16_to_i1(i1 addrspace(1)* %out, i16 %val) nounwind {
27   %trunc = trunc i16 %val to i1
28   store i1 %trunc, i1 addrspace(1)* %out, align 1
29   ret void
30 }