diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-09-23 14:24:07 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-09-23 14:24:07 +0000 |
commit | 5ca9f7a0cb90a9b5a8e03a6ec5a8e9585d175bf4 (patch) | |
tree | 8865bbd5b2cc9db35ec8aa643483ab805139ea94 | |
parent | 35db4f956ac0ea160e0e1bb97046fa592e1f09b0 (diff) | |
download | bcm5719-llvm-5ca9f7a0cb90a9b5a8e03a6ec5a8e9585d175bf4.tar.gz bcm5719-llvm-5ca9f7a0cb90a9b5a8e03a6ec5a8e9585d175bf4.zip |
[x86] add an add+shift test for follow-up suggestion from D38181; NFC
llvm-svn: 314063
-rw-r--r-- | llvm/test/CodeGen/X86/shift-and.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/shift-and.ll b/llvm/test/CodeGen/X86/shift-and.ll index 62f2d52a5eb..69ec2f8fae7 100644 --- a/llvm/test/CodeGen/X86/shift-and.ll +++ b/llvm/test/CodeGen/X86/shift-and.ll @@ -193,3 +193,24 @@ define i64 @t6(i64 %key, i64* nocapture %val) nounwind { %and = and i64 %sub, %shr ret i64 %and } + +define i64 @big_mask_constant(i64 %x) nounwind { +; X32-LABEL: big_mask_constant: +; X32: # BB#0: +; X32-NEXT: movl {{[0-9]+}}(%esp), %eax +; X32-NEXT: andl $4, %eax +; X32-NEXT: shll $25, %eax +; X32-NEXT: xorl %edx, %edx +; X32-NEXT: retl +; +; X64-LABEL: big_mask_constant: +; X64: # BB#0: +; X64-NEXT: movabsq $17179869184, %rax # imm = 0x400000000 +; X64-NEXT: andq %rdi, %rax +; X64-NEXT: shrq $7, %rax +; X64-NEXT: retq + %and = and i64 %x, 17179869184 ; 0x400000000 + %sh = lshr i64 %and, 7 + ret i64 %sh +} + |