• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
2
3; CHECK: @test_a
4; CHECK-NOT: CND
5; CHECK: SET{{[NEQGTL]+}}_DX10
6
7define void @test_a(i32 addrspace(1)* %out, float %in) {
8entry:
9  %0 = fcmp ult float %in, 0.000000e+00
10  %1 = select i1 %0, float 1.000000e+00, float 0.000000e+00
11  %2 = fsub float -0.000000e+00, %1
12  %3 = fptosi float %2 to i32
13  %4 = bitcast i32 %3 to float
14  %5 = bitcast float %4 to i32
15  %6 = icmp ne i32 %5, 0
16  br i1 %6, label %IF, label %ENDIF
17
18IF:
19  %7 = getelementptr i32 addrspace(1)* %out, i32 1
20  store i32 0, i32 addrspace(1)* %7
21  br label %ENDIF
22
23ENDIF:
24  store i32 0, i32 addrspace(1)* %out
25  ret void
26}
27
28; Same as test_a, but the branch labels are swapped to produce the inverse cc
29; for the icmp instruction
30
31; CHECK: @test_b
32; CHECK: SET{{[GTEQN]+}}_DX10
33; CHECK-NEXT: PRED_
34define void @test_b(i32 addrspace(1)* %out, float %in) {
35entry:
36  %0 = fcmp ult float %in, 0.0
37  %1 = select i1 %0, float 1.000000e+00, float 0.000000e+00
38  %2 = fsub float -0.000000e+00, %1
39  %3 = fptosi float %2 to i32
40  %4 = bitcast i32 %3 to float
41  %5 = bitcast float %4 to i32
42  %6 = icmp ne i32 %5, 0
43  br i1 %6, label %ENDIF, label %IF
44
45IF:
46  %7 = getelementptr i32 addrspace(1)* %out, i32 1
47  store i32 0, i32 addrspace(1)* %7
48  br label %ENDIF
49
50ENDIF:
51  store i32 0, i32 addrspace(1)* %out
52  ret void
53}
54
55; Test a CND*_INT instruction with float true/false values
56; CHECK: @test_c
57; CHECK: CND{{[GTE]+}}_INT
58define void @test_c(float addrspace(1)* %out, i32 %in) {
59entry:
60  %0 = icmp sgt i32 %in, 0
61  %1 = select i1 %0, float 2.0, float 3.0
62  store float %1, float addrspace(1)* %out
63  ret void
64}
65