diff options
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 |