1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
6 define i32 @and_signbit_shl(i32 %x, i32* %dst) {
7 ; CHECK-LABEL: and_signbit_shl:
9 ; CHECK-NEXT: lsl w8, w0, #8
10 ; CHECK-NEXT: and w0, w8, #0xff000000
11 ; CHECK-NEXT: str w0, [x1]
13 %t0 = and i32 %x, 4294901760 ; 0xFFFF0000
15 store i32 %r, i32* %dst
18 define i32 @and_nosignbit_shl(i32 %x, i32* %dst) {
19 ; CHECK-LABEL: and_nosignbit_shl:
21 ; CHECK-NEXT: lsl w8, w0, #8
22 ; CHECK-NEXT: and w0, w8, #0xff000000
23 ; CHECK-NEXT: str w0, [x1]
25 %t0 = and i32 %x, 2147418112 ; 0x7FFF0000
27 store i32 %r, i32* %dst
31 define i32 @or_signbit_shl(i32 %x, i32* %dst) {
32 ; CHECK-LABEL: or_signbit_shl:
34 ; CHECK-NEXT: lsl w8, w0, #8
35 ; CHECK-NEXT: orr w0, w8, #0xff000000
36 ; CHECK-NEXT: str w0, [x1]
38 %t0 = or i32 %x, 4294901760 ; 0xFFFF0000
40 store i32 %r, i32* %dst
43 define i32 @or_nosignbit_shl(i32 %x, i32* %dst) {
44 ; CHECK-LABEL: or_nosignbit_shl:
46 ; CHECK-NEXT: lsl w8, w0, #8
47 ; CHECK-NEXT: orr w0, w8, #0xff000000
48 ; CHECK-NEXT: str w0, [x1]
50 %t0 = or i32 %x, 2147418112 ; 0x7FFF0000
52 store i32 %r, i32* %dst
56 define i32 @xor_signbit_shl(i32 %x, i32* %dst) {
57 ; CHECK-LABEL: xor_signbit_shl:
59 ; CHECK-NEXT: lsl w8, w0, #8
60 ; CHECK-NEXT: eor w0, w8, #0xff000000
61 ; CHECK-NEXT: str w0, [x1]
63 %t0 = xor i32 %x, 4294901760 ; 0xFFFF0000
65 store i32 %r, i32* %dst
68 define i32 @xor_nosignbit_shl(i32 %x, i32* %dst) {
69 ; CHECK-LABEL: xor_nosignbit_shl:
71 ; CHECK-NEXT: lsl w8, w0, #8
72 ; CHECK-NEXT: eor w0, w8, #0xff000000
73 ; CHECK-NEXT: str w0, [x1]
75 %t0 = xor i32 %x, 2147418112 ; 0x7FFF0000
77 store i32 %r, i32* %dst
81 define i32 @add_signbit_shl(i32 %x, i32* %dst) {
82 ; CHECK-LABEL: add_signbit_shl:
84 ; CHECK-NEXT: mov w8, #-16777216
85 ; CHECK-NEXT: add w0, w8, w0, lsl #8
86 ; CHECK-NEXT: str w0, [x1]
88 %t0 = add i32 %x, 4294901760 ; 0xFFFF0000
90 store i32 %r, i32* %dst
93 define i32 @add_nosignbit_shl(i32 %x, i32* %dst) {
94 ; CHECK-LABEL: add_nosignbit_shl:
96 ; CHECK-NEXT: mov w8, #-16777216
97 ; CHECK-NEXT: add w0, w8, w0, lsl #8
98 ; CHECK-NEXT: str w0, [x1]
100 %t0 = add i32 %x, 2147418112 ; 0x7FFF0000
102 store i32 %r, i32* %dst
106 ; logical shift right
108 define i32 @and_signbit_lshr(i32 %x, i32* %dst) {
109 ; CHECK-LABEL: and_signbit_lshr:
111 ; CHECK-NEXT: lsr w8, w0, #8
112 ; CHECK-NEXT: and w0, w8, #0xffff00
113 ; CHECK-NEXT: str w0, [x1]
115 %t0 = and i32 %x, 4294901760 ; 0xFFFF0000
117 store i32 %r, i32* %dst
120 define i32 @and_nosignbit_lshr(i32 %x, i32* %dst) {
121 ; CHECK-LABEL: and_nosignbit_lshr:
123 ; CHECK-NEXT: lsr w8, w0, #8
124 ; CHECK-NEXT: and w0, w8, #0x7fff00
125 ; CHECK-NEXT: str w0, [x1]
127 %t0 = and i32 %x, 2147418112 ; 0x7FFF0000
129 store i32 %r, i32* %dst
133 define i32 @or_signbit_lshr(i32 %x, i32* %dst) {
134 ; CHECK-LABEL: or_signbit_lshr:
136 ; CHECK-NEXT: lsr w8, w0, #8
137 ; CHECK-NEXT: orr w0, w8, #0xffff00
138 ; CHECK-NEXT: str w0, [x1]
140 %t0 = or i32 %x, 4294901760 ; 0xFFFF0000
142 store i32 %r, i32* %dst
145 define i32 @or_nosignbit_lshr(i32 %x, i32* %dst) {
146 ; CHECK-LABEL: or_nosignbit_lshr:
148 ; CHECK-NEXT: lsr w8, w0, #8
149 ; CHECK-NEXT: orr w0, w8, #0x7fff00
150 ; CHECK-NEXT: str w0, [x1]
152 %t0 = or i32 %x, 2147418112 ; 0x7FFF0000
154 store i32 %r, i32* %dst
158 define i32 @xor_signbit_lshr(i32 %x, i32* %dst) {
159 ; CHECK-LABEL: xor_signbit_lshr:
161 ; CHECK-NEXT: lsr w8, w0, #8
162 ; CHECK-NEXT: eor w0, w8, #0xffff00
163 ; CHECK-NEXT: str w0, [x1]
165 %t0 = xor i32 %x, 4294901760 ; 0xFFFF0000
167 store i32 %r, i32* %dst
170 define i32 @xor_nosignbit_lshr(i32 %x, i32* %dst) {
171 ; CHECK-LABEL: xor_nosignbit_lshr:
173 ; CHECK-NEXT: lsr w8, w0, #8
174 ; CHECK-NEXT: eor w0, w8, #0x7fff00
175 ; CHECK-NEXT: str w0, [x1]
177 %t0 = xor i32 %x, 2147418112 ; 0x7FFF0000
179 store i32 %r, i32* %dst
183 define i32 @add_signbit_lshr(i32 %x, i32* %dst) {
184 ; CHECK-LABEL: add_signbit_lshr:
186 ; CHECK-NEXT: sub w8, w0, #16, lsl #12 // =65536
187 ; CHECK-NEXT: lsr w0, w8, #8
188 ; CHECK-NEXT: str w0, [x1]
190 %t0 = add i32 %x, 4294901760 ; 0xFFFF0000
192 store i32 %r, i32* %dst
195 define i32 @add_nosignbit_lshr(i32 %x, i32* %dst) {
196 ; CHECK-LABEL: add_nosignbit_lshr:
198 ; CHECK-NEXT: mov w8, #2147418112
199 ; CHECK-NEXT: add w8, w0, w8
200 ; CHECK-NEXT: lsr w0, w8, #8
201 ; CHECK-NEXT: str w0, [x1]
203 %t0 = add i32 %x, 2147418112 ; 0x7FFF0000
205 store i32 %r, i32* %dst
209 ; arithmetic shift right
211 define i32 @and_signbit_ashr(i32 %x, i32* %dst) {
212 ; CHECK-LABEL: and_signbit_ashr:
214 ; CHECK-NEXT: asr w8, w0, #8
215 ; CHECK-NEXT: and w0, w8, #0xffffff00
216 ; CHECK-NEXT: str w0, [x1]
218 %t0 = and i32 %x, 4294901760 ; 0xFFFF0000
220 store i32 %r, i32* %dst
223 define i32 @and_nosignbit_ashr(i32 %x, i32* %dst) {
224 ; CHECK-LABEL: and_nosignbit_ashr:
226 ; CHECK-NEXT: lsr w8, w0, #8
227 ; CHECK-NEXT: and w0, w8, #0x7fff00
228 ; CHECK-NEXT: str w0, [x1]
230 %t0 = and i32 %x, 2147418112 ; 0x7FFF0000
232 store i32 %r, i32* %dst
236 define i32 @or_signbit_ashr(i32 %x, i32* %dst) {
237 ; CHECK-LABEL: or_signbit_ashr:
239 ; CHECK-NEXT: lsr w8, w0, #8
240 ; CHECK-NEXT: orr w0, w8, #0xffffff00
241 ; CHECK-NEXT: str w0, [x1]
243 %t0 = or i32 %x, 4294901760 ; 0xFFFF0000
245 store i32 %r, i32* %dst
248 define i32 @or_nosignbit_ashr(i32 %x, i32* %dst) {
249 ; CHECK-LABEL: or_nosignbit_ashr:
251 ; CHECK-NEXT: asr w8, w0, #8
252 ; CHECK-NEXT: orr w0, w8, #0x7fff00
253 ; CHECK-NEXT: str w0, [x1]
255 %t0 = or i32 %x, 2147418112 ; 0x7FFF0000
257 store i32 %r, i32* %dst
261 define i32 @xor_signbit_ashr(i32 %x, i32* %dst) {
262 ; CHECK-LABEL: xor_signbit_ashr:
264 ; CHECK-NEXT: asr w8, w0, #8
265 ; CHECK-NEXT: eor w0, w8, #0xffffff00
266 ; CHECK-NEXT: str w0, [x1]
268 %t0 = xor i32 %x, 4294901760 ; 0xFFFF0000
270 store i32 %r, i32* %dst
273 define i32 @xor_nosignbit_ashr(i32 %x, i32* %dst) {
274 ; CHECK-LABEL: xor_nosignbit_ashr:
276 ; CHECK-NEXT: asr w8, w0, #8
277 ; CHECK-NEXT: eor w0, w8, #0x7fff00
278 ; CHECK-NEXT: str w0, [x1]
280 %t0 = xor i32 %x, 2147418112 ; 0x7FFF0000
282 store i32 %r, i32* %dst
286 define i32 @add_signbit_ashr(i32 %x, i32* %dst) {
287 ; CHECK-LABEL: add_signbit_ashr:
289 ; CHECK-NEXT: sub w8, w0, #16, lsl #12 // =65536
290 ; CHECK-NEXT: asr w0, w8, #8
291 ; CHECK-NEXT: str w0, [x1]
293 %t0 = add i32 %x, 4294901760 ; 0xFFFF0000
295 store i32 %r, i32* %dst
298 define i32 @add_nosignbit_ashr(i32 %x, i32* %dst) {
299 ; CHECK-LABEL: add_nosignbit_ashr:
301 ; CHECK-NEXT: mov w8, #2147418112
302 ; CHECK-NEXT: add w8, w0, w8
303 ; CHECK-NEXT: asr w0, w8, #8
304 ; CHECK-NEXT: str w0, [x1]
306 %t0 = add i32 %x, 2147418112 ; 0x7FFF0000
308 store i32 %r, i32* %dst