llvm.org GIT mirror llvm / 3e1bcea
Merging r200283: ------------------------------------------------------------------------ r200283 | michel.daenzer | 2014-01-27 19:01:16 -0800 (Mon, 27 Jan 2014) | 6 lines R600/SI: Add pattern for truncating i32 to i1 Fixes half a dozen piglit tests with radeonsi. Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@204642 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 6 years ago
2 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
21102110 (EXTRACT_SUBREG $a, sub0)
21112111 >;
21122112
2113 def : Pat <
2114 (i1 (trunc i32:$a)),
2115 (V_CMP_EQ_I32_e64 (V_AND_B32_e32 (i32 1), $a), 1)
2116 >;
2117
21132118 // V_ADD_I32_e32/S_ADD_I32 produces carry in VCC/SCC. For the vector
21142119 // case, the sgpr-copies pass will fix this to use the vector version.
21152120 def : Pat <
2727 store i32 %result, i32 addrspace(1)* %out, align 4
2828 ret void
2929 }
30
31 ; SI-LABEL: @trunc_i32_to_i1:
32 ; SI: V_AND_B32
33 ; SI: V_CMP_EQ_I32
34 define void @trunc_i32_to_i1(i32 addrspace(1)* %out, i32 %a) {
35 %trunc = trunc i32 %a to i1
36 %result = select i1 %trunc, i32 1, i32 0
37 store i32 %result, i32 addrspace(1)* %out, align 4
38 ret void
39 }