Skip to content

Commit 1717084

Browse files
author
spatel
committed
[x86] add an add+shift test for follow-up suggestion from D38181; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314063 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent bab9724 commit 1717084

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/CodeGen/X86/shift-and.ll

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,24 @@ define i64 @t6(i64 %key, i64* nocapture %val) nounwind {
193193
%and = and i64 %sub, %shr
194194
ret i64 %and
195195
}
196+
197+
define i64 @big_mask_constant(i64 %x) nounwind {
198+
; X32-LABEL: big_mask_constant:
199+
; X32: # BB#0:
200+
; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
201+
; X32-NEXT: andl $4, %eax
202+
; X32-NEXT: shll $25, %eax
203+
; X32-NEXT: xorl %edx, %edx
204+
; X32-NEXT: retl
205+
;
206+
; X64-LABEL: big_mask_constant:
207+
; X64: # BB#0:
208+
; X64-NEXT: movabsq $17179869184, %rax # imm = 0x400000000
209+
; X64-NEXT: andq %rdi, %rax
210+
; X64-NEXT: shrq $7, %rax
211+
; X64-NEXT: retq
212+
%and = and i64 %x, 17179869184 ; 0x400000000
213+
%sh = lshr i64 %and, 7
214+
ret i64 %sh
215+
}
216+

0 commit comments

Comments
 (0)