1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
3 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
4 target triple = "arm64"
6 define i1 @test_EQ_IllEbT(i64 %a, i64 %b) {
7 ; CHECK-LABEL: test_EQ_IllEbT:
8 ; CHECK: // %bb.0: // %entry
9 ; CHECK-NEXT: cmn x0, x1
10 ; CHECK-NEXT: cset w0, eq
14 %cmp = icmp eq i64 %add, %a
18 define i1 @test_EQ_IliEbT(i64 %a, i32 %b) {
19 ; CHECK-LABEL: test_EQ_IliEbT:
20 ; CHECK: // %bb.0: // %entry
21 ; CHECK-NEXT: cmn x0, w1, sxtw
22 ; CHECK-NEXT: cset w0, eq
25 %conv = sext i32 %b to i64
27 %cmp = icmp eq i64 %conv, %add
31 define i1 @test_EQ_IlsEbT(i64 %a, i16 %b) {
32 ; CHECK-LABEL: test_EQ_IlsEbT:
33 ; CHECK: // %bb.0: // %entry
34 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
35 ; CHECK-NEXT: cmn x0, w1, sxth
36 ; CHECK-NEXT: cset w0, eq
39 %conv = sext i16 %b to i64
41 %cmp = icmp eq i64 %conv, %add
45 define i1 @test_EQ_IlcEbT(i64 %a, i8 %b) {
46 ; CHECK-LABEL: test_EQ_IlcEbT:
47 ; CHECK: // %bb.0: // %entry
48 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
49 ; CHECK-NEXT: cmn x0, w1, uxtb
50 ; CHECK-NEXT: cset w0, eq
53 %conv = zext i8 %b to i64
55 %cmp = icmp eq i64 %conv, %add
59 define i1 @test_EQ_IilEbT(i32 %a, i64 %b) {
60 ; CHECK-LABEL: test_EQ_IilEbT:
61 ; CHECK: // %bb.0: // %entry
62 ; CHECK-NEXT: cmn x1, w0, sxtw
63 ; CHECK-NEXT: cset w0, eq
66 %conv = sext i32 %a to i64
68 %cmp = icmp eq i64 %conv, %add
72 define i1 @test_EQ_IiiEbT(i32 %a, i32 %b) {
73 ; CHECK-LABEL: test_EQ_IiiEbT:
74 ; CHECK: // %bb.0: // %entry
75 ; CHECK-NEXT: cmn w0, w1
76 ; CHECK-NEXT: cset w0, eq
80 %cmp = icmp eq i32 %add, %a
84 define i1 @test_EQ_IisEbT(i32 %a, i16 %b) {
85 ; CHECK-LABEL: test_EQ_IisEbT:
86 ; CHECK: // %bb.0: // %entry
87 ; CHECK-NEXT: cmn w0, w1, sxth
88 ; CHECK-NEXT: cset w0, eq
91 %conv = sext i16 %b to i32
93 %cmp = icmp eq i32 %conv, %add
97 define i1 @test_EQ_IicEbT(i32 %a, i8 %b) {
98 ; CHECK-LABEL: test_EQ_IicEbT:
99 ; CHECK: // %bb.0: // %entry
100 ; CHECK-NEXT: cmn w0, w1, uxtb
101 ; CHECK-NEXT: cset w0, eq
104 %conv = zext i8 %b to i32
106 %cmp = icmp eq i32 %conv, %add
110 define i1 @test_EQ_IslEbT(i16 %a, i64 %b) {
111 ; CHECK-LABEL: test_EQ_IslEbT:
112 ; CHECK: // %bb.0: // %entry
113 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
114 ; CHECK-NEXT: cmn x1, w0, sxth
115 ; CHECK-NEXT: cset w0, eq
118 %conv = sext i16 %a to i64
120 %cmp = icmp eq i64 %conv, %add
124 define i1 @test_EQ_IsiEbT(i16 %a, i32 %b) {
125 ; CHECK-LABEL: test_EQ_IsiEbT:
126 ; CHECK: // %bb.0: // %entry
127 ; CHECK-NEXT: cmn w1, w0, sxth
128 ; CHECK-NEXT: cset w0, eq
131 %conv = sext i16 %a to i32
133 %cmp = icmp eq i32 %conv, %add
137 define i1 @test_EQ_IssEbT(i16 %a, i16 %b) {
138 ; CHECK-LABEL: test_EQ_IssEbT:
139 ; CHECK: // %bb.0: // %entry
140 ; CHECK-NEXT: sxth w8, w0
141 ; CHECK-NEXT: cmn w8, w1, sxth
142 ; CHECK-NEXT: cset w0, eq
145 %conv = sext i16 %a to i32
146 %conv1 = sext i16 %b to i32
147 %add = sub nsw i32 0, %conv1
148 %cmp = icmp eq i32 %conv, %add
152 define i1 @test_EQ_IscEbT(i16 %a, i8 %b) {
153 ; CHECK-LABEL: test_EQ_IscEbT:
154 ; CHECK: // %bb.0: // %entry
155 ; CHECK-NEXT: sxth w8, w0
156 ; CHECK-NEXT: cmn w8, w1, uxtb
157 ; CHECK-NEXT: cset w0, eq
160 %conv = sext i16 %a to i32
161 %conv1 = zext i8 %b to i32
162 %add = sub nsw i32 0, %conv1
163 %cmp = icmp eq i32 %conv, %add
167 define i1 @test_EQ_IclEbT(i8 %a, i64 %b) {
168 ; CHECK-LABEL: test_EQ_IclEbT:
169 ; CHECK: // %bb.0: // %entry
170 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
171 ; CHECK-NEXT: cmn x1, w0, uxtb
172 ; CHECK-NEXT: cset w0, eq
175 %conv = zext i8 %a to i64
177 %cmp = icmp eq i64 %conv, %add
181 define i1 @test_EQ_IciEbT(i8 %a, i32 %b) {
182 ; CHECK-LABEL: test_EQ_IciEbT:
183 ; CHECK: // %bb.0: // %entry
184 ; CHECK-NEXT: cmn w1, w0, uxtb
185 ; CHECK-NEXT: cset w0, eq
188 %conv = zext i8 %a to i32
190 %cmp = icmp eq i32 %conv, %add
194 define i1 @test_EQ_IcsEbT(i8 %a, i16 %b) {
195 ; CHECK-LABEL: test_EQ_IcsEbT:
196 ; CHECK: // %bb.0: // %entry
197 ; CHECK-NEXT: and w8, w0, #0xff
198 ; CHECK-NEXT: cmn w8, w1, sxth
199 ; CHECK-NEXT: cset w0, eq
202 %conv = zext i8 %a to i32
203 %conv1 = sext i16 %b to i32
204 %add = sub nsw i32 0, %conv1
205 %cmp = icmp eq i32 %conv, %add
209 define i1 @test_EQ_IccEbT(i8 %a, i8 %b) {
210 ; CHECK-LABEL: test_EQ_IccEbT:
211 ; CHECK: // %bb.0: // %entry
212 ; CHECK-NEXT: and w8, w0, #0xff
213 ; CHECK-NEXT: cmn w8, w1, uxtb
214 ; CHECK-NEXT: cset w0, eq
217 %conv = zext i8 %a to i32
218 %conv1 = zext i8 %b to i32
219 %add = sub nsw i32 0, %conv1
220 %cmp = icmp eq i32 %conv, %add
224 define i1 @test_NE_IllEbT(i64 %a, i64 %b) {
225 ; CHECK-LABEL: test_NE_IllEbT:
226 ; CHECK: // %bb.0: // %entry
227 ; CHECK-NEXT: cmn x0, x1
228 ; CHECK-NEXT: cset w0, ne
232 %cmp = icmp ne i64 %add, %a
236 define i1 @test_NE_IliEbT(i64 %a, i32 %b) {
237 ; CHECK-LABEL: test_NE_IliEbT:
238 ; CHECK: // %bb.0: // %entry
239 ; CHECK-NEXT: cmn x0, w1, sxtw
240 ; CHECK-NEXT: cset w0, ne
243 %conv = sext i32 %b to i64
245 %cmp = icmp ne i64 %conv, %add
249 define i1 @test_NE_IlsEbT(i64 %a, i16 %b) {
250 ; CHECK-LABEL: test_NE_IlsEbT:
251 ; CHECK: // %bb.0: // %entry
252 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
253 ; CHECK-NEXT: cmn x0, w1, sxth
254 ; CHECK-NEXT: cset w0, ne
257 %conv = sext i16 %b to i64
259 %cmp = icmp ne i64 %conv, %add
263 define i1 @test_NE_IlcEbT(i64 %a, i8 %b) {
264 ; CHECK-LABEL: test_NE_IlcEbT:
265 ; CHECK: // %bb.0: // %entry
266 ; CHECK-NEXT: // kill: def $w1 killed $w1 def $x1
267 ; CHECK-NEXT: cmn x0, w1, uxtb
268 ; CHECK-NEXT: cset w0, ne
271 %conv = zext i8 %b to i64
273 %cmp = icmp ne i64 %conv, %add
277 define i1 @test_NE_IilEbT(i32 %a, i64 %b) {
278 ; CHECK-LABEL: test_NE_IilEbT:
279 ; CHECK: // %bb.0: // %entry
280 ; CHECK-NEXT: cmn x1, w0, sxtw
281 ; CHECK-NEXT: cset w0, ne
284 %conv = sext i32 %a to i64
286 %cmp = icmp ne i64 %conv, %add
290 define i1 @test_NE_IiiEbT(i32 %a, i32 %b) {
291 ; CHECK-LABEL: test_NE_IiiEbT:
292 ; CHECK: // %bb.0: // %entry
293 ; CHECK-NEXT: cmn w0, w1
294 ; CHECK-NEXT: cset w0, ne
298 %cmp = icmp ne i32 %add, %a
302 define i1 @test_NE_IisEbT(i32 %a, i16 %b) {
303 ; CHECK-LABEL: test_NE_IisEbT:
304 ; CHECK: // %bb.0: // %entry
305 ; CHECK-NEXT: cmn w0, w1, sxth
306 ; CHECK-NEXT: cset w0, ne
309 %conv = sext i16 %b to i32
311 %cmp = icmp ne i32 %conv, %add
315 define i1 @test_NE_IicEbT(i32 %a, i8 %b) {
316 ; CHECK-LABEL: test_NE_IicEbT:
317 ; CHECK: // %bb.0: // %entry
318 ; CHECK-NEXT: cmn w0, w1, uxtb
319 ; CHECK-NEXT: cset w0, ne
322 %conv = zext i8 %b to i32
324 %cmp = icmp ne i32 %conv, %add
328 define i1 @test_NE_IslEbT(i16 %a, i64 %b) {
329 ; CHECK-LABEL: test_NE_IslEbT:
330 ; CHECK: // %bb.0: // %entry
331 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
332 ; CHECK-NEXT: cmn x1, w0, sxth
333 ; CHECK-NEXT: cset w0, ne
336 %conv = sext i16 %a to i64
338 %cmp = icmp ne i64 %conv, %add
342 define i1 @test_NE_IsiEbT(i16 %a, i32 %b) {
343 ; CHECK-LABEL: test_NE_IsiEbT:
344 ; CHECK: // %bb.0: // %entry
345 ; CHECK-NEXT: cmn w1, w0, sxth
346 ; CHECK-NEXT: cset w0, ne
349 %conv = sext i16 %a to i32
351 %cmp = icmp ne i32 %conv, %add
355 define i1 @test_NE_IssEbT(i16 %a, i16 %b) {
356 ; CHECK-LABEL: test_NE_IssEbT:
357 ; CHECK: // %bb.0: // %entry
358 ; CHECK-NEXT: sxth w8, w0
359 ; CHECK-NEXT: cmn w8, w1, sxth
360 ; CHECK-NEXT: cset w0, ne
363 %conv = sext i16 %a to i32
364 %conv1 = sext i16 %b to i32
365 %add = sub nsw i32 0, %conv1
366 %cmp = icmp ne i32 %conv, %add
370 define i1 @test_NE_IscEbT(i16 %a, i8 %b) {
371 ; CHECK-LABEL: test_NE_IscEbT:
372 ; CHECK: // %bb.0: // %entry
373 ; CHECK-NEXT: sxth w8, w0
374 ; CHECK-NEXT: cmn w8, w1, uxtb
375 ; CHECK-NEXT: cset w0, ne
378 %conv = sext i16 %a to i32
379 %conv1 = zext i8 %b to i32
380 %add = sub nsw i32 0, %conv1
381 %cmp = icmp ne i32 %conv, %add
385 define i1 @test_NE_IclEbT(i8 %a, i64 %b) {
386 ; CHECK-LABEL: test_NE_IclEbT:
387 ; CHECK: // %bb.0: // %entry
388 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
389 ; CHECK-NEXT: cmn x1, w0, uxtb
390 ; CHECK-NEXT: cset w0, ne
393 %conv = zext i8 %a to i64
395 %cmp = icmp ne i64 %conv, %add
399 define i1 @test_NE_IciEbT(i8 %a, i32 %b) {
400 ; CHECK-LABEL: test_NE_IciEbT:
401 ; CHECK: // %bb.0: // %entry
402 ; CHECK-NEXT: cmn w1, w0, uxtb
403 ; CHECK-NEXT: cset w0, ne
406 %conv = zext i8 %a to i32
408 %cmp = icmp ne i32 %conv, %add
412 define i1 @test_NE_IcsEbT(i8 %a, i16 %b) {
413 ; CHECK-LABEL: test_NE_IcsEbT:
414 ; CHECK: // %bb.0: // %entry
415 ; CHECK-NEXT: and w8, w0, #0xff
416 ; CHECK-NEXT: cmn w8, w1, sxth
417 ; CHECK-NEXT: cset w0, ne
420 %conv = zext i8 %a to i32
421 %conv1 = sext i16 %b to i32
422 %add = sub nsw i32 0, %conv1
423 %cmp = icmp ne i32 %conv, %add
427 define i1 @test_NE_IccEbT(i8 %a, i8 %b) {
428 ; CHECK-LABEL: test_NE_IccEbT:
429 ; CHECK: // %bb.0: // %entry
430 ; CHECK-NEXT: and w8, w0, #0xff
431 ; CHECK-NEXT: cmn w8, w1, uxtb
432 ; CHECK-NEXT: cset w0, ne
435 %conv = zext i8 %a to i32
436 %conv1 = zext i8 %b to i32
437 %add = sub nsw i32 0, %conv1
438 %cmp = icmp ne i32 %conv, %add