1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-uknown-uknown -verify-machineinstrs -o - %s | FileCheck %s
6 define i1 @cmp_i128_eq(i128 %a, i128 %b) {
7 ; CHECK-LABEL: cmp_i128_eq:
9 ; CHECK-NEXT: cmp x0, x2
10 ; CHECK-NEXT: ccmp x1, x3, #0, eq
11 ; CHECK-NEXT: cset w0, eq
13 %cmp = icmp eq i128 %a, %b
17 define i1 @cmp_i128_ne(i128 %a, i128 %b) {
18 ; CHECK-LABEL: cmp_i128_ne:
20 ; CHECK-NEXT: cmp x0, x2
21 ; CHECK-NEXT: ccmp x1, x3, #0, eq
22 ; CHECK-NEXT: cset w0, ne
24 %cmp = icmp ne i128 %a, %b
28 define i1 @cmp_i128_ugt(i128 %a, i128 %b) {
29 ; CHECK-LABEL: cmp_i128_ugt:
31 ; CHECK-NEXT: cmp x2, x0
32 ; CHECK-NEXT: sbcs xzr, x3, x1
33 ; CHECK-NEXT: cset w0, lo
35 %cmp = icmp ugt i128 %a, %b
39 define i1 @cmp_i128_uge(i128 %a, i128 %b) {
40 ; CHECK-LABEL: cmp_i128_uge:
42 ; CHECK-NEXT: cmp x0, x2
43 ; CHECK-NEXT: sbcs xzr, x1, x3
44 ; CHECK-NEXT: cset w0, hs
46 %cmp = icmp uge i128 %a, %b
50 define i1 @cmp_i128_ult(i128 %a, i128 %b) {
51 ; CHECK-LABEL: cmp_i128_ult:
53 ; CHECK-NEXT: cmp x0, x2
54 ; CHECK-NEXT: sbcs xzr, x1, x3
55 ; CHECK-NEXT: cset w0, lo
57 %cmp = icmp ult i128 %a, %b
61 define i1 @cmp_i128_ule(i128 %a, i128 %b) {
62 ; CHECK-LABEL: cmp_i128_ule:
64 ; CHECK-NEXT: cmp x2, x0
65 ; CHECK-NEXT: sbcs xzr, x3, x1
66 ; CHECK-NEXT: cset w0, hs
68 %cmp = icmp ule i128 %a, %b
72 define i1 @cmp_i128_sgt(i128 %a, i128 %b) {
73 ; CHECK-LABEL: cmp_i128_sgt:
75 ; CHECK-NEXT: cmp x2, x0
76 ; CHECK-NEXT: sbcs xzr, x3, x1
77 ; CHECK-NEXT: cset w0, lt
79 %cmp = icmp sgt i128 %a, %b
83 define i1 @cmp_i128_sge(i128 %a, i128 %b) {
84 ; CHECK-LABEL: cmp_i128_sge:
86 ; CHECK-NEXT: cmp x0, x2
87 ; CHECK-NEXT: sbcs xzr, x1, x3
88 ; CHECK-NEXT: cset w0, ge
90 %cmp = icmp sge i128 %a, %b
94 define i1 @cmp_i128_slt(i128 %a, i128 %b) {
95 ; CHECK-LABEL: cmp_i128_slt:
97 ; CHECK-NEXT: cmp x0, x2
98 ; CHECK-NEXT: sbcs xzr, x1, x3
99 ; CHECK-NEXT: cset w0, lt
101 %cmp = icmp slt i128 %a, %b
105 define i1 @cmp_i128_sle(i128 %a, i128 %b) {
106 ; CHECK-LABEL: cmp_i128_sle:
108 ; CHECK-NEXT: cmp x2, x0
109 ; CHECK-NEXT: sbcs xzr, x3, x1
110 ; CHECK-NEXT: cset w0, ge
112 %cmp = icmp sle i128 %a, %b
116 define void @br_on_cmp_i128_eq(i128 %a, i128 %b) nounwind {
117 ; CHECK-LABEL: br_on_cmp_i128_eq:
119 ; CHECK-NEXT: cmp x1, x3
120 ; CHECK-NEXT: ccmp x0, x2, #0, eq
121 ; CHECK-NEXT: b.ne .LBB10_2
122 ; CHECK-NEXT: // %bb.1: // %call
123 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
124 ; CHECK-NEXT: bl call
125 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
126 ; CHECK-NEXT: .LBB10_2: // %exit
128 %cmp = icmp eq i128 %a, %b
129 br i1 %cmp, label %call, label %exit
137 define void @br_on_cmp_i128_ne(i128 %a, i128 %b) nounwind {
138 ; CHECK-LABEL: br_on_cmp_i128_ne:
140 ; CHECK-NEXT: cmp x1, x3
141 ; CHECK-NEXT: ccmp x0, x2, #0, eq
142 ; CHECK-NEXT: b.eq .LBB11_2
143 ; CHECK-NEXT: // %bb.1: // %call
144 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
145 ; CHECK-NEXT: bl call
146 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
147 ; CHECK-NEXT: .LBB11_2: // %exit
149 %cmp = icmp ne i128 %a, %b
150 br i1 %cmp, label %call, label %exit
158 define void @br_on_cmp_i128_ugt(i128 %a, i128 %b) nounwind {
159 ; CHECK-LABEL: br_on_cmp_i128_ugt:
161 ; CHECK-NEXT: cmp x2, x0
162 ; CHECK-NEXT: sbcs xzr, x3, x1
163 ; CHECK-NEXT: b.hs .LBB12_2
164 ; CHECK-NEXT: // %bb.1: // %call
165 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
166 ; CHECK-NEXT: bl call
167 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
168 ; CHECK-NEXT: .LBB12_2: // %exit
170 %cmp = icmp ugt i128 %a, %b
171 br i1 %cmp, label %call, label %exit
179 define void @br_on_cmp_i128_uge(i128 %a, i128 %b) nounwind {
180 ; CHECK-LABEL: br_on_cmp_i128_uge:
182 ; CHECK-NEXT: cmp x0, x2
183 ; CHECK-NEXT: sbcs xzr, x1, x3
184 ; CHECK-NEXT: b.lo .LBB13_2
185 ; CHECK-NEXT: // %bb.1: // %call
186 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
187 ; CHECK-NEXT: bl call
188 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
189 ; CHECK-NEXT: .LBB13_2: // %exit
191 %cmp = icmp uge i128 %a, %b
192 br i1 %cmp, label %call, label %exit
200 define void @br_on_cmp_i128_ult(i128 %a, i128 %b) nounwind {
201 ; CHECK-LABEL: br_on_cmp_i128_ult:
203 ; CHECK-NEXT: cmp x0, x2
204 ; CHECK-NEXT: sbcs xzr, x1, x3
205 ; CHECK-NEXT: b.hs .LBB14_2
206 ; CHECK-NEXT: // %bb.1: // %call
207 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
208 ; CHECK-NEXT: bl call
209 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
210 ; CHECK-NEXT: .LBB14_2: // %exit
212 %cmp = icmp ult i128 %a, %b
213 br i1 %cmp, label %call, label %exit
221 define void @br_on_cmp_i128_ule(i128 %a, i128 %b) nounwind {
222 ; CHECK-LABEL: br_on_cmp_i128_ule:
224 ; CHECK-NEXT: cmp x2, x0
225 ; CHECK-NEXT: sbcs xzr, x3, x1
226 ; CHECK-NEXT: b.lo .LBB15_2
227 ; CHECK-NEXT: // %bb.1: // %call
228 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
229 ; CHECK-NEXT: bl call
230 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
231 ; CHECK-NEXT: .LBB15_2: // %exit
233 %cmp = icmp ule i128 %a, %b
234 br i1 %cmp, label %call, label %exit
242 define void @br_on_cmp_i128_sgt(i128 %a, i128 %b) nounwind {
243 ; CHECK-LABEL: br_on_cmp_i128_sgt:
245 ; CHECK-NEXT: cmp x2, x0
246 ; CHECK-NEXT: sbcs xzr, x3, x1
247 ; CHECK-NEXT: b.ge .LBB16_2
248 ; CHECK-NEXT: // %bb.1: // %call
249 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
250 ; CHECK-NEXT: bl call
251 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
252 ; CHECK-NEXT: .LBB16_2: // %exit
254 %cmp = icmp sgt i128 %a, %b
255 br i1 %cmp, label %call, label %exit
263 define void @br_on_cmp_i128_sge(i128 %a, i128 %b) nounwind {
264 ; CHECK-LABEL: br_on_cmp_i128_sge:
266 ; CHECK-NEXT: cmp x0, x2
267 ; CHECK-NEXT: sbcs xzr, x1, x3
268 ; CHECK-NEXT: b.lt .LBB17_2
269 ; CHECK-NEXT: // %bb.1: // %call
270 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
271 ; CHECK-NEXT: bl call
272 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
273 ; CHECK-NEXT: .LBB17_2: // %exit
275 %cmp = icmp sge i128 %a, %b
276 br i1 %cmp, label %call, label %exit
284 define void @br_on_cmp_i128_slt(i128 %a, i128 %b) nounwind {
285 ; CHECK-LABEL: br_on_cmp_i128_slt:
287 ; CHECK-NEXT: cmp x0, x2
288 ; CHECK-NEXT: sbcs xzr, x1, x3
289 ; CHECK-NEXT: b.ge .LBB18_2
290 ; CHECK-NEXT: // %bb.1: // %call
291 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
292 ; CHECK-NEXT: bl call
293 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
294 ; CHECK-NEXT: .LBB18_2: // %exit
296 %cmp = icmp slt i128 %a, %b
297 br i1 %cmp, label %call, label %exit
305 define void @br_on_cmp_i128_sle(i128 %a, i128 %b) nounwind {
306 ; CHECK-LABEL: br_on_cmp_i128_sle:
308 ; CHECK-NEXT: cmp x2, x0
309 ; CHECK-NEXT: sbcs xzr, x3, x1
310 ; CHECK-NEXT: b.lt .LBB19_2
311 ; CHECK-NEXT: // %bb.1: // %call
312 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
313 ; CHECK-NEXT: bl call
314 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
315 ; CHECK-NEXT: .LBB19_2: // %exit
317 %cmp = icmp sle i128 %a, %b
318 br i1 %cmp, label %call, label %exit