diff options
author | Chris Lattner <sabre@nondot.org> | 2004-10-06 04:19:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-10-06 04:19:43 +0000 |
commit | 3ffdff6448a6b4609071f9a3af4d89b6a5c8103c (patch) | |
tree | f7f9b4f659cadeabb2c594c2faf2b0fd68388678 /lib/Target/CBackend/Writer.cpp | |
parent | 610f1e2785d7278175ed6c332840756e20bc1142 (diff) |
Fix a scary bug with signed division by a power of two. We used to generate:
s: ;; X / 4
mov %EAX, DWORD PTR [%ESP + 4]
mov %ECX, %EAX
sar %ECX, 1
shr %ECX, 30
mov %EDX, %EAX
add %EDX, %ECX
sar %EAX, 2
ret
When we really meant:
s:
mov %EAX, DWORD PTR [%ESP + 4]
mov %ECX, %EAX
sar %ECX, 1
shr %ECX, 30
add %EAX, %ECX
sar %EAX, 2
ret
Hey, this also reduces register pressure too :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16761 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend/Writer.cpp')
0 files changed, 0 insertions, 0 deletions