[llvm] r314063 - [x86] add an add+shift test for follow-up suggestion from D38181; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 23 07:24:07 PDT 2017
Author: spatel
Date: Sat Sep 23 07:24:07 2017
New Revision: 314063
URL: http://llvm.org/viewvc/llvm-project?rev=314063&view=rev
Log:
[x86] add an add+shift test for follow-up suggestion from D38181; NFC
Modified:
llvm/trunk/test/CodeGen/X86/shift-and.ll
Modified: llvm/trunk/test/CodeGen/X86/shift-and.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/shift-and.ll?rev=314063&r1=314062&r2=314063&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/shift-and.ll (original)
+++ llvm/trunk/test/CodeGen/X86/shift-and.ll Sat Sep 23 07:24:07 2017
@@ -193,3 +193,24 @@ define i64 @t6(i64 %key, i64* nocapture
%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
+}
+
More information about the llvm-commits
mailing list