• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=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
6declare void @f() nounwind
7
8; CHECK-LABEL: oeq_inff:
9; CHECK: ucomiss
10; CHECK: jb
11define void @oeq_inff(float %x) nounwind {
12  %t0 = fcmp oeq float %x, 0x7FF0000000000000
13  br i1 %t0, label %true, label %false
14
15true:
16  call void @f() nounwind
17  br label %false
18
19false:
20  ret void
21}
22
23; CHECK-LABEL: oeq_inf:
24; CHECK: ucomisd
25; CHECK: jb
26define void @oeq_inf(double %x) nounwind {
27  %t0 = fcmp oeq double %x, 0x7FF0000000000000
28  br i1 %t0, label %true, label %false
29
30true:
31  call void @f() nounwind
32  br label %false
33
34false:
35  ret void
36}
37
38; CHECK-LABEL: une_inff:
39; CHECK: ucomiss
40; CHECK: jae
41define void @une_inff(float %x) nounwind {
42  %t0 = fcmp une float %x, 0x7FF0000000000000
43  br i1 %t0, label %true, label %false
44
45true:
46  call void @f() nounwind
47  br label %false
48
49false:
50  ret void
51}
52
53; CHECK-LABEL: une_inf:
54; CHECK: ucomisd
55; CHECK: jae
56define void @une_inf(double %x) nounwind {
57  %t0 = fcmp une double %x, 0x7FF0000000000000
58  br i1 %t0, label %true, label %false
59
60true:
61  call void @f() nounwind
62  br label %false
63
64false:
65  ret void
66}
67
68; CHECK-LABEL: oeq_neg_inff:
69; CHECK: ucomiss
70; CHECK: jb
71define void @oeq_neg_inff(float %x) nounwind {
72  %t0 = fcmp oeq float %x, 0xFFF0000000000000
73  br i1 %t0, label %true, label %false
74
75true:
76  call void @f() nounwind
77  br label %false
78
79false:
80  ret void
81}
82
83; CHECK-LABEL: oeq_neg_inf:
84; CHECK: ucomisd
85; CHECK: jb
86define void @oeq_neg_inf(double %x) nounwind {
87  %t0 = fcmp oeq double %x, 0xFFF0000000000000
88  br i1 %t0, label %true, label %false
89
90true:
91  call void @f() nounwind
92  br label %false
93
94false:
95  ret void
96}
97
98; CHECK-LABEL: une_neg_inff:
99; CHECK: ucomiss
100; CHECK: jae
101define void @une_neg_inff(float %x) nounwind {
102  %t0 = fcmp une float %x, 0xFFF0000000000000
103  br i1 %t0, label %true, label %false
104
105true:
106  call void @f() nounwind
107  br label %false
108
109false:
110  ret void
111}
112
113; CHECK-LABEL: une_neg_inf:
114; CHECK: ucomisd
115; CHECK: jae
116define void @une_neg_inf(double %x) nounwind {
117  %t0 = fcmp une double %x, 0xFFF0000000000000
118  br i1 %t0, label %true, label %false
119
120true:
121  call void @f() nounwind
122  br label %false
123
124false:
125  ret void
126}
127