blob: 6a1c5ef1af02cd872c88732de1473261aef383b9 [file] [log] [blame]
Tom Stellard919bb6b2014-04-29 23:12:53 +00001;RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
Tom Stellardc0845332013-11-22 23:07:58 +00002
3; XXX: Merge this into setcc, once R600 supports 64-bit operations
4
5;;;==========================================================================;;;
6;; Double comparisons
7;;;==========================================================================;;;
8
Tom Stellard79243d92014-10-01 17:15:17 +00009; FUNC-LABEL: {{^}}f64_oeq:
Tom Stellard326d6ec2014-11-05 14:50:53 +000010; SI: v_cmp_eq_f64
Tom Stellardc0845332013-11-22 23:07:58 +000011define 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
Tom Stellard79243d92014-10-01 17:15:17 +000019; FUNC-LABEL: {{^}}f64_ogt:
Tom Stellard326d6ec2014-11-05 14:50:53 +000020; SI: v_cmp_gt_f64
Tom Stellardc0845332013-11-22 23:07:58 +000021define 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
Tom Stellard79243d92014-10-01 17:15:17 +000029; FUNC-LABEL: {{^}}f64_oge:
Tom Stellard326d6ec2014-11-05 14:50:53 +000030; SI: v_cmp_ge_f64
Tom Stellardc0845332013-11-22 23:07:58 +000031define 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
Tom Stellard79243d92014-10-01 17:15:17 +000039; FUNC-LABEL: {{^}}f64_olt:
Tom Stellard326d6ec2014-11-05 14:50:53 +000040; SI: v_cmp_lt_f64
Tom Stellardc0845332013-11-22 23:07:58 +000041define 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
Tom Stellard79243d92014-10-01 17:15:17 +000049; FUNC-LABEL: {{^}}f64_ole:
Tom Stellard326d6ec2014-11-05 14:50:53 +000050; SI: v_cmp_le_f64
Tom Stellardc0845332013-11-22 23:07:58 +000051define 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
Tom Stellard79243d92014-10-01 17:15:17 +000059; FUNC-LABEL: {{^}}f64_one:
Matt Arsenault9cded7a2014-12-11 22:15:35 +000060; SI: v_cmp_lg_f64_e32 vcc
61; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
Tom Stellardc0845332013-11-22 23:07:58 +000062define void @f64_one(i32 addrspace(1)* %out, double %a, double %b) {
63entry:
64 %0 = fcmp one double %a, %b
65 %1 = sext i1 %0 to i32
66 store i32 %1, i32 addrspace(1)* %out
67 ret void
68}
69
Tom Stellard79243d92014-10-01 17:15:17 +000070; FUNC-LABEL: {{^}}f64_ord:
Tom Stellard326d6ec2014-11-05 14:50:53 +000071; SI: v_cmp_o_f64
Tom Stellardc0845332013-11-22 23:07:58 +000072define void @f64_ord(i32 addrspace(1)* %out, double %a, double %b) {
73entry:
74 %0 = fcmp ord double %a, %b
75 %1 = sext i1 %0 to i32
76 store i32 %1, i32 addrspace(1)* %out
77 ret void
78}
79
Tom Stellard79243d92014-10-01 17:15:17 +000080; FUNC-LABEL: {{^}}f64_ueq:
Tom Stellard326d6ec2014-11-05 14:50:53 +000081; SI: v_cmp_u_f64
82; SI: v_cmp_eq_f64
Matt Arsenaultbecd6562014-12-03 05:22:35 +000083; SI: s_or_b64
84; SI: v_cndmask_b32
Tom Stellardc0845332013-11-22 23:07:58 +000085define void @f64_ueq(i32 addrspace(1)* %out, double %a, double %b) {
86entry:
87 %0 = fcmp ueq double %a, %b
88 %1 = sext i1 %0 to i32
89 store i32 %1, i32 addrspace(1)* %out
90 ret void
91}
92
Tom Stellard79243d92014-10-01 17:15:17 +000093; FUNC-LABEL: {{^}}f64_ugt:
Tom Stellard326d6ec2014-11-05 14:50:53 +000094; SI: v_cmp_u_f64
95; SI: v_cmp_gt_f64
Matt Arsenaultbecd6562014-12-03 05:22:35 +000096; SI: s_or_b64
97; SI: v_cndmask_b32
Tom Stellardc0845332013-11-22 23:07:58 +000098define void @f64_ugt(i32 addrspace(1)* %out, double %a, double %b) {
99entry:
100 %0 = fcmp ugt double %a, %b
101 %1 = sext i1 %0 to i32
102 store i32 %1, i32 addrspace(1)* %out
103 ret void
104}
105
Tom Stellard79243d92014-10-01 17:15:17 +0000106; FUNC-LABEL: {{^}}f64_uge:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000107; SI: v_cmp_u_f64
108; SI: v_cmp_ge_f64
Matt Arsenaultbecd6562014-12-03 05:22:35 +0000109; SI: s_or_b64
110; SI: v_cndmask_b32
Tom Stellardc0845332013-11-22 23:07:58 +0000111define void @f64_uge(i32 addrspace(1)* %out, double %a, double %b) {
112entry:
113 %0 = fcmp uge double %a, %b
114 %1 = sext i1 %0 to i32
115 store i32 %1, i32 addrspace(1)* %out
116 ret void
117}
118
Tom Stellard79243d92014-10-01 17:15:17 +0000119; FUNC-LABEL: {{^}}f64_ult:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000120; SI: v_cmp_u_f64
121; SI: v_cmp_lt_f64
Matt Arsenaultbecd6562014-12-03 05:22:35 +0000122; SI: s_or_b64
123; SI: v_cndmask_b32
Tom Stellardc0845332013-11-22 23:07:58 +0000124define void @f64_ult(i32 addrspace(1)* %out, double %a, double %b) {
125entry:
126 %0 = fcmp ult double %a, %b
127 %1 = sext i1 %0 to i32
128 store i32 %1, i32 addrspace(1)* %out
129 ret void
130}
131
Tom Stellard79243d92014-10-01 17:15:17 +0000132; FUNC-LABEL: {{^}}f64_ule:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000133; SI: v_cmp_u_f64
134; SI: v_cmp_le_f64
Matt Arsenaultbecd6562014-12-03 05:22:35 +0000135; SI: s_or_b64
136; SI: v_cndmask_b32
Tom Stellardc0845332013-11-22 23:07:58 +0000137define void @f64_ule(i32 addrspace(1)* %out, double %a, double %b) {
138entry:
139 %0 = fcmp ule double %a, %b
140 %1 = sext i1 %0 to i32
141 store i32 %1, i32 addrspace(1)* %out
142 ret void
143}
144
Tom Stellard79243d92014-10-01 17:15:17 +0000145; FUNC-LABEL: {{^}}f64_une:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000146; SI: v_cmp_neq_f64
Tom Stellardc0845332013-11-22 23:07:58 +0000147define void @f64_une(i32 addrspace(1)* %out, double %a, double %b) {
148entry:
149 %0 = fcmp une double %a, %b
150 %1 = sext i1 %0 to i32
151 store i32 %1, i32 addrspace(1)* %out
152 ret void
153}
154
Tom Stellard79243d92014-10-01 17:15:17 +0000155; FUNC-LABEL: {{^}}f64_uno:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000156; SI: v_cmp_u_f64
Tom Stellardc0845332013-11-22 23:07:58 +0000157define void @f64_uno(i32 addrspace(1)* %out, double %a, double %b) {
158entry:
159 %0 = fcmp uno double %a, %b
160 %1 = sext i1 %0 to i32
161 store i32 %1, i32 addrspace(1)* %out
162 ret void
163}
164
165;;;==========================================================================;;;
166;; 64-bit integer comparisons
167;;;==========================================================================;;;
168
Tom Stellard79243d92014-10-01 17:15:17 +0000169; FUNC-LABEL: {{^}}i64_eq:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000170; SI: v_cmp_eq_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000171define void @i64_eq(i32 addrspace(1)* %out, i64 %a, i64 %b) {
172entry:
173 %0 = icmp eq i64 %a, %b
174 %1 = sext i1 %0 to i32
175 store i32 %1, i32 addrspace(1)* %out
176 ret void
177}
178
Tom Stellard79243d92014-10-01 17:15:17 +0000179; FUNC-LABEL: {{^}}i64_ne:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000180; SI: v_cmp_ne_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000181define void @i64_ne(i32 addrspace(1)* %out, i64 %a, i64 %b) {
182entry:
183 %0 = icmp ne i64 %a, %b
184 %1 = sext i1 %0 to i32
185 store i32 %1, i32 addrspace(1)* %out
186 ret void
187}
188
Tom Stellard79243d92014-10-01 17:15:17 +0000189; FUNC-LABEL: {{^}}i64_ugt:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000190; SI: v_cmp_gt_u64
Tom Stellardc0845332013-11-22 23:07:58 +0000191define void @i64_ugt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
192entry:
193 %0 = icmp ugt i64 %a, %b
194 %1 = sext i1 %0 to i32
195 store i32 %1, i32 addrspace(1)* %out
196 ret void
197}
198
Tom Stellard79243d92014-10-01 17:15:17 +0000199; FUNC-LABEL: {{^}}i64_uge:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000200; SI: v_cmp_ge_u64
Tom Stellardc0845332013-11-22 23:07:58 +0000201define void @i64_uge(i32 addrspace(1)* %out, i64 %a, i64 %b) {
202entry:
203 %0 = icmp uge i64 %a, %b
204 %1 = sext i1 %0 to i32
205 store i32 %1, i32 addrspace(1)* %out
206 ret void
207}
208
Tom Stellard79243d92014-10-01 17:15:17 +0000209; FUNC-LABEL: {{^}}i64_ult:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000210; SI: v_cmp_lt_u64
Tom Stellardc0845332013-11-22 23:07:58 +0000211define void @i64_ult(i32 addrspace(1)* %out, i64 %a, i64 %b) {
212entry:
213 %0 = icmp ult i64 %a, %b
214 %1 = sext i1 %0 to i32
215 store i32 %1, i32 addrspace(1)* %out
216 ret void
217}
218
Tom Stellard79243d92014-10-01 17:15:17 +0000219; FUNC-LABEL: {{^}}i64_ule:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000220; SI: v_cmp_le_u64
Tom Stellardc0845332013-11-22 23:07:58 +0000221define void @i64_ule(i32 addrspace(1)* %out, i64 %a, i64 %b) {
222entry:
223 %0 = icmp ule i64 %a, %b
224 %1 = sext i1 %0 to i32
225 store i32 %1, i32 addrspace(1)* %out
226 ret void
227}
228
Tom Stellard79243d92014-10-01 17:15:17 +0000229; FUNC-LABEL: {{^}}i64_sgt:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000230; SI: v_cmp_gt_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000231define void @i64_sgt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
232entry:
233 %0 = icmp sgt i64 %a, %b
234 %1 = sext i1 %0 to i32
235 store i32 %1, i32 addrspace(1)* %out
236 ret void
237}
238
Tom Stellard79243d92014-10-01 17:15:17 +0000239; FUNC-LABEL: {{^}}i64_sge:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000240; SI: v_cmp_ge_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000241define void @i64_sge(i32 addrspace(1)* %out, i64 %a, i64 %b) {
242entry:
243 %0 = icmp sge i64 %a, %b
244 %1 = sext i1 %0 to i32
245 store i32 %1, i32 addrspace(1)* %out
246 ret void
247}
248
Tom Stellard79243d92014-10-01 17:15:17 +0000249; FUNC-LABEL: {{^}}i64_slt:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000250; SI: v_cmp_lt_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000251define void @i64_slt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
252entry:
253 %0 = icmp slt i64 %a, %b
254 %1 = sext i1 %0 to i32
255 store i32 %1, i32 addrspace(1)* %out
256 ret void
257}
258
Tom Stellard79243d92014-10-01 17:15:17 +0000259; FUNC-LABEL: {{^}}i64_sle:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000260; SI: v_cmp_le_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000261define void @i64_sle(i32 addrspace(1)* %out, i64 %a, i64 %b) {
262entry:
263 %0 = icmp sle i64 %a, %b
264 %1 = sext i1 %0 to i32
265 store i32 %1, i32 addrspace(1)* %out
266 ret void
267}