about summary refs log tree commit diff
path: root/sysdeps/i386/i586/sub_n.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/i586/sub_n.S')
-rw-r--r--sysdeps/i386/i586/sub_n.S13
1 files changed, 10 insertions, 3 deletions
diff --git a/sysdeps/i386/i586/sub_n.S b/sysdeps/i386/i586/sub_n.S
index fcb13f114b..0b5de929d9 100644
--- a/sysdeps/i386/i586/sub_n.S
+++ b/sysdeps/i386/i586/sub_n.S
@@ -20,6 +20,7 @@
 
 #include "sysdep.h"
 #include "asm-syntax.h"
+#include "bp-sym.h"
 #include "bp-asm.h"
 
 #define PARMS	LINKAGE+16		/* space for 4 saved regs */
@@ -29,7 +30,7 @@
 #define SIZE	S2+PTR_SIZE
 
 	.text
-ENTRY(__mpn_sub_n)
+ENTRY (BP_SYM (__mpn_sub_n))
 	ENTER
 
 	pushl	%edi
@@ -41,7 +42,13 @@ ENTRY(__mpn_sub_n)
 	movl	S1(%esp),%esi
 	movl	S2(%esp),%ebx
 	movl	SIZE(%esp),%ecx
-
+#if __BOUNDED_POINTERS__
+	shll	$2, %ecx	/* convert limbs to bytes */
+	CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %ecx)
+	CHECK_BOUNDS_BOTH_WIDE (%esi, S1(%esp), %ecx)
+	CHECK_BOUNDS_BOTH_WIDE (%ebx, S2(%esp), %ecx)
+	shrl	$2, %ecx
+#endif
 	movl	(%ebx),%ebp
 
 	decl	%ecx
@@ -127,4 +134,4 @@ L(end2):
 
 	LEAVE
 	ret
-END(__mpn_sub_n)
+END (BP_SYM (__mpn_sub_n))