1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
; RUN: opt < %s -instcombine -S | FileCheck %s
; Infinity
; CHECK: inf0
; CHECK: ret i1 false
define i1 @inf0(double %arg) nounwind readnone {
%tmp = fcmp ogt double %arg, 0x7FF0000000000000
ret i1 %tmp
}
; CHECK: inf1
; CHECK: ret i1 true
define i1 @inf1(double %arg) nounwind readnone {
%tmp = fcmp ule double %arg, 0x7FF0000000000000
ret i1 %tmp
}
; Negative infinity
; CHECK: ninf0
; CHECK: ret i1 false
define i1 @ninf0(double %arg) nounwind readnone {
%tmp = fcmp olt double %arg, 0xFFF0000000000000
ret i1 %tmp
}
; CHECK: ninf1
; CHECK: ret i1 true
define i1 @ninf1(double %arg) nounwind readnone {
%tmp = fcmp uge double %arg, 0xFFF0000000000000
ret i1 %tmp
}
; NaNs
; CHECK: nan0
; CHECK: ret i1 false
define i1 @nan0(double %arg) nounwind readnone {
%tmp = fcmp ord double %arg, 0x7FF00000FFFFFFFF
ret i1 %tmp
}
; CHECK: nan1
; CHECK: ret i1 false
define i1 @nan1(double %arg) nounwind readnone {
%tmp = fcmp oeq double %arg, 0x7FF00000FFFFFFFF
ret i1 %tmp
}
; CHECK: nan2
; CHECK: ret i1 false
define i1 @nan2(double %arg) nounwind readnone {
%tmp = fcmp olt double %arg, 0x7FF00000FFFFFFFF
ret i1 %tmp
}
; CHECK: nan3
; CHECK: ret i1 true
define i1 @nan3(double %arg) nounwind readnone {
%tmp = fcmp uno double %arg, 0x7FF00000FFFFFFFF
ret i1 %tmp
}
; CHECK: nan4
; CHECK: ret i1 true
define i1 @nan4(double %arg) nounwind readnone {
%tmp = fcmp une double %arg, 0x7FF00000FFFFFFFF
ret i1 %tmp
}
; CHECK: nan5
; CHECK: ret i1 true
define i1 @nan5(double %arg) nounwind readnone {
%tmp = fcmp ult double %arg, 0x7FF00000FFFFFFFF
ret i1 %tmp
}
; Negative NaN.
; CHECK: nnan0
; CHECK: ret i1 false
define i1 @nnan0(double %arg) nounwind readnone {
%tmp = fcmp ord double %arg, 0xFFF00000FFFFFFFF
ret i1 %tmp
}
; CHECK: nnan1
; CHECK: ret i1 false
define i1 @nnan1(double %arg) nounwind readnone {
%tmp = fcmp oeq double %arg, 0xFFF00000FFFFFFFF
ret i1 %tmp
}
; CHECK: nnan2
; CHECK: ret i1 false
define i1 @nnan2(double %arg) nounwind readnone {
%tmp = fcmp olt double %arg, 0xFFF00000FFFFFFFF
ret i1 %tmp
}
; CHECK: nnan3
; CHECK: ret i1 true
define i1 @nnan3(double %arg) nounwind readnone {
%tmp = fcmp uno double %arg, 0xFFF00000FFFFFFFF
ret i1 %tmp
}
; CHECK: nnan4
; CHECK: ret i1 true
define i1 @nnan4(double %arg) nounwind readnone {
%tmp = fcmp une double %arg, 0xFFF00000FFFFFFFF
ret i1 %tmp
}
; CHECK: nnan5
; CHECK: ret i1 true
define i1 @nnan5(double %arg) nounwind readnone {
%tmp = fcmp ult double %arg, 0xFFF00000FFFFFFFF
ret i1 %tmp
}
; Negative zero.
; CHECK: nzero0
; CHECK: ret i1 true
define i1 @nzero0() {
%tmp = fcmp oeq double 0.0, -0.0
ret i1 %tmp
}
; CHECK: nzero1
; CHECK: ret i1 false
define i1 @nzero1() {
%tmp = fcmp ogt double 0.0, -0.0
ret i1 %tmp
}
; Misc.
; CHECK: misc0
; CHECK: %tmp = fcmp ord double %arg, 0.000000e+00
; CHECK: ret i1 %tmp
define i1 @misc0(double %arg) {
%tmp = fcmp oeq double %arg, %arg
ret i1 %tmp
}
; CHECK: misc1
; CHECK: ret i1 false
define i1 @misc1(double %arg) {
%tmp = fcmp one double %arg, %arg
ret i1 %tmp
}
|