aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386/i586/lshift.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/i586/lshift.S')
-rw-r--r--sysdeps/i386/i586/lshift.S11
1 files changed, 7 insertions, 4 deletions
diff --git a/sysdeps/i386/i586/lshift.S b/sysdeps/i386/i586/lshift.S
index b9f8131..c41f74e 100644
--- a/sysdeps/i386/i586/lshift.S
+++ b/sysdeps/i386/i586/lshift.S
@@ -43,12 +43,15 @@ C_SYMBOL_NAME(__mpn_lshift:)
movl 28(%esp),%ebp /* size */
movl 32(%esp),%ecx /* cnt */
+/* We can use faster code for shift-by-1 under certain conditions. */
cmp $1,%ecx
jne Lnormal
- movl %edi,%eax
- subl %esi,%eax
- cmpl %ebp,%eax
- jnc Lspecial
+ leal 4(%esi),%eax
+ cmpl %edi,%eax
+ jnc Lspecial /* jump if s_ptr + 1 >= res_ptr */
+ leal (%esi,%ebp,4),%eax
+ cmpl %eax,%edi
+ jnc Lspecial /* jump if res_ptr >= s_ptr + size */
Lnormal:
leal -4(%edi,%ebp,4),%edi