Mass update to CodeGen tests to use CHECK-LABEL for labels corresponding to function...
[oota-llvm.git] / test / CodeGen / X86 / compare-inf.ll
1 ; RUN: llc < %s -march=x86-64 | FileCheck %s
2
3 ; Convert oeq and une to ole/oge/ule/uge when comparing with infinity
4 ; and negative infinity, because those are more efficient on x86.
5
6 ; CHECK-LABEL: oeq_inff:
7 ; CHECK: ucomiss
8 ; CHECK: jb
9 define float @oeq_inff(float %x, float %y) nounwind readonly {
10   %t0 = fcmp oeq float %x, 0x7FF0000000000000
11   %t1 = select i1 %t0, float 1.0, float %y
12   ret float %t1
13 }
14
15 ; CHECK-LABEL: oeq_inf:
16 ; CHECK: ucomisd
17 ; CHECK: jb
18 define double @oeq_inf(double %x, double %y) nounwind readonly {
19   %t0 = fcmp oeq double %x, 0x7FF0000000000000
20   %t1 = select i1 %t0, double 1.0, double %y
21   ret double %t1
22 }
23
24 ; CHECK-LABEL: une_inff:
25 ; CHECK: ucomiss
26 ; CHECK: jae
27 define float @une_inff(float %x, float %y) nounwind readonly {
28   %t0 = fcmp une float %x, 0x7FF0000000000000
29   %t1 = select i1 %t0, float 1.0, float %y
30   ret float %t1
31 }
32
33 ; CHECK-LABEL: une_inf:
34 ; CHECK: ucomisd
35 ; CHECK: jae
36 define double @une_inf(double %x, double %y) nounwind readonly {
37   %t0 = fcmp une double %x, 0x7FF0000000000000
38   %t1 = select i1 %t0, double 1.0, double %y
39   ret double %t1
40 }
41
42 ; CHECK-LABEL: oeq_neg_inff:
43 ; CHECK: ucomiss
44 ; CHECK: jb
45 define float @oeq_neg_inff(float %x, float %y) nounwind readonly {
46   %t0 = fcmp oeq float %x, 0xFFF0000000000000
47   %t1 = select i1 %t0, float 1.0, float %y
48   ret float %t1
49 }
50
51 ; CHECK-LABEL: oeq_neg_inf:
52 ; CHECK: ucomisd
53 ; CHECK: jb
54 define double @oeq_neg_inf(double %x, double %y) nounwind readonly {
55   %t0 = fcmp oeq double %x, 0xFFF0000000000000
56   %t1 = select i1 %t0, double 1.0, double %y
57   ret double %t1
58 }
59
60 ; CHECK-LABEL: une_neg_inff:
61 ; CHECK: ucomiss
62 ; CHECK: jae
63 define float @une_neg_inff(float %x, float %y) nounwind readonly {
64   %t0 = fcmp une float %x, 0xFFF0000000000000
65   %t1 = select i1 %t0, float 1.0, float %y
66   ret float %t1
67 }
68
69 ; CHECK-LABEL: une_neg_inf:
70 ; CHECK: ucomisd
71 ; CHECK: jae
72 define double @une_neg_inf(double %x, double %y) nounwind readonly {
73   %t0 = fcmp une double %x, 0xFFF0000000000000
74   %t1 = select i1 %t0, double 1.0, double %y
75   ret double %t1
76 }