aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-02-21 00:22:02 +0000
committerCameron Zwarich <zwarich@apple.com>2011-02-21 00:22:02 +0000
commit8d7285d0e5eb5937a6682e884b883516377e903d (patch)
treeccf0591dff9fa8874d00e480674cd7e77c84bbdf /test/CodeGen/X86
parent0b85d07d4611e7d704bf6550fbc624aff36a53b4 (diff)
downloadexternal_llvm-8d7285d0e5eb5937a6682e884b883516377e903d.zip
external_llvm-8d7285d0e5eb5937a6682e884b883516377e903d.tar.gz
external_llvm-8d7285d0e5eb5937a6682e884b883516377e903d.tar.bz2
The signed version of our "magic number" computation for the integer approximation
of a constant had a minor typo introduced when copying it from the book, which caused it to favor negative approximations over positive approximations in many cases. Positive approximations require fewer operations beyond the multiplication. In the case of division by 3, we still generate code that is a single instruction larger than GCC's code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126097 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r--test/CodeGen/X86/divide-by-constant.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/CodeGen/X86/divide-by-constant.ll b/test/CodeGen/X86/divide-by-constant.ll
index 7ceb972..fe335b9 100644
--- a/test/CodeGen/X86/divide-by-constant.ll
+++ b/test/CodeGen/X86/divide-by-constant.ll
@@ -40,7 +40,7 @@ entry:
%div = sdiv i16 %x, 33 ; <i32> [#uses=1]
ret i16 %div
; CHECK: test4:
-; CHECK: imull $-1985, %ecx, %ecx
+; CHECK: imull $1986, %eax, %eax
}
define i32 @test5(i32 %A) nounwind {