• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
2
3; XXX: Merge this into setcc, once R600 supports 64-bit operations
4
5;;;==========================================================================;;;
6;; Double comparisons
7;;;==========================================================================;;;
8
9; FUNC-LABEL: @f64_oeq
10; SI: V_CMP_EQ_F64
11define void @f64_oeq(i32 addrspace(1)* %out, double %a, double %b) {
12entry:
13  %0 = fcmp oeq double %a, %b
14  %1 = sext i1 %0 to i32
15  store i32 %1, i32 addrspace(1)* %out
16  ret void
17}
18
19; FUNC-LABEL: @f64_ogt
20; SI: V_CMP_GT_F64
21define void @f64_ogt(i32 addrspace(1)* %out, double %a, double %b) {
22entry:
23  %0 = fcmp ogt double %a, %b
24  %1 = sext i1 %0 to i32
25  store i32 %1, i32 addrspace(1)* %out
26  ret void
27}
28
29; FUNC-LABEL: @f64_oge
30; SI: V_CMP_GE_F64
31define void @f64_oge(i32 addrspace(1)* %out, double %a, double %b) {
32entry:
33  %0 = fcmp oge double %a, %b
34  %1 = sext i1 %0 to i32
35  store i32 %1, i32 addrspace(1)* %out
36  ret void
37}
38
39; FUNC-LABEL: @f64_olt
40; SI: V_CMP_LT_F64
41define void @f64_olt(i32 addrspace(1)* %out, double %a, double %b) {
42entry:
43  %0 = fcmp olt double %a, %b
44  %1 = sext i1 %0 to i32
45  store i32 %1, i32 addrspace(1)* %out
46  ret void
47}
48
49; FUNC-LABEL: @f64_ole
50; SI: V_CMP_LE_F64
51define void @f64_ole(i32 addrspace(1)* %out, double %a, double %b) {
52entry:
53  %0 = fcmp ole double %a, %b
54  %1 = sext i1 %0 to i32
55  store i32 %1, i32 addrspace(1)* %out
56  ret void
57}
58
59; FUNC-LABEL: @f64_one
60; SI: V_CMP_O_F64
61; SI: V_CMP_NEQ_F64
62; SI: V_CNDMASK_B32_e64
63; SI: V_CNDMASK_B32_e64
64; SI: V_AND_B32_e32
65define void @f64_one(i32 addrspace(1)* %out, double %a, double %b) {
66entry:
67  %0 = fcmp one double %a, %b
68  %1 = sext i1 %0 to i32
69  store i32 %1, i32 addrspace(1)* %out
70  ret void
71}
72
73; FUNC-LABEL: @f64_ord
74; SI: V_CMP_O_F64
75define void @f64_ord(i32 addrspace(1)* %out, double %a, double %b) {
76entry:
77  %0 = fcmp ord double %a, %b
78  %1 = sext i1 %0 to i32
79  store i32 %1, i32 addrspace(1)* %out
80  ret void
81}
82
83; FUNC-LABEL: @f64_ueq
84; SI: V_CMP_U_F64
85; SI: V_CMP_EQ_F64
86; SI: V_CNDMASK_B32_e64
87; SI: V_CNDMASK_B32_e64
88; SI: V_OR_B32_e32
89define void @f64_ueq(i32 addrspace(1)* %out, double %a, double %b) {
90entry:
91  %0 = fcmp ueq double %a, %b
92  %1 = sext i1 %0 to i32
93  store i32 %1, i32 addrspace(1)* %out
94  ret void
95}
96
97; FUNC-LABEL: @f64_ugt
98; SI: V_CMP_U_F64
99; SI: V_CMP_GT_F64
100; SI: V_CNDMASK_B32_e64
101; SI: V_CNDMASK_B32_e64
102; SI: V_OR_B32_e32
103define void @f64_ugt(i32 addrspace(1)* %out, double %a, double %b) {
104entry:
105  %0 = fcmp ugt double %a, %b
106  %1 = sext i1 %0 to i32
107  store i32 %1, i32 addrspace(1)* %out
108  ret void
109}
110
111; FUNC-LABEL: @f64_uge
112; SI: V_CMP_U_F64
113; SI: V_CMP_GE_F64
114; SI: V_CNDMASK_B32_e64
115; SI: V_CNDMASK_B32_e64
116; SI: V_OR_B32_e32
117define void @f64_uge(i32 addrspace(1)* %out, double %a, double %b) {
118entry:
119  %0 = fcmp uge double %a, %b
120  %1 = sext i1 %0 to i32
121  store i32 %1, i32 addrspace(1)* %out
122  ret void
123}
124
125; FUNC-LABEL: @f64_ult
126; SI: V_CMP_U_F64
127; SI: V_CMP_LT_F64
128; SI: V_CNDMASK_B32_e64
129; SI: V_CNDMASK_B32_e64
130; SI: V_OR_B32_e32
131define void @f64_ult(i32 addrspace(1)* %out, double %a, double %b) {
132entry:
133  %0 = fcmp ult double %a, %b
134  %1 = sext i1 %0 to i32
135  store i32 %1, i32 addrspace(1)* %out
136  ret void
137}
138
139; FUNC-LABEL: @f64_ule
140; SI: V_CMP_U_F64
141; SI: V_CMP_LE_F64
142; SI: V_CNDMASK_B32_e64
143; SI: V_CNDMASK_B32_e64
144; SI: V_OR_B32_e32
145define void @f64_ule(i32 addrspace(1)* %out, double %a, double %b) {
146entry:
147  %0 = fcmp ule double %a, %b
148  %1 = sext i1 %0 to i32
149  store i32 %1, i32 addrspace(1)* %out
150  ret void
151}
152
153; FUNC-LABEL: @f64_une
154; SI: V_CMP_NEQ_F64
155define void @f64_une(i32 addrspace(1)* %out, double %a, double %b) {
156entry:
157  %0 = fcmp une double %a, %b
158  %1 = sext i1 %0 to i32
159  store i32 %1, i32 addrspace(1)* %out
160  ret void
161}
162
163; FUNC-LABEL: @f64_uno
164; SI: V_CMP_U_F64
165define void @f64_uno(i32 addrspace(1)* %out, double %a, double %b) {
166entry:
167  %0 = fcmp uno double %a, %b
168  %1 = sext i1 %0 to i32
169  store i32 %1, i32 addrspace(1)* %out
170  ret void
171}
172
173;;;==========================================================================;;;
174;; 64-bit integer comparisons
175;;;==========================================================================;;;
176
177; FUNC-LABEL: @i64_eq
178; SI: V_CMP_EQ_I64
179define void @i64_eq(i32 addrspace(1)* %out, i64 %a, i64 %b) {
180entry:
181  %0 = icmp eq i64 %a, %b
182  %1 = sext i1 %0 to i32
183  store i32 %1, i32 addrspace(1)* %out
184  ret void
185}
186
187; FUNC-LABEL: @i64_ne
188; SI: V_CMP_NE_I64
189define void @i64_ne(i32 addrspace(1)* %out, i64 %a, i64 %b) {
190entry:
191  %0 = icmp ne i64 %a, %b
192  %1 = sext i1 %0 to i32
193  store i32 %1, i32 addrspace(1)* %out
194  ret void
195}
196
197; FUNC-LABEL: @i64_ugt
198; SI: V_CMP_GT_U64
199define void @i64_ugt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
200entry:
201  %0 = icmp ugt i64 %a, %b
202  %1 = sext i1 %0 to i32
203  store i32 %1, i32 addrspace(1)* %out
204  ret void
205}
206
207; FUNC-LABEL: @i64_uge
208; SI: V_CMP_GE_U64
209define void @i64_uge(i32 addrspace(1)* %out, i64 %a, i64 %b) {
210entry:
211  %0 = icmp uge i64 %a, %b
212  %1 = sext i1 %0 to i32
213  store i32 %1, i32 addrspace(1)* %out
214  ret void
215}
216
217; FUNC-LABEL: @i64_ult
218; SI: V_CMP_LT_U64
219define void @i64_ult(i32 addrspace(1)* %out, i64 %a, i64 %b) {
220entry:
221  %0 = icmp ult i64 %a, %b
222  %1 = sext i1 %0 to i32
223  store i32 %1, i32 addrspace(1)* %out
224  ret void
225}
226
227; FUNC-LABEL: @i64_ule
228; SI: V_CMP_LE_U64
229define void @i64_ule(i32 addrspace(1)* %out, i64 %a, i64 %b) {
230entry:
231  %0 = icmp ule i64 %a, %b
232  %1 = sext i1 %0 to i32
233  store i32 %1, i32 addrspace(1)* %out
234  ret void
235}
236
237; FUNC-LABEL: @i64_sgt
238; SI: V_CMP_GT_I64
239define void @i64_sgt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
240entry:
241  %0 = icmp sgt i64 %a, %b
242  %1 = sext i1 %0 to i32
243  store i32 %1, i32 addrspace(1)* %out
244  ret void
245}
246
247; FUNC-LABEL: @i64_sge
248; SI: V_CMP_GE_I64
249define void @i64_sge(i32 addrspace(1)* %out, i64 %a, i64 %b) {
250entry:
251  %0 = icmp sge i64 %a, %b
252  %1 = sext i1 %0 to i32
253  store i32 %1, i32 addrspace(1)* %out
254  ret void
255}
256
257; FUNC-LABEL: @i64_slt
258; SI: V_CMP_LT_I64
259define void @i64_slt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
260entry:
261  %0 = icmp slt i64 %a, %b
262  %1 = sext i1 %0 to i32
263  store i32 %1, i32 addrspace(1)* %out
264  ret void
265}
266
267; FUNC-LABEL: @i64_sle
268; SI: V_CMP_LE_I64
269define void @i64_sle(i32 addrspace(1)* %out, i64 %a, i64 %b) {
270entry:
271  %0 = icmp sle i64 %a, %b
272  %1 = sext i1 %0 to i32
273  store i32 %1, i32 addrspace(1)* %out
274  ret void
275}
276