From: Sanjay Patel Date: Thu, 1 Aug 2019 21:08:08 +0000 (+0000) Subject: [AArch64][x86] adjust tests with shift-add-shift; NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1818410444a2af24da0a3ffeb0fef9a08abbc855;p=llvm [AArch64][x86] adjust tests with shift-add-shift; NFC Prevent folding away the math completely. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367612 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/AArch64/shift-mod.ll b/test/CodeGen/AArch64/shift-mod.ll index 839693126f3..9bfd1d835a0 100644 --- a/test/CodeGen/AArch64/shift-mod.ll +++ b/test/CodeGen/AArch64/shift-mod.ll @@ -91,10 +91,12 @@ define i64 @ashr_add_shl_i32(i64 %r) { define i64 @ashr_add_shl_i8(i64 %r) { ; CHECK-LABEL: ashr_add_shl_i8: ; CHECK: // %bb.0: -; CHECK-NEXT: sxtb x0, w0 +; CHECK-NEXT: mov x8, #72057594037927936 +; CHECK-NEXT: add x8, x8, x0, lsl #56 +; CHECK-NEXT: asr x0, x8, #56 ; CHECK-NEXT: ret %conv = shl i64 %r, 56 - %sext = add i64 %conv, 4294967296 + %sext = add i64 %conv, 72057594037927936 %conv1 = ashr i64 %sext, 56 ret i64 %conv1 } diff --git a/test/CodeGen/X86/shift-combine.ll b/test/CodeGen/X86/shift-combine.ll index 28f91b82463..f0bb9a1229d 100644 --- a/test/CodeGen/X86/shift-combine.ll +++ b/test/CodeGen/X86/shift-combine.ll @@ -182,17 +182,23 @@ define i64 @ashr_add_shl_i32(i64 %r) nounwind { define i64 @ashr_add_shl_i8(i64 %r) nounwind { ; X32-LABEL: ashr_add_shl_i8: ; X32: # %bb.0: -; X32-NEXT: movsbl {{[0-9]+}}(%esp), %eax -; X32-NEXT: movl %eax, %edx +; X32-NEXT: movl {{[0-9]+}}(%esp), %edx +; X32-NEXT: shll $24, %edx +; X32-NEXT: addl $16777216, %edx # imm = 0x1000000 +; X32-NEXT: movl %edx, %eax +; X32-NEXT: sarl $24, %eax ; X32-NEXT: sarl $31, %edx ; X32-NEXT: retl ; ; X64-LABEL: ashr_add_shl_i8: ; X64: # %bb.0: -; X64-NEXT: movsbq %dil, %rax +; X64-NEXT: shlq $56, %rdi +; X64-NEXT: movabsq $72057594037927936, %rax # imm = 0x100000000000000 +; X64-NEXT: addq %rdi, %rax +; X64-NEXT: sarq $56, %rax ; X64-NEXT: retq %conv = shl i64 %r, 56 - %sext = add i64 %conv, 4294967296 + %sext = add i64 %conv, 72057594037927936 %conv1 = ashr i64 %sext, 56 ret i64 %conv1 }