blob: 9b8bbfdd3451090c38b26e233a8216efda0d670b [file] [log] [blame]
Simon Pilgrimcbc2d1e2018-01-30 14:15:51 +00001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s --check-prefix=X86
3; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefixes=X64
4
5define i32 @pr32690(i32) {
6; X86-LABEL: pr32690:
7; X86: # %bb.0:
8; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
9; X86-NEXT: xorl %eax, %eax
10; X86-NEXT: addl $63, %ecx
11; X86-NEXT: setb %al
12; X86-NEXT: shldl $26, %ecx, %eax
13; X86-NEXT: retl
14;
15; X64-LABEL: pr32690:
16; X64: # %bb.0:
17; X64-NEXT: movl %edi, %eax
18; X64-NEXT: addq $63, %rax
19; X64-NEXT: shrq $6, %rax
Puyan Lotfi43e94b12018-01-31 22:04:26 +000020; X64-NEXT: # kill: def $eax killed $eax killed $rax
Simon Pilgrimcbc2d1e2018-01-30 14:15:51 +000021; X64-NEXT: retq
22 %2 = zext i32 %0 to i64
23 %3 = add nuw nsw i64 %2, 63
24 %4 = lshr i64 %3, 6
25 %5 = trunc i64 %4 to i32
26 ret i32 %5
27}