1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64
3 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X32
7 define i32 @and_signbit_select_shl(i32 %x, i1 %cond, ptr %dst) {
8 ; X64-LABEL: and_signbit_select_shl:
10 ; X64-NEXT: movl %edi, %eax
11 ; X64-NEXT: andl $16711680, %eax # imm = 0xFF0000
12 ; X64-NEXT: testb $1, %sil
13 ; X64-NEXT: cmovel %edi, %eax
14 ; X64-NEXT: shll $8, %eax
15 ; X64-NEXT: movl %eax, (%rdx)
18 ; X32-LABEL: and_signbit_select_shl:
20 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
21 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
22 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
23 ; X32-NEXT: je .LBB0_2
25 ; X32-NEXT: andl $16711680, %eax # imm = 0xFF0000
27 ; X32-NEXT: shll $8, %eax
28 ; X32-NEXT: movl %eax, (%ecx)
30 %t0 = and i32 %x, 4294901760 ; 0xFFFF0000
31 %t1 = select i1 %cond, i32 %t0, i32 %x
33 store i32 %r, ptr %dst
36 define i32 @and_nosignbit_select_shl(i32 %x, i1 %cond, ptr %dst) {
37 ; X64-LABEL: and_nosignbit_select_shl:
39 ; X64-NEXT: movl %edi, %eax
40 ; X64-NEXT: andl $16711680, %eax # imm = 0xFF0000
41 ; X64-NEXT: testb $1, %sil
42 ; X64-NEXT: cmovel %edi, %eax
43 ; X64-NEXT: shll $8, %eax
44 ; X64-NEXT: movl %eax, (%rdx)
47 ; X32-LABEL: and_nosignbit_select_shl:
49 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
50 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
51 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
52 ; X32-NEXT: je .LBB1_2
54 ; X32-NEXT: andl $16711680, %eax # imm = 0xFF0000
56 ; X32-NEXT: shll $8, %eax
57 ; X32-NEXT: movl %eax, (%ecx)
59 %t0 = and i32 %x, 2147418112 ; 0x7FFF0000
60 %t1 = select i1 %cond, i32 %t0, i32 %x
62 store i32 %r, ptr %dst
66 define i32 @or_signbit_select_shl(i32 %x, i1 %cond, ptr %dst) {
67 ; X64-LABEL: or_signbit_select_shl:
69 ; X64-NEXT: movl %edi, %eax
70 ; X64-NEXT: orl $16711680, %eax # imm = 0xFF0000
71 ; X64-NEXT: testb $1, %sil
72 ; X64-NEXT: cmovel %edi, %eax
73 ; X64-NEXT: shll $8, %eax
74 ; X64-NEXT: movl %eax, (%rdx)
77 ; X32-LABEL: or_signbit_select_shl:
79 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
80 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
81 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
82 ; X32-NEXT: je .LBB2_2
84 ; X32-NEXT: orl $16711680, %eax # imm = 0xFF0000
86 ; X32-NEXT: shll $8, %eax
87 ; X32-NEXT: movl %eax, (%ecx)
89 %t0 = or i32 %x, 4294901760 ; 0xFFFF0000
90 %t1 = select i1 %cond, i32 %t0, i32 %x
92 store i32 %r, ptr %dst
95 define i32 @or_nosignbit_select_shl(i32 %x, i1 %cond, ptr %dst) {
96 ; X64-LABEL: or_nosignbit_select_shl:
98 ; X64-NEXT: movl %edi, %eax
99 ; X64-NEXT: orl $16711680, %eax # imm = 0xFF0000
100 ; X64-NEXT: testb $1, %sil
101 ; X64-NEXT: cmovel %edi, %eax
102 ; X64-NEXT: shll $8, %eax
103 ; X64-NEXT: movl %eax, (%rdx)
106 ; X32-LABEL: or_nosignbit_select_shl:
108 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
109 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
110 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
111 ; X32-NEXT: je .LBB3_2
113 ; X32-NEXT: orl $16711680, %eax # imm = 0xFF0000
115 ; X32-NEXT: shll $8, %eax
116 ; X32-NEXT: movl %eax, (%ecx)
118 %t0 = or i32 %x, 2147418112 ; 0x7FFF0000
119 %t1 = select i1 %cond, i32 %t0, i32 %x
121 store i32 %r, ptr %dst
125 define i32 @xor_signbit_select_shl(i32 %x, i1 %cond, ptr %dst) {
126 ; X64-LABEL: xor_signbit_select_shl:
128 ; X64-NEXT: movl %edi, %eax
129 ; X64-NEXT: xorl $16711680, %eax # imm = 0xFF0000
130 ; X64-NEXT: testb $1, %sil
131 ; X64-NEXT: cmovel %edi, %eax
132 ; X64-NEXT: shll $8, %eax
133 ; X64-NEXT: movl %eax, (%rdx)
136 ; X32-LABEL: xor_signbit_select_shl:
138 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
139 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
140 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
141 ; X32-NEXT: je .LBB4_2
143 ; X32-NEXT: xorl $16711680, %eax # imm = 0xFF0000
145 ; X32-NEXT: shll $8, %eax
146 ; X32-NEXT: movl %eax, (%ecx)
148 %t0 = xor i32 %x, 4294901760 ; 0xFFFF0000
149 %t1 = select i1 %cond, i32 %t0, i32 %x
151 store i32 %r, ptr %dst
154 define i32 @xor_nosignbit_select_shl(i32 %x, i1 %cond, ptr %dst) {
155 ; X64-LABEL: xor_nosignbit_select_shl:
157 ; X64-NEXT: movl %edi, %eax
158 ; X64-NEXT: xorl $16711680, %eax # imm = 0xFF0000
159 ; X64-NEXT: testb $1, %sil
160 ; X64-NEXT: cmovel %edi, %eax
161 ; X64-NEXT: shll $8, %eax
162 ; X64-NEXT: movl %eax, (%rdx)
165 ; X32-LABEL: xor_nosignbit_select_shl:
167 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
168 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
169 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
170 ; X32-NEXT: je .LBB5_2
172 ; X32-NEXT: xorl $16711680, %eax # imm = 0xFF0000
174 ; X32-NEXT: shll $8, %eax
175 ; X32-NEXT: movl %eax, (%ecx)
177 %t0 = xor i32 %x, 2147418112 ; 0x7FFF0000
178 %t1 = select i1 %cond, i32 %t0, i32 %x
180 store i32 %r, ptr %dst
184 define i32 @add_signbit_select_shl(i32 %x, i1 %cond, ptr %dst) {
185 ; X64-LABEL: add_signbit_select_shl:
187 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
188 ; X64-NEXT: leal -65536(%rdi), %eax
189 ; X64-NEXT: testb $1, %sil
190 ; X64-NEXT: cmovel %edi, %eax
191 ; X64-NEXT: shll $8, %eax
192 ; X64-NEXT: movl %eax, (%rdx)
195 ; X32-LABEL: add_signbit_select_shl:
197 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
198 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
199 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
200 ; X32-NEXT: je .LBB6_2
202 ; X32-NEXT: addl $-65536, %eax # imm = 0xFFFF0000
204 ; X32-NEXT: shll $8, %eax
205 ; X32-NEXT: movl %eax, (%ecx)
207 %t0 = add i32 %x, 4294901760 ; 0xFFFF0000
208 %t1 = select i1 %cond, i32 %t0, i32 %x
210 store i32 %r, ptr %dst
213 define i32 @add_nosignbit_select_shl(i32 %x, i1 %cond, ptr %dst) {
214 ; X64-LABEL: add_nosignbit_select_shl:
216 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
217 ; X64-NEXT: leal 2147418112(%rdi), %eax
218 ; X64-NEXT: testb $1, %sil
219 ; X64-NEXT: cmovel %edi, %eax
220 ; X64-NEXT: shll $8, %eax
221 ; X64-NEXT: movl %eax, (%rdx)
224 ; X32-LABEL: add_nosignbit_select_shl:
226 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
227 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
228 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
229 ; X32-NEXT: je .LBB7_2
231 ; X32-NEXT: addl $2147418112, %eax # imm = 0x7FFF0000
233 ; X32-NEXT: shll $8, %eax
234 ; X32-NEXT: movl %eax, (%ecx)
236 %t0 = add i32 %x, 2147418112 ; 0x7FFF0000
237 %t1 = select i1 %cond, i32 %t0, i32 %x
239 store i32 %r, ptr %dst
243 ; logical shift right
245 define i32 @and_signbit_select_lshr(i32 %x, i1 %cond, ptr %dst) {
246 ; X64-LABEL: and_signbit_select_lshr:
248 ; X64-NEXT: movl %edi, %eax
249 ; X64-NEXT: andl $-65536, %eax # imm = 0xFFFF0000
250 ; X64-NEXT: testb $1, %sil
251 ; X64-NEXT: cmovel %edi, %eax
252 ; X64-NEXT: shrl $8, %eax
253 ; X64-NEXT: movl %eax, (%rdx)
256 ; X32-LABEL: and_signbit_select_lshr:
258 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
259 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
260 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
261 ; X32-NEXT: je .LBB8_2
263 ; X32-NEXT: andl $-65536, %eax # imm = 0xFFFF0000
265 ; X32-NEXT: shrl $8, %eax
266 ; X32-NEXT: movl %eax, (%ecx)
268 %t0 = and i32 %x, 4294901760 ; 0xFFFF0000
269 %t1 = select i1 %cond, i32 %t0, i32 %x
271 store i32 %r, ptr %dst
274 define i32 @and_nosignbit_select_lshr(i32 %x, i1 %cond, ptr %dst) {
275 ; X64-LABEL: and_nosignbit_select_lshr:
277 ; X64-NEXT: movl %edi, %eax
278 ; X64-NEXT: andl $2147418112, %eax # imm = 0x7FFF0000
279 ; X64-NEXT: testb $1, %sil
280 ; X64-NEXT: cmovel %edi, %eax
281 ; X64-NEXT: shrl $8, %eax
282 ; X64-NEXT: movl %eax, (%rdx)
285 ; X32-LABEL: and_nosignbit_select_lshr:
287 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
288 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
289 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
290 ; X32-NEXT: je .LBB9_2
292 ; X32-NEXT: andl $2147418112, %eax # imm = 0x7FFF0000
294 ; X32-NEXT: shrl $8, %eax
295 ; X32-NEXT: movl %eax, (%ecx)
297 %t0 = and i32 %x, 2147418112 ; 0x7FFF0000
298 %t1 = select i1 %cond, i32 %t0, i32 %x
300 store i32 %r, ptr %dst
304 define i32 @or_signbit_select_lshr(i32 %x, i1 %cond, ptr %dst) {
305 ; X64-LABEL: or_signbit_select_lshr:
307 ; X64-NEXT: movl %edi, %eax
308 ; X64-NEXT: orl $-65536, %eax # imm = 0xFFFF0000
309 ; X64-NEXT: testb $1, %sil
310 ; X64-NEXT: cmovel %edi, %eax
311 ; X64-NEXT: shrl $8, %eax
312 ; X64-NEXT: movl %eax, (%rdx)
315 ; X32-LABEL: or_signbit_select_lshr:
317 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
318 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
319 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
320 ; X32-NEXT: je .LBB10_2
322 ; X32-NEXT: orl $-65536, %eax # imm = 0xFFFF0000
323 ; X32-NEXT: .LBB10_2:
324 ; X32-NEXT: shrl $8, %eax
325 ; X32-NEXT: movl %eax, (%ecx)
327 %t0 = or i32 %x, 4294901760 ; 0xFFFF0000
328 %t1 = select i1 %cond, i32 %t0, i32 %x
330 store i32 %r, ptr %dst
333 define i32 @or_nosignbit_select_lshr(i32 %x, i1 %cond, ptr %dst) {
334 ; X64-LABEL: or_nosignbit_select_lshr:
336 ; X64-NEXT: movl %edi, %eax
337 ; X64-NEXT: orl $2147418112, %eax # imm = 0x7FFF0000
338 ; X64-NEXT: testb $1, %sil
339 ; X64-NEXT: cmovel %edi, %eax
340 ; X64-NEXT: shrl $8, %eax
341 ; X64-NEXT: movl %eax, (%rdx)
344 ; X32-LABEL: or_nosignbit_select_lshr:
346 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
347 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
348 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
349 ; X32-NEXT: je .LBB11_2
351 ; X32-NEXT: orl $2147418112, %eax # imm = 0x7FFF0000
352 ; X32-NEXT: .LBB11_2:
353 ; X32-NEXT: shrl $8, %eax
354 ; X32-NEXT: movl %eax, (%ecx)
356 %t0 = or i32 %x, 2147418112 ; 0x7FFF0000
357 %t1 = select i1 %cond, i32 %t0, i32 %x
359 store i32 %r, ptr %dst
363 define i32 @xor_signbit_select_lshr(i32 %x, i1 %cond, ptr %dst) {
364 ; X64-LABEL: xor_signbit_select_lshr:
366 ; X64-NEXT: movl %edi, %eax
367 ; X64-NEXT: xorl $-65536, %eax # imm = 0xFFFF0000
368 ; X64-NEXT: testb $1, %sil
369 ; X64-NEXT: cmovel %edi, %eax
370 ; X64-NEXT: shrl $8, %eax
371 ; X64-NEXT: movl %eax, (%rdx)
374 ; X32-LABEL: xor_signbit_select_lshr:
376 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
377 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
378 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
379 ; X32-NEXT: je .LBB12_2
381 ; X32-NEXT: xorl $-65536, %eax # imm = 0xFFFF0000
382 ; X32-NEXT: .LBB12_2:
383 ; X32-NEXT: shrl $8, %eax
384 ; X32-NEXT: movl %eax, (%ecx)
386 %t0 = xor i32 %x, 4294901760 ; 0xFFFF0000
387 %t1 = select i1 %cond, i32 %t0, i32 %x
389 store i32 %r, ptr %dst
392 define i32 @xor_nosignbit_select_lshr(i32 %x, i1 %cond, ptr %dst) {
393 ; X64-LABEL: xor_nosignbit_select_lshr:
395 ; X64-NEXT: movl %edi, %eax
396 ; X64-NEXT: xorl $2147418112, %eax # imm = 0x7FFF0000
397 ; X64-NEXT: testb $1, %sil
398 ; X64-NEXT: cmovel %edi, %eax
399 ; X64-NEXT: shrl $8, %eax
400 ; X64-NEXT: movl %eax, (%rdx)
403 ; X32-LABEL: xor_nosignbit_select_lshr:
405 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
406 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
407 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
408 ; X32-NEXT: je .LBB13_2
410 ; X32-NEXT: xorl $2147418112, %eax # imm = 0x7FFF0000
411 ; X32-NEXT: .LBB13_2:
412 ; X32-NEXT: shrl $8, %eax
413 ; X32-NEXT: movl %eax, (%ecx)
415 %t0 = xor i32 %x, 2147418112 ; 0x7FFF0000
416 %t1 = select i1 %cond, i32 %t0, i32 %x
418 store i32 %r, ptr %dst
422 define i32 @add_signbit_select_lshr(i32 %x, i1 %cond, ptr %dst) {
423 ; X64-LABEL: add_signbit_select_lshr:
425 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
426 ; X64-NEXT: leal -65536(%rdi), %eax
427 ; X64-NEXT: testb $1, %sil
428 ; X64-NEXT: cmovel %edi, %eax
429 ; X64-NEXT: shrl $8, %eax
430 ; X64-NEXT: movl %eax, (%rdx)
433 ; X32-LABEL: add_signbit_select_lshr:
435 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
436 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
437 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
438 ; X32-NEXT: je .LBB14_2
440 ; X32-NEXT: addl $-65536, %eax # imm = 0xFFFF0000
441 ; X32-NEXT: .LBB14_2:
442 ; X32-NEXT: shrl $8, %eax
443 ; X32-NEXT: movl %eax, (%ecx)
445 %t0 = add i32 %x, 4294901760 ; 0xFFFF0000
446 %t1 = select i1 %cond, i32 %t0, i32 %x
448 store i32 %r, ptr %dst
451 define i32 @add_nosignbit_select_lshr(i32 %x, i1 %cond, ptr %dst) {
452 ; X64-LABEL: add_nosignbit_select_lshr:
454 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
455 ; X64-NEXT: leal 2147418112(%rdi), %eax
456 ; X64-NEXT: testb $1, %sil
457 ; X64-NEXT: cmovel %edi, %eax
458 ; X64-NEXT: shrl $8, %eax
459 ; X64-NEXT: movl %eax, (%rdx)
462 ; X32-LABEL: add_nosignbit_select_lshr:
464 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
465 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
466 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
467 ; X32-NEXT: je .LBB15_2
469 ; X32-NEXT: addl $2147418112, %eax # imm = 0x7FFF0000
470 ; X32-NEXT: .LBB15_2:
471 ; X32-NEXT: shrl $8, %eax
472 ; X32-NEXT: movl %eax, (%ecx)
474 %t0 = add i32 %x, 2147418112 ; 0x7FFF0000
475 %t1 = select i1 %cond, i32 %t0, i32 %x
477 store i32 %r, ptr %dst
481 ; arithmetic shift right
483 define i32 @and_signbit_select_ashr(i32 %x, i1 %cond, ptr %dst) {
484 ; X64-LABEL: and_signbit_select_ashr:
486 ; X64-NEXT: movl %edi, %eax
487 ; X64-NEXT: andl $-65536, %eax # imm = 0xFFFF0000
488 ; X64-NEXT: testb $1, %sil
489 ; X64-NEXT: cmovel %edi, %eax
490 ; X64-NEXT: sarl $8, %eax
491 ; X64-NEXT: movl %eax, (%rdx)
494 ; X32-LABEL: and_signbit_select_ashr:
496 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
497 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
498 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
499 ; X32-NEXT: je .LBB16_2
501 ; X32-NEXT: andl $-65536, %eax # imm = 0xFFFF0000
502 ; X32-NEXT: .LBB16_2:
503 ; X32-NEXT: sarl $8, %eax
504 ; X32-NEXT: movl %eax, (%ecx)
506 %t0 = and i32 %x, 4294901760 ; 0xFFFF0000
507 %t1 = select i1 %cond, i32 %t0, i32 %x
509 store i32 %r, ptr %dst
512 define i32 @and_nosignbit_select_ashr(i32 %x, i1 %cond, ptr %dst) {
513 ; X64-LABEL: and_nosignbit_select_ashr:
515 ; X64-NEXT: movl %edi, %eax
516 ; X64-NEXT: andl $2147418112, %eax # imm = 0x7FFF0000
517 ; X64-NEXT: testb $1, %sil
518 ; X64-NEXT: cmovel %edi, %eax
519 ; X64-NEXT: sarl $8, %eax
520 ; X64-NEXT: movl %eax, (%rdx)
523 ; X32-LABEL: and_nosignbit_select_ashr:
525 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
526 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
527 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
528 ; X32-NEXT: je .LBB17_2
530 ; X32-NEXT: andl $2147418112, %eax # imm = 0x7FFF0000
531 ; X32-NEXT: .LBB17_2:
532 ; X32-NEXT: sarl $8, %eax
533 ; X32-NEXT: movl %eax, (%ecx)
535 %t0 = and i32 %x, 2147418112 ; 0x7FFF0000
536 %t1 = select i1 %cond, i32 %t0, i32 %x
538 store i32 %r, ptr %dst
542 define i32 @or_signbit_select_ashr(i32 %x, i1 %cond, ptr %dst) {
543 ; X64-LABEL: or_signbit_select_ashr:
545 ; X64-NEXT: movl %edi, %eax
546 ; X64-NEXT: orl $-65536, %eax # imm = 0xFFFF0000
547 ; X64-NEXT: testb $1, %sil
548 ; X64-NEXT: cmovel %edi, %eax
549 ; X64-NEXT: sarl $8, %eax
550 ; X64-NEXT: movl %eax, (%rdx)
553 ; X32-LABEL: or_signbit_select_ashr:
555 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
556 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
557 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
558 ; X32-NEXT: je .LBB18_2
560 ; X32-NEXT: orl $-65536, %eax # imm = 0xFFFF0000
561 ; X32-NEXT: .LBB18_2:
562 ; X32-NEXT: sarl $8, %eax
563 ; X32-NEXT: movl %eax, (%ecx)
565 %t0 = or i32 %x, 4294901760 ; 0xFFFF0000
566 %t1 = select i1 %cond, i32 %t0, i32 %x
568 store i32 %r, ptr %dst
571 define i32 @or_nosignbit_select_ashr(i32 %x, i1 %cond, ptr %dst) {
572 ; X64-LABEL: or_nosignbit_select_ashr:
574 ; X64-NEXT: movl %edi, %eax
575 ; X64-NEXT: orl $2147418112, %eax # imm = 0x7FFF0000
576 ; X64-NEXT: testb $1, %sil
577 ; X64-NEXT: cmovel %edi, %eax
578 ; X64-NEXT: sarl $8, %eax
579 ; X64-NEXT: movl %eax, (%rdx)
582 ; X32-LABEL: or_nosignbit_select_ashr:
584 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
585 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
586 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
587 ; X32-NEXT: je .LBB19_2
589 ; X32-NEXT: orl $2147418112, %eax # imm = 0x7FFF0000
590 ; X32-NEXT: .LBB19_2:
591 ; X32-NEXT: sarl $8, %eax
592 ; X32-NEXT: movl %eax, (%ecx)
594 %t0 = or i32 %x, 2147418112 ; 0x7FFF0000
595 %t1 = select i1 %cond, i32 %t0, i32 %x
597 store i32 %r, ptr %dst
601 define i32 @xor_signbit_select_ashr(i32 %x, i1 %cond, ptr %dst) {
602 ; X64-LABEL: xor_signbit_select_ashr:
604 ; X64-NEXT: movl %edi, %eax
605 ; X64-NEXT: xorl $-65536, %eax # imm = 0xFFFF0000
606 ; X64-NEXT: testb $1, %sil
607 ; X64-NEXT: cmovel %edi, %eax
608 ; X64-NEXT: sarl $8, %eax
609 ; X64-NEXT: movl %eax, (%rdx)
612 ; X32-LABEL: xor_signbit_select_ashr:
614 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
615 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
616 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
617 ; X32-NEXT: je .LBB20_2
619 ; X32-NEXT: xorl $-65536, %eax # imm = 0xFFFF0000
620 ; X32-NEXT: .LBB20_2:
621 ; X32-NEXT: sarl $8, %eax
622 ; X32-NEXT: movl %eax, (%ecx)
624 %t0 = xor i32 %x, 4294901760 ; 0xFFFF0000
625 %t1 = select i1 %cond, i32 %t0, i32 %x
627 store i32 %r, ptr %dst
630 define i32 @xor_nosignbit_select_ashr(i32 %x, i1 %cond, ptr %dst) {
631 ; X64-LABEL: xor_nosignbit_select_ashr:
633 ; X64-NEXT: movl %edi, %eax
634 ; X64-NEXT: xorl $2147418112, %eax # imm = 0x7FFF0000
635 ; X64-NEXT: testb $1, %sil
636 ; X64-NEXT: cmovel %edi, %eax
637 ; X64-NEXT: sarl $8, %eax
638 ; X64-NEXT: movl %eax, (%rdx)
641 ; X32-LABEL: xor_nosignbit_select_ashr:
643 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
644 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
645 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
646 ; X32-NEXT: je .LBB21_2
648 ; X32-NEXT: xorl $2147418112, %eax # imm = 0x7FFF0000
649 ; X32-NEXT: .LBB21_2:
650 ; X32-NEXT: sarl $8, %eax
651 ; X32-NEXT: movl %eax, (%ecx)
653 %t0 = xor i32 %x, 2147418112 ; 0x7FFF0000
654 %t1 = select i1 %cond, i32 %t0, i32 %x
656 store i32 %r, ptr %dst
660 define i32 @add_signbit_select_ashr(i32 %x, i1 %cond, ptr %dst) {
661 ; X64-LABEL: add_signbit_select_ashr:
663 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
664 ; X64-NEXT: leal -65536(%rdi), %eax
665 ; X64-NEXT: testb $1, %sil
666 ; X64-NEXT: cmovel %edi, %eax
667 ; X64-NEXT: sarl $8, %eax
668 ; X64-NEXT: movl %eax, (%rdx)
671 ; X32-LABEL: add_signbit_select_ashr:
673 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
674 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
675 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
676 ; X32-NEXT: je .LBB22_2
678 ; X32-NEXT: addl $-65536, %eax # imm = 0xFFFF0000
679 ; X32-NEXT: .LBB22_2:
680 ; X32-NEXT: sarl $8, %eax
681 ; X32-NEXT: movl %eax, (%ecx)
683 %t0 = add i32 %x, 4294901760 ; 0xFFFF0000
684 %t1 = select i1 %cond, i32 %t0, i32 %x
686 store i32 %r, ptr %dst
689 define i32 @add_nosignbit_select_ashr(i32 %x, i1 %cond, ptr %dst) {
690 ; X64-LABEL: add_nosignbit_select_ashr:
692 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
693 ; X64-NEXT: leal 2147418112(%rdi), %eax
694 ; X64-NEXT: testb $1, %sil
695 ; X64-NEXT: cmovel %edi, %eax
696 ; X64-NEXT: sarl $8, %eax
697 ; X64-NEXT: movl %eax, (%rdx)
700 ; X32-LABEL: add_nosignbit_select_ashr:
702 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
703 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
704 ; X32-NEXT: testb $1, {{[0-9]+}}(%esp)
705 ; X32-NEXT: je .LBB23_2
707 ; X32-NEXT: addl $2147418112, %eax # imm = 0x7FFF0000
708 ; X32-NEXT: .LBB23_2:
709 ; X32-NEXT: sarl $8, %eax
710 ; X32-NEXT: movl %eax, (%ecx)
712 %t0 = add i32 %x, 2147418112 ; 0x7FFF0000
713 %t1 = select i1 %cond, i32 %t0, i32 %x
715 store i32 %r, ptr %dst