1 ; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
2 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
3 target triple = "arm64"
5 define i1 @test_EQ_IllEbT(i64 %a, i64 %b) {
6 ; CHECK-LABEL: test_EQ_IllEbT
8 ; CHECK-NEXT: cset w0, eq
12 %cmp = icmp eq i64 %add, %a
16 define i1 @test_EQ_IliEbT(i64 %a, i32 %b) {
17 ; CHECK-LABEL: test_EQ_IliEbT
18 ; CHECK: cmn x0, w1, sxtw
19 ; CHECK-NEXT: cset w0, eq
22 %conv = sext i32 %b to i64
24 %cmp = icmp eq i64 %conv, %add
28 define i1 @test_EQ_IlsEbT(i64 %a, i16 %b) {
29 ; CHECK-LABEL: test_EQ_IlsEbT
30 ; CHECK: cmn x0, w1, sxth
31 ; CHECK-NEXT: cset w0, eq
34 %conv = sext i16 %b to i64
36 %cmp = icmp eq i64 %conv, %add
40 define i1 @test_EQ_IlcEbT(i64 %a, i8 %b) {
41 ; CHECK-LABEL: test_EQ_IlcEbT
42 ; CHECK: cmn x0, w1, uxtb
43 ; CHECK-NEXT: cset w0, eq
46 %conv = zext i8 %b to i64
48 %cmp = icmp eq i64 %conv, %add
52 define i1 @test_EQ_IilEbT(i32 %a, i64 %b) {
53 ; CHECK-LABEL: test_EQ_IilEbT
54 ; CHECK: cmn x1, w0, sxtw
55 ; CHECK-NEXT: cset w0, eq
58 %conv = sext i32 %a to i64
60 %cmp = icmp eq i64 %conv, %add
64 define i1 @test_EQ_IiiEbT(i32 %a, i32 %b) {
65 ; CHECK-LABEL: test_EQ_IiiEbT
67 ; CHECK-NEXT: cset w0, eq
71 %cmp = icmp eq i32 %add, %a
75 define i1 @test_EQ_IisEbT(i32 %a, i16 %b) {
76 ; CHECK-LABEL: test_EQ_IisEbT
77 ; CHECK: cmn w0, w1, sxth
78 ; CHECK-NEXT: cset w0, eq
81 %conv = sext i16 %b to i32
83 %cmp = icmp eq i32 %conv, %add
87 define i1 @test_EQ_IicEbT(i32 %a, i8 %b) {
88 ; CHECK-LABEL: test_EQ_IicEbT
89 ; CHECK: cmn w0, w1, uxtb
90 ; CHECK-NEXT: cset w0, eq
93 %conv = zext i8 %b to i32
95 %cmp = icmp eq i32 %conv, %add
99 define i1 @test_EQ_IslEbT(i16 %a, i64 %b) {
100 ; CHECK-LABEL: test_EQ_IslEbT
101 ; CHECK: cmn x1, w0, sxth
102 ; CHECK-NEXT: cset w0, eq
105 %conv = sext i16 %a to i64
107 %cmp = icmp eq i64 %conv, %add
111 define i1 @test_EQ_IsiEbT(i16 %a, i32 %b) {
112 ; CHECK-LABEL: test_EQ_IsiEbT
113 ; CHECK: cmn w1, w0, sxth
114 ; CHECK-NEXT: cset w0, eq
117 %conv = sext i16 %a to i32
119 %cmp = icmp eq i32 %conv, %add
123 define i1 @test_EQ_IssEbT(i16 %a, i16 %b) {
124 ; CHECK-LABEL: test_EQ_IssEbT
126 ; CHECK-NEXT: cmn w8, w0, sxth
127 ; CHECK-NEXT: cset w0, eq
130 %conv = sext i16 %a to i32
131 %conv1 = sext i16 %b to i32
132 %add = sub nsw i32 0, %conv1
133 %cmp = icmp eq i32 %conv, %add
137 define i1 @test_EQ_IscEbT(i16 %a, i8 %b) {
138 ; CHECK-LABEL: test_EQ_IscEbT
139 ; CHECK: and w8, w1, #0xff
140 ; CHECK-NEXT: cmn w8, w0, sxth
141 ; CHECK-NEXT: cset w0, eq
144 %conv = sext i16 %a to i32
145 %conv1 = zext i8 %b to i32
146 %add = sub nsw i32 0, %conv1
147 %cmp = icmp eq i32 %conv, %add
151 define i1 @test_EQ_IclEbT(i8 %a, i64 %b) {
152 ; CHECK-LABEL: test_EQ_IclEbT
153 ; CHECK: cmn x1, w0, uxtb
154 ; CHECK-NEXT: cset w0, eq
157 %conv = zext i8 %a to i64
159 %cmp = icmp eq i64 %conv, %add
163 define i1 @test_EQ_IciEbT(i8 %a, i32 %b) {
164 ; CHECK-LABEL: test_EQ_IciEbT
165 ; CHECK: cmn w1, w0, uxtb
166 ; CHECK-NEXT: cset w0, eq
169 %conv = zext i8 %a to i32
171 %cmp = icmp eq i32 %conv, %add
175 define i1 @test_EQ_IcsEbT(i8 %a, i16 %b) {
176 ; CHECK-LABEL: test_EQ_IcsEbT
178 ; CHECK-NEXT: cmn w8, w0, uxtb
179 ; CHECK-NEXT: cset w0, eq
182 %conv = zext i8 %a to i32
183 %conv1 = sext i16 %b to i32
184 %add = sub nsw i32 0, %conv1
185 %cmp = icmp eq i32 %conv, %add
189 define i1 @test_EQ_IccEbT(i8 %a, i8 %b) {
190 ; CHECK-LABEL: test_EQ_IccEbT
191 ; CHECK: and w8, w1, #0xff
192 ; CHECK-NEXT: cmn w8, w0, uxtb
193 ; CHECK-NEXT: cset w0, eq
196 %conv = zext i8 %a to i32
197 %conv1 = zext i8 %b to i32
198 %add = sub nsw i32 0, %conv1
199 %cmp = icmp eq i32 %conv, %add
203 define i1 @test_NE_IllEbT(i64 %a, i64 %b) {
204 ; CHECK-LABEL: test_NE_IllEbT
206 ; CHECK-NEXT: cset w0, ne
210 %cmp = icmp ne i64 %add, %a
214 define i1 @test_NE_IliEbT(i64 %a, i32 %b) {
215 ; CHECK-LABEL: test_NE_IliEbT
216 ; CHECK: cmn x0, w1, sxtw
217 ; CHECK-NEXT: cset w0, ne
220 %conv = sext i32 %b to i64
222 %cmp = icmp ne i64 %conv, %add
226 define i1 @test_NE_IlsEbT(i64 %a, i16 %b) {
227 ; CHECK-LABEL: test_NE_IlsEbT
228 ; CHECK: cmn x0, w1, sxth
229 ; CHECK-NEXT: cset w0, ne
232 %conv = sext i16 %b to i64
234 %cmp = icmp ne i64 %conv, %add
238 define i1 @test_NE_IlcEbT(i64 %a, i8 %b) {
239 ; CHECK-LABEL: test_NE_IlcEbT
240 ; CHECK: cmn x0, w1, uxtb
241 ; CHECK-NEXT: cset w0, ne
244 %conv = zext i8 %b to i64
246 %cmp = icmp ne i64 %conv, %add
250 define i1 @test_NE_IilEbT(i32 %a, i64 %b) {
251 ; CHECK-LABEL: test_NE_IilEbT
252 ; CHECK: cmn x1, w0, sxtw
253 ; CHECK-NEXT: cset w0, ne
256 %conv = sext i32 %a to i64
258 %cmp = icmp ne i64 %conv, %add
262 define i1 @test_NE_IiiEbT(i32 %a, i32 %b) {
263 ; CHECK-LABEL: test_NE_IiiEbT
265 ; CHECK-NEXT: cset w0, ne
269 %cmp = icmp ne i32 %add, %a
273 define i1 @test_NE_IisEbT(i32 %a, i16 %b) {
274 ; CHECK-LABEL: test_NE_IisEbT
275 ; CHECK: cmn w0, w1, sxth
276 ; CHECK-NEXT: cset w0, ne
279 %conv = sext i16 %b to i32
281 %cmp = icmp ne i32 %conv, %add
285 define i1 @test_NE_IicEbT(i32 %a, i8 %b) {
286 ; CHECK-LABEL: test_NE_IicEbT
287 ; CHECK: cmn w0, w1, uxtb
288 ; CHECK-NEXT: cset w0, ne
291 %conv = zext i8 %b to i32
293 %cmp = icmp ne i32 %conv, %add
297 define i1 @test_NE_IslEbT(i16 %a, i64 %b) {
298 ; CHECK-LABEL: test_NE_IslEbT
299 ; CHECK: cmn x1, w0, sxth
300 ; CHECK-NEXT: cset w0, ne
303 %conv = sext i16 %a to i64
305 %cmp = icmp ne i64 %conv, %add
309 define i1 @test_NE_IsiEbT(i16 %a, i32 %b) {
310 ; CHECK-LABEL: test_NE_IsiEbT
311 ; CHECK: cmn w1, w0, sxth
312 ; CHECK-NEXT: cset w0, ne
315 %conv = sext i16 %a to i32
317 %cmp = icmp ne i32 %conv, %add
321 define i1 @test_NE_IssEbT(i16 %a, i16 %b) {
322 ; CHECK-LABEL:test_NE_IssEbT
324 ; CHECK-NEXT: cmn w8, w0, sxth
325 ; CHECK-NEXT: cset w0, ne
328 %conv = sext i16 %a to i32
329 %conv1 = sext i16 %b to i32
330 %add = sub nsw i32 0, %conv1
331 %cmp = icmp ne i32 %conv, %add
335 define i1 @test_NE_IscEbT(i16 %a, i8 %b) {
336 ; CHECK-LABEL:test_NE_IscEbT
337 ; CHECK: and w8, w1, #0xff
338 ; CHECK-NEXT: cmn w8, w0, sxth
339 ; CHECK-NEXT: cset w0, ne
342 %conv = sext i16 %a to i32
343 %conv1 = zext i8 %b to i32
344 %add = sub nsw i32 0, %conv1
345 %cmp = icmp ne i32 %conv, %add
349 define i1 @test_NE_IclEbT(i8 %a, i64 %b) {
350 ; CHECK-LABEL:test_NE_IclEbT
351 ; CHECK: cmn x1, w0, uxtb
352 ; CHECK-NEXT: cset w0, ne
355 %conv = zext i8 %a to i64
357 %cmp = icmp ne i64 %conv, %add
361 define i1 @test_NE_IciEbT(i8 %a, i32 %b) {
362 ; CHECK-LABEL:test_NE_IciEbT
363 ; CHECK: cmn w1, w0, uxtb
364 ; CHECK-NEXT: cset w0, ne
367 %conv = zext i8 %a to i32
369 %cmp = icmp ne i32 %conv, %add
373 define i1 @test_NE_IcsEbT(i8 %a, i16 %b) {
374 ; CHECK-LABEL:test_NE_IcsEbT
376 ; CHECK-NEXT: cmn w8, w0, uxtb
377 ; CHECK-NEXT: cset w0, ne
380 %conv = zext i8 %a to i32
381 %conv1 = sext i16 %b to i32
382 %add = sub nsw i32 0, %conv1
383 %cmp = icmp ne i32 %conv, %add
387 define i1 @test_NE_IccEbT(i8 %a, i8 %b) {
388 ; CHECK-LABEL:test_NE_IccEbT
389 ; CHECK: and w8, w1, #0xff
390 ; CHECK-NEXT: cmn w8, w0, uxtb
391 ; CHECK-NEXT: cset w0, ne
394 %conv = zext i8 %a to i32
395 %conv1 = zext i8 %b to i32
396 %add = sub nsw i32 0, %conv1
397 %cmp = icmp ne i32 %conv, %add