commit | 3ffdff6448a6b4609071f9a3af4d89b6a5c8103c | [log] [tgz] |
---|---|---|
author | Chris Lattner <sabre@nondot.org> | Wed Oct 06 04:19:43 2004 +0000 |
committer | Chris Lattner <sabre@nondot.org> | Wed Oct 06 04:19:43 2004 +0000 |
tree | f7f9b4f659cadeabb2c594c2faf2b0fd68388678 | |
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