1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -mtriple=aarch64 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3 ; RUN: llc -mtriple=aarch64 -global-isel -global-isel-abort=2 -verify-machineinstrs %s -o - 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5 define i8 @ucmp.8.8(i8 %x, i8 %y) nounwind {
6 ; CHECK-SD-LABEL: ucmp.8.8:
8 ; CHECK-SD-NEXT: and w8, w0, #0xff
9 ; CHECK-SD-NEXT: cmp w8, w1, uxtb
10 ; CHECK-SD-NEXT: cset w8, hi
11 ; CHECK-SD-NEXT: csinv w0, w8, wzr, hs
14 ; CHECK-GI-LABEL: ucmp.8.8:
16 ; CHECK-GI-NEXT: and w8, w0, #0xff
17 ; CHECK-GI-NEXT: and w9, w1, #0xff
18 ; CHECK-GI-NEXT: cmp w8, w9
19 ; CHECK-GI-NEXT: cset w8, hi
20 ; CHECK-GI-NEXT: csinv w0, w8, wzr, hs
22 %1 = call i8 @llvm.ucmp(i8 %x, i8 %y)
26 define i8 @ucmp.8.16(i16 %x, i16 %y) nounwind {
27 ; CHECK-SD-LABEL: ucmp.8.16:
29 ; CHECK-SD-NEXT: and w8, w0, #0xffff
30 ; CHECK-SD-NEXT: cmp w8, w1, uxth
31 ; CHECK-SD-NEXT: cset w8, hi
32 ; CHECK-SD-NEXT: csinv w0, w8, wzr, hs
35 ; CHECK-GI-LABEL: ucmp.8.16:
37 ; CHECK-GI-NEXT: and w8, w0, #0xffff
38 ; CHECK-GI-NEXT: and w9, w1, #0xffff
39 ; CHECK-GI-NEXT: cmp w8, w9
40 ; CHECK-GI-NEXT: cset w8, hi
41 ; CHECK-GI-NEXT: csinv w0, w8, wzr, hs
43 %1 = call i8 @llvm.ucmp(i16 %x, i16 %y)
47 define i8 @ucmp.8.32(i32 %x, i32 %y) nounwind {
48 ; CHECK-LABEL: ucmp.8.32:
50 ; CHECK-NEXT: cmp w0, w1
51 ; CHECK-NEXT: cset w8, hi
52 ; CHECK-NEXT: csinv w0, w8, wzr, hs
54 %1 = call i8 @llvm.ucmp(i32 %x, i32 %y)
58 define i8 @ucmp.8.64(i64 %x, i64 %y) nounwind {
59 ; CHECK-LABEL: ucmp.8.64:
61 ; CHECK-NEXT: cmp x0, x1
62 ; CHECK-NEXT: cset w8, hi
63 ; CHECK-NEXT: csinv w0, w8, wzr, hs
65 %1 = call i8 @llvm.ucmp(i64 %x, i64 %y)
69 define i8 @ucmp.8.128(i128 %x, i128 %y) nounwind {
70 ; CHECK-SD-LABEL: ucmp.8.128:
72 ; CHECK-SD-NEXT: cmp x2, x0
73 ; CHECK-SD-NEXT: sbcs xzr, x3, x1
74 ; CHECK-SD-NEXT: cset w8, lo
75 ; CHECK-SD-NEXT: cmp x0, x2
76 ; CHECK-SD-NEXT: sbcs xzr, x1, x3
77 ; CHECK-SD-NEXT: csinv w0, w8, wzr, hs
80 ; CHECK-GI-LABEL: ucmp.8.128:
82 ; CHECK-GI-NEXT: cmp x1, x3
83 ; CHECK-GI-NEXT: cset w8, hi
84 ; CHECK-GI-NEXT: cmp x0, x2
85 ; CHECK-GI-NEXT: cset w9, hi
86 ; CHECK-GI-NEXT: cmp x1, x3
87 ; CHECK-GI-NEXT: csel w8, w9, w8, eq
88 ; CHECK-GI-NEXT: tst w8, #0x1
89 ; CHECK-GI-NEXT: cset w8, ne
90 ; CHECK-GI-NEXT: cmp x1, x3
91 ; CHECK-GI-NEXT: cset w9, lo
92 ; CHECK-GI-NEXT: cmp x0, x2
93 ; CHECK-GI-NEXT: cset w10, lo
94 ; CHECK-GI-NEXT: cmp x1, x3
95 ; CHECK-GI-NEXT: csel w9, w10, w9, eq
96 ; CHECK-GI-NEXT: tst w9, #0x1
97 ; CHECK-GI-NEXT: csinv w0, w8, wzr, eq
99 %1 = call i8 @llvm.ucmp(i128 %x, i128 %y)
103 define i32 @ucmp.32.32(i32 %x, i32 %y) nounwind {
104 ; CHECK-LABEL: ucmp.32.32:
106 ; CHECK-NEXT: cmp w0, w1
107 ; CHECK-NEXT: cset w8, hi
108 ; CHECK-NEXT: csinv w0, w8, wzr, hs
110 %1 = call i32 @llvm.ucmp(i32 %x, i32 %y)
114 define i32 @ucmp.32.64(i64 %x, i64 %y) nounwind {
115 ; CHECK-LABEL: ucmp.32.64:
117 ; CHECK-NEXT: cmp x0, x1
118 ; CHECK-NEXT: cset w8, hi
119 ; CHECK-NEXT: csinv w0, w8, wzr, hs
121 %1 = call i32 @llvm.ucmp(i64 %x, i64 %y)
125 define i64 @ucmp.64.64(i64 %x, i64 %y) nounwind {
126 ; CHECK-LABEL: ucmp.64.64:
128 ; CHECK-NEXT: cmp x0, x1
129 ; CHECK-NEXT: cset x8, hi
130 ; CHECK-NEXT: csinv x0, x8, xzr, hs
132 %1 = call i64 @llvm.ucmp(i64 %x, i64 %y)
136 define <1 x i64> @ucmp.1.64.65(<1 x i65> %x, <1 x i65> %y) {
137 ; CHECK-SD-LABEL: ucmp.1.64.65:
138 ; CHECK-SD: // %bb.0:
139 ; CHECK-SD-NEXT: and x8, x1, #0x1
140 ; CHECK-SD-NEXT: and x9, x3, #0x1
141 ; CHECK-SD-NEXT: cmp x2, x0
142 ; CHECK-SD-NEXT: sbcs xzr, x9, x8
143 ; CHECK-SD-NEXT: cset x10, lo
144 ; CHECK-SD-NEXT: cmp x0, x2
145 ; CHECK-SD-NEXT: sbcs xzr, x8, x9
146 ; CHECK-SD-NEXT: csinv x8, x10, xzr, hs
147 ; CHECK-SD-NEXT: fmov d0, x8
150 ; CHECK-GI-LABEL: ucmp.1.64.65:
151 ; CHECK-GI: // %bb.0:
152 ; CHECK-GI-NEXT: and x8, x1, #0x1
153 ; CHECK-GI-NEXT: and x9, x3, #0x1
154 ; CHECK-GI-NEXT: cmp x8, x9
155 ; CHECK-GI-NEXT: cset w10, hi
156 ; CHECK-GI-NEXT: cmp x0, x2
157 ; CHECK-GI-NEXT: cset w11, hi
158 ; CHECK-GI-NEXT: cmp x8, x9
159 ; CHECK-GI-NEXT: csel w10, w11, w10, eq
160 ; CHECK-GI-NEXT: tst w10, #0x1
161 ; CHECK-GI-NEXT: cset x10, ne
162 ; CHECK-GI-NEXT: cmp x8, x9
163 ; CHECK-GI-NEXT: cset w11, lo
164 ; CHECK-GI-NEXT: cmp x0, x2
165 ; CHECK-GI-NEXT: cset w12, lo
166 ; CHECK-GI-NEXT: cmp x8, x9
167 ; CHECK-GI-NEXT: csel w8, w12, w11, eq
168 ; CHECK-GI-NEXT: tst w8, #0x1
169 ; CHECK-GI-NEXT: csinv x8, x10, xzr, eq
170 ; CHECK-GI-NEXT: fmov d0, x8
172 %1 = call <1 x i64> @llvm.ucmp(<1 x i65> %x, <1 x i65> %y)