1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 ; Check that we generate correct set of instructions for unordered
4 ; floating-point compares.
7 ; CHECK-DAG: [[PREG1:p[0-3]+]] = sfcmp.eq(r{{[0-9]+}},r{{[0-9]+}})
8 ; CHECK-DAG: [[PREG2:p[0-3]+]] = sfcmp.uo(r{{[0-9]+}},r{{[0-9]+}})
9 ; CHECK: p{{[0-3]+}} = or([[PREG2]],![[PREG1]])
10 define float @f0(float %a0, float %a1, float %a2) #0 {
12 %v0 = fcmp une float %a0, 0.000000e+00
13 %v1 = select i1 %v0, float %a2, float 0.000000e+00
18 ; CHECK-DAG: [[PREG1:p[0-3]+]] = sfcmp.ge(r{{[0-9]+}},r{{[0-9]+}})
19 ; CHECK-DAG: [[PREG2:p[0-3]+]] = sfcmp.uo(r{{[0-9]+}},r{{[0-9]+}})
20 ; CHECK: p{{[0-3]+}} = or([[PREG2]],[[PREG1]])
21 define float @f1(float %a0, float %a1, float %a2) #0 {
23 %v0 = fcmp uge float %a0, 0.000000e+00
24 %v1 = select i1 %v0, float %a2, float 0.000000e+00
29 ; CHECK-DAG: [[PREG1:p[0-3]+]] = sfcmp.gt(r{{[0-9]+}},r{{[0-9]+}})
30 ; CHECK-DAG: [[PREG2:p[0-3]+]] = sfcmp.uo(r{{[0-9]+}},r{{[0-9]+}})
31 ; CHECK: p{{[0-3]+}} = or([[PREG2]],[[PREG1]])
32 define float @f2(float %a0, float %a1, float %a2) #0 {
34 %v0 = fcmp ugt float %a0, 0.000000e+00
35 %v1 = select i1 %v0, float %a2, float 0.000000e+00
40 ; CHECK-DAG: [[PREG1:p[0-3]+]] = sfcmp.ge(r{{[0-9]+}},r{{[0-9]+}})
41 ; CHECK-DAG: [[PREG2:p[0-3]+]] = sfcmp.uo(r{{[0-9]+}},r{{[0-9]+}})
42 ; CHECK: p{{[0-3]+}} = or([[PREG2]],[[PREG1]])
43 define float @f3(float %a0, float %a1, float %a2) #0 {
45 %v0 = fcmp ule float %a0, 0.000000e+00
46 %v1 = select i1 %v0, float %a2, float 0.000000e+00
51 ; CHECK-DAG: [[PREG1:p[0-3]+]] = sfcmp.gt(r{{[0-9]+}},r{{[0-9]+}})
52 ; CHECK-DAG: [[PREG2:p[0-3]+]] = sfcmp.uo(r{{[0-9]+}},r{{[0-9]+}})
53 ; CHECK: p{{[0-3]+}} = or([[PREG2]],[[PREG1]])
54 define float @f4(float %a0, float %a1, float %a2) #0 {
56 %v0 = fcmp ult float %a0, 0.000000e+00
57 %v1 = select i1 %v0, float %a2, float 0.000000e+00
61 attributes #0 = { nounwind "target-cpu"="hexagonv55" }