64 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i386-unknown-unknown | FileCheck %s --check-prefixes=X863; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=X644; RUN: llc < %s -mtriple=x86_64-unknown-gnux32 | FileCheck %s --check-prefixes=X645 6define i32 @shift30_and2_i32(i32 %x) {7; X86-LABEL: shift30_and2_i32:8; X86: # %bb.0:9; X86-NEXT: movl {{[0-9]+}}(%esp), %eax10; X86-NEXT: shrl $30, %eax11; X86-NEXT: andl $-2, %eax12; X86-NEXT: retl13;14; X64-LABEL: shift30_and2_i32:15; X64: # %bb.0:16; X64-NEXT: movl %edi, %eax17; X64-NEXT: shrl $30, %eax18; X64-NEXT: andl $-2, %eax19; X64-NEXT: retq20 %shr = lshr i32 %x, 3021 %and = and i32 %shr, 222 ret i32 %and23}24 25define i64 @shift62_and2_i64(i64 %x) {26; X86-LABEL: shift62_and2_i64:27; X86: # %bb.0:28; X86-NEXT: movl {{[0-9]+}}(%esp), %eax29; X86-NEXT: shrl $30, %eax30; X86-NEXT: andl $-2, %eax31; X86-NEXT: xorl %edx, %edx32; X86-NEXT: retl33;34; X64-LABEL: shift62_and2_i64:35; X64: # %bb.0:36; X64-NEXT: movq %rdi, %rax37; X64-NEXT: shrq $62, %rax38; X64-NEXT: andl $-2, %eax39; X64-NEXT: retq40 %shr = lshr i64 %x, 6241 %and = and i64 %shr, 242 ret i64 %and43}44 45define i64 @shift30_and2_i64(i64 %x) {46; X86-LABEL: shift30_and2_i64:47; X86: # %bb.0:48; X86-NEXT: movl {{[0-9]+}}(%esp), %eax49; X86-NEXT: shrl $30, %eax50; X86-NEXT: andl $-2, %eax51; X86-NEXT: xorl %edx, %edx52; X86-NEXT: retl53;54; X64-LABEL: shift30_and2_i64:55; X64: # %bb.0:56; X64-NEXT: movq %rdi, %rax57; X64-NEXT: shrl $30, %eax58; X64-NEXT: andl $-2, %eax59; X64-NEXT: retq60 %shr = lshr i64 %x, 3061 %and = and i64 %shr, 262 ret i64 %and63}64