diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-07-03 02:26:38 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-07-03 02:26:38 +0000 |
commit | 30bd27bf7d71e14663fdde3589781a3de8d4c8dd (patch) | |
tree | 617a8cf6724939051944ec932a3d8c11e9830c91 /compiler-rt/lib/i386/ashrdi3.S | |
parent | 0e8bde59107b4edfc44c139466e6d4f3edc63fda (diff) | |
download | bcm5719-llvm-30bd27bf7d71e14663fdde3589781a3de8d4c8dd.tar.gz bcm5719-llvm-30bd27bf7d71e14663fdde3589781a3de8d4c8dd.zip |
Misc compiler-rt fixes. Clarify neg implementations to show what is
actually happening. Fix mod implementation so it doesn't get
optimized to a recursive call. Make x86-32 non-SSE2 shift
implementation use shld/shrd instead of emulating it (the only x86 processor
where the emulation might be remotely close to justifiable is the Pentium 4).
llvm-svn: 74756
Diffstat (limited to 'compiler-rt/lib/i386/ashrdi3.S')
-rw-r--r-- | compiler-rt/lib/i386/ashrdi3.S | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/compiler-rt/lib/i386/ashrdi3.S b/compiler-rt/lib/i386/ashrdi3.S index db01f2132af..216801469d7 100644 --- a/compiler-rt/lib/i386/ashrdi3.S +++ b/compiler-rt/lib/i386/ashrdi3.S @@ -52,21 +52,13 @@ ___ashrdi3: movl 4(%esp), %eax // Load low testl $0x20, %ecx // If count >= 32 - jnz 2f // goto 2 - testl $0x1f, %ecx // If count == 0 - jz 1f // goto 1 - - pushl %ebx - movl %edx, %ebx // copy high - shrl %cl, %eax // right shift low by count + jnz 1f // goto 1 + + shrdl %cl, %edx, %eax // right shift low by count sarl %cl, %edx // right shift high by count - neg %cl - shll %cl, %ebx // left shift high by 32 - count - orl %ebx, %eax // or the result into the low word - popl %ebx -1: ret + ret -2: movl %edx, %eax // Move high to low +1: movl %edx, %eax // Move high to low sarl $31, %edx // clear high sarl %cl, %eax // shift low by count - 32 ret |