about summary refs log tree commit diff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-12-04 18:37:56 +0000
committerRoland McGrath <roland@gnu.org>1995-12-04 18:37:56 +0000
commitba848785bb048e7700555ef97c9d1fd3911a3da3 (patch)
tree646ee57c65b8d2231e235caa069d7fea634e8b64 /sysdeps/i386
parentc13a4f3dbd44ff03d85ad1ac35cca38c3f35d33c (diff)
downloadglibc-ba848785bb048e7700555ef97c9d1fd3911a3da3.tar.gz
glibc-ba848785bb048e7700555ef97c9d1fd3911a3da3.tar.xz
glibc-ba848785bb048e7700555ef97c9d1fd3911a3da3.zip
Updated from ../=mpn/gmp-1.910
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/i586/lshift.S11
-rw-r--r--sysdeps/i386/i586/rshift.S11
2 files changed, 14 insertions, 8 deletions
diff --git a/sysdeps/i386/i586/lshift.S b/sysdeps/i386/i586/lshift.S
index b9f8131297..c41f74e17d 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
diff --git a/sysdeps/i386/i586/rshift.S b/sysdeps/i386/i586/rshift.S
index 51cde8f07f..a820a79bc7 100644
--- a/sysdeps/i386/i586/rshift.S
+++ b/sysdeps/i386/i586/rshift.S
@@ -43,12 +43,15 @@ C_SYMBOL_NAME(__mpn_rshift:)
 	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(%edi),%eax
+	cmpl	%esi,%eax
+	jnc	Lspecial		/* jump if res_ptr + 1 >= s_ptr */
+	leal	(%edi,%ebp,4),%eax
+	cmpl	%eax,%esi
+	jnc	Lspecial		/* jump if s_ptr >= res_ptr + size */
 
 Lnormal:
 	movl	(%esi),%edx