aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386/fpu
diff options
context:
space:
mode:
authorGreg McGary <greg@mcgary.org>2000-08-17 07:36:19 +0000
committerGreg McGary <greg@mcgary.org>2000-08-17 07:36:19 +0000
commit9e25f6e29bd6728ad4012e3c4c9b11a96b7a4acf (patch)
treea04dbc79fe333384feb84bd24a39f4e58631f01d /sysdeps/i386/fpu
parent9a81430bf923de1145cbf52d5f1efe0bdce68e5b (diff)
downloadglibc-9e25f6e29bd6728ad4012e3c4c9b11a96b7a4acf.tar
glibc-9e25f6e29bd6728ad4012e3c4c9b11a96b7a4acf.tar.gz
glibc-9e25f6e29bd6728ad4012e3c4c9b11a96b7a4acf.tar.bz2
glibc-9e25f6e29bd6728ad4012e3c4c9b11a96b7a4acf.zip
* sysdeps/i386/fpu/s_frexp.S: Check bounds.
Wrap extern symbols in BP_SYM (). * sysdeps/i386/fpu/s_frexpf.S: Likewise. * sysdeps/i386/fpu/s_frexpl.S: Likewise. * sysdeps/i386/fpu/s_remquo.S: Likewise. * sysdeps/i386/fpu/s_remquof.S: Likewise. * sysdeps/i386/fpu/s_remquol.S: Likewise. * sysdeps/i386/fpu/s_sincos.S: Likewise. * sysdeps/i386/fpu/s_sincosf.S: Likewise. * sysdeps/i386/fpu/s_sincosl.S: Likewise. * sysdeps/unix/sysv/linux/i386/clone.S: Likewise. * sysdeps/unix/sysv/linux/i386/mmap64.S: Likewise.
Diffstat (limited to 'sysdeps/i386/fpu')
-rw-r--r--sysdeps/i386/fpu/s_frexp.S36
-rw-r--r--sysdeps/i386/fpu/s_frexpf.S33
-rw-r--r--sysdeps/i386/fpu/s_frexpl.S39
-rw-r--r--sysdeps/i386/fpu/s_remquo.S29
-rw-r--r--sysdeps/i386/fpu/s_remquof.S29
-rw-r--r--sysdeps/i386/fpu/s_remquol.S29
-rw-r--r--sysdeps/i386/fpu/s_sincos.S31
-rw-r--r--sysdeps/i386/fpu/s_sincosf.S31
-rw-r--r--sysdeps/i386/fpu/s_sincosl.S31
9 files changed, 207 insertions, 81 deletions
diff --git a/sysdeps/i386/fpu/s_frexp.S b/sysdeps/i386/fpu/s_frexp.S
index 6a05f26720..0f149de346 100644
--- a/sysdeps/i386/fpu/s_frexp.S
+++ b/sysdeps/i386/fpu/s_frexp.S
@@ -1,5 +1,5 @@
/* ix87 specific frexp implementation for double.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,8 @@
Boston, MA 02111-1307, USA. */
#include <machine/asm.h>
+#include "bp-sym.h"
+#include "bp-asm.h"
#ifdef __ELF__
.section .rodata
@@ -37,10 +39,17 @@ two54: .byte 0, 0, 0, 0, 0, 0, 0x50, 0x43
#define MO(op) op
#endif
+#define PARMS LINKAGE /* no space for saved regs */
+#define VAL0 PARMS
+#define VAL1 VAL0+4
+#define EXPP VAL1+4
+
.text
-ENTRY(__frexp)
- movl 4(%esp), %ecx
- movl 8(%esp), %eax
+ENTRY (BP_SYM (__frexp))
+ ENTER
+
+ movl VAL0(%esp), %ecx
+ movl VAL1(%esp), %eax
movl %eax, %edx
andl $0x7fffffff, %eax
orl %eax, %ecx
@@ -52,7 +61,7 @@ ENTRY(__frexp)
cmpl $0x00100000, %eax
jae 2f
- fldl 4(%esp)
+ fldl VAL0(%esp)
#ifdef PIC
call 3f
3: popl %edx
@@ -60,8 +69,8 @@ ENTRY(__frexp)
#endif
fmull MO(two54)
movl $-54, %ecx
- fstpl 4(%esp)
- movl 8(%esp), %eax
+ fstpl VAL0(%esp)
+ movl VAL1(%esp), %eax
movl %eax, %edx
andl $0x7fffffff, %eax
@@ -70,13 +79,16 @@ ENTRY(__frexp)
subl $1022, %eax
orl $0x3fe00000, %edx
addl %eax, %ecx
- movl %edx, 8(%esp)
+ movl %edx, VAL1(%esp)
/* Store %ecx in the variable pointed to by the second argument,
get the factor from the stack and return. */
-1: movl 12(%esp), %eax
- fldl 4(%esp)
+1: movl EXPP(%esp), %eax
+ CHECK_BOUNDS_BOTH_WIDE (%eax, EXPP(%esp), $4)
+ fldl VAL0(%esp)
movl %ecx, (%eax)
+
+ LEAVE
ret
-END(__frexp)
-weak_alias (__frexp, frexp)
+END (BP_SYM (__frexp))
+weak_alias (BP_SYM (__frexp), BP_SYM (frexp))
diff --git a/sysdeps/i386/fpu/s_frexpf.S b/sysdeps/i386/fpu/s_frexpf.S
index 1021b97aee..5c8c8ee6b8 100644
--- a/sysdeps/i386/fpu/s_frexpf.S
+++ b/sysdeps/i386/fpu/s_frexpf.S
@@ -1,5 +1,5 @@
/* ix87 specific frexp implementation for float.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,8 @@
Boston, MA 02111-1307, USA. */
#include <machine/asm.h>
+#include "bp-sym.h"
+#include "bp-asm.h"
#ifdef __ELF__
.section .rodata
@@ -37,9 +39,15 @@ two25: .byte 0, 0, 0, 0x4c
#define MO(op) op
#endif
+#define PARMS LINKAGE /* no space for saved regs */
+#define VAL PARMS
+#define EXPP VAL+4
+
.text
-ENTRY(__frexpf)
- movl 4(%esp), %eax
+ENTRY (BP_SYM (__frexpf))
+ ENTER
+
+ movl VAL(%esp), %eax
xorl %ecx, %ecx
movl %eax, %edx
andl $0x7fffffff, %eax
@@ -50,7 +58,7 @@ ENTRY(__frexpf)
cmpl $0x00800000, %eax
jae 2f
- flds 4(%esp)
+ flds VAL(%esp)
#ifdef PIC
call 3f
3: popl %edx
@@ -58,8 +66,8 @@ ENTRY(__frexpf)
#endif
fmuls MO(two25)
movl $-25, %ecx
- fstps 4(%esp)
- movl 4(%esp), %eax
+ fstps VAL(%esp)
+ movl VAL(%esp), %eax
movl %eax, %edx
andl $0x7fffffff, %eax
@@ -68,13 +76,16 @@ ENTRY(__frexpf)
subl $126, %eax
orl $0x3f000000, %edx
addl %eax, %ecx
- movl %edx, 4(%esp)
+ movl %edx, VAL(%esp)
/* Store %ecx in the variable pointed to by the second argument,
get the factor from the stack and return. */
-1: movl 8(%esp), %eax
- flds 4(%esp)
+1: movl EXPP(%esp), %eax
+ CHECK_BOUNDS_BOTH_WIDE (%eax, EXPP(%esp), $4)
+ flds VAL(%esp)
movl %ecx, (%eax)
+
+ LEAVE
ret
-END(__frexpf)
-weak_alias (__frexpf, frexpf)
+END (BP_SYM (__frexpf))
+weak_alias (BP_SYM (__frexpf), BP_SYM (frexpf))
diff --git a/sysdeps/i386/fpu/s_frexpl.S b/sysdeps/i386/fpu/s_frexpl.S
index e3019ced6d..df749f8d4c 100644
--- a/sysdeps/i386/fpu/s_frexpl.S
+++ b/sysdeps/i386/fpu/s_frexpl.S
@@ -1,5 +1,5 @@
/* ix87 specific frexp implementation for long double.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,8 @@
Boston, MA 02111-1307, USA. */
#include <machine/asm.h>
+#include "bp-sym.h"
+#include "bp-asm.h"
#ifdef __ELF__
.section .rodata
@@ -37,11 +39,19 @@ two64: .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x43
#define MO(op) op
#endif
+#define PARMS LINKAGE /* no space for saved regs */
+#define VAL0 PARMS
+#define VAL1 VAL0+4
+#define VAL2 VAL1+4
+#define EXPP VAL2+4
+
.text
-ENTRY(__frexpl)
- movl 4(%esp), %ecx
- movl 12(%esp), %eax
- orl 8(%esp), %ecx
+ENTRY (BP_SYM (__frexpl))
+ ENTER
+
+ movl VAL0(%esp), %ecx
+ movl VAL2(%esp), %eax
+ orl VAL1(%esp), %ecx
movl %eax, %edx
andl $0x7fff, %eax
orl %eax, %ecx
@@ -53,7 +63,7 @@ ENTRY(__frexpl)
cmpl $0, %eax
je 2f
- fldt 4(%esp)
+ fldt VAL0(%esp)
#ifdef PIC
call 3f
3: popl %edx
@@ -61,8 +71,8 @@ ENTRY(__frexpl)
#endif
fmull MO(two64) /* It's not necessary to use a 80bit factor */
movl $-64, %ecx
- fstpt 4(%esp)
- movl 12(%esp), %eax
+ fstpt VAL0(%esp)
+ movl VAL2(%esp), %eax
movl %eax, %edx
andl $0x7fff, %eax
@@ -70,13 +80,16 @@ ENTRY(__frexpl)
subl $16382, %eax
orl $0x3ffe, %edx
addl %eax, %ecx
- movl %edx, 12(%esp)
+ movl %edx, VAL2(%esp)
/* Store %ecx in the variable pointed to by the second argument,
get the factor from the stack and return. */
-1: movl 16(%esp), %eax
- fldt 4(%esp)
+1: movl EXPP(%esp), %eax
+ CHECK_BOUNDS_BOTH_WIDE (%eax, EXPP(%esp), $4)
+ fldt VAL0(%esp)
movl %ecx, (%eax)
+
+ LEAVE
ret
-END(__frexpl)
-weak_alias (__frexpl, frexpl)
+END (BP_SYM (__frexpl))
+weak_alias (BP_SYM (__frexpl), BP_SYM (frexpl))
diff --git a/sysdeps/i386/fpu/s_remquo.S b/sysdeps/i386/fpu/s_remquo.S
index 8ada191771..4857b98ab4 100644
--- a/sysdeps/i386/fpu/s_remquo.S
+++ b/sysdeps/i386/fpu/s_remquo.S
@@ -5,10 +5,20 @@
*/
#include <machine/asm.h>
+#include "bp-sym.h"
+#include "bp-asm.h"
-ENTRY(__remquo)
- fldl 12(%esp)
- fldl 4(%esp)
+#define PARMS LINKAGE /* no space for saved regs */
+#define DVDND PARMS
+#define DVSOR DVDND+8
+#define QUOP DVSOR+8
+
+ .text
+ENTRY (BP_SYM (__remquo))
+ ENTER
+
+ fldl DVSOR(%esp)
+ fldl DVDND(%esp)
1: fprem1
fstsw %ax
sahf
@@ -24,13 +34,16 @@ ENTRY(__remquo)
movl $0xef2960, %eax
shrl %cl, %eax
andl $3, %eax
- movl 20(%esp), %ecx
- movl 8(%esp), %edx
- xorl 16(%esp), %edx
+ movl QUOP(%esp), %ecx
+ CHECK_BOUNDS_BOTH_WIDE (%ecx, QUOP(%esp), $4)
+ movl DVDND+4(%esp), %edx
+ xorl DVSOR+4(%esp), %edx
testl $0x80000000, %edx
jz 1f
negl %eax
1: movl %eax, (%ecx)
+
+ LEAVE
ret
-END (__remquo)
-weak_alias (__remquo, remquo)
+END (BP_SYM (__remquo))
+weak_alias (BP_SYM (__remquo), BP_SYM (remquo))
diff --git a/sysdeps/i386/fpu/s_remquof.S b/sysdeps/i386/fpu/s_remquof.S
index f60aec9c46..90f46dcbc0 100644
--- a/sysdeps/i386/fpu/s_remquof.S
+++ b/sysdeps/i386/fpu/s_remquof.S
@@ -5,10 +5,20 @@
*/
#include <machine/asm.h>
+#include "bp-sym.h"
+#include "bp-asm.h"
-ENTRY(__remquof)
- flds 8(%esp)
- flds 4(%esp)
+#define PARMS LINKAGE /* no space for saved regs */
+#define DVDND PARMS
+#define DVSOR DVDND+4
+#define QUOP DVSOR+4
+
+ .text
+ENTRY (BP_SYM (__remquof))
+ ENTER
+
+ flds DVSOR(%esp)
+ flds DVDND(%esp)
1: fprem1
fstsw %ax
sahf
@@ -24,13 +34,16 @@ ENTRY(__remquof)
movl $0xef2960, %eax
shrl %cl, %eax
andl $3, %eax
- movl 12(%esp), %ecx
- movl 4(%esp), %edx
- xorl 8(%esp), %edx
+ movl QUOP(%esp), %ecx
+ CHECK_BOUNDS_BOTH_WIDE (%ecx, QUOP(%esp), $4)
+ movl DVDND(%esp), %edx
+ xorl DVSOR(%esp), %edx
testl $0x80000000, %edx
jz 1f
negl %eax
1: movl %eax, (%ecx)
+
+ LEAVE
ret
-END (__remquof)
-weak_alias (__remquof, remquof)
+END (BP_SYM (__remquof))
+weak_alias (BP_SYM (__remquof), BP_SYM (remquof))
diff --git a/sysdeps/i386/fpu/s_remquol.S b/sysdeps/i386/fpu/s_remquol.S
index 115d6e874b..c71c002243 100644
--- a/sysdeps/i386/fpu/s_remquol.S
+++ b/sysdeps/i386/fpu/s_remquol.S
@@ -5,10 +5,20 @@
*/
#include <machine/asm.h>
+#include "bp-sym.h"
+#include "bp-asm.h"
-ENTRY(__remquol)
- fldt 16(%esp)
- fldt 4(%esp)
+#define PARMS LINKAGE /* no space for saved regs */
+#define DVDND PARMS
+#define DVSOR DVDND+12
+#define QUOP DVSOR+12
+
+ .text
+ENTRY (BP_SYM (__remquol))
+ ENTER
+
+ fldt DVSOR(%esp)
+ fldt DVDND(%esp)
1: fprem1
fstsw %ax
sahf
@@ -24,13 +34,16 @@ ENTRY(__remquol)
movl $0xef2960, %eax
shrl %cl, %eax
andl $3, %eax
- movl 28(%esp), %ecx
- movl 12(%esp), %edx
- xorl 24(%esp), %edx
+ movl QUOP(%esp), %ecx
+ CHECK_BOUNDS_BOTH_WIDE (%ecx, QUOP(%esp), $4)
+ movl DVDND+8(%esp), %edx
+ xorl DVSOR+8(%esp), %edx
testl $0x8000, %edx
jz 1f
negl %eax
1: movl %eax, (%ecx)
+
+ LEAVE
ret
-END (__remquol)
-weak_alias (__remquol, remquol)
+END (BP_SYM (__remquol))
+weak_alias (BP_SYM (__remquol), BP_SYM (remquol))
diff --git a/sysdeps/i386/fpu/s_sincos.S b/sysdeps/i386/fpu/s_sincos.S
index fe99f42d18..48b24bd9f1 100644
--- a/sysdeps/i386/fpu/s_sincos.S
+++ b/sysdeps/i386/fpu/s_sincos.S
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,18 +19,33 @@
Boston, MA 02111-1307, USA. */
#include <machine/asm.h>
+#include "bp-sym.h"
+#include "bp-asm.h"
-ENTRY(__sincos)
- fldl 4(%esp)
+#define PARMS LINKAGE /* no space for saved regs */
+#define ANGLE PARMS
+#define SINP ANGLE+8
+#define COSP SINP+PTR_SIZE
+
+ .text
+ENTRY (BP_SYM (__sincos))
+ ENTER
+
+ fldl ANGLE(%esp)
fsincos
- movl 12(%esp), %ecx
- movl 16(%esp), %edx
+ movl SINP(%esp), %ecx
+ CHECK_BOUNDS_BOTH_WIDE (%ecx, SINP(%esp), $8)
+ movl COSP(%esp), %edx
+ CHECK_BOUNDS_BOTH_WIDE (%edx, COSP(%esp), $8)
fnstsw %ax
testl $0x400,%eax
jnz 1f
fstpl (%edx)
fstpl (%ecx)
+
+ LEAVE
ret
+
.align ALIGNARG(4)
1: fldpi
fadd %st(0)
@@ -43,6 +58,8 @@ ENTRY(__sincos)
fsincos
fstpl (%edx)
fstpl (%ecx)
+
+ LEAVE
ret
-END(__sincos)
-weak_alias(__sincos, sincos)
+END (BP_SYM (__sincos))
+weak_alias (BP_SYM (__sincos), BP_SYM (sincos))
diff --git a/sysdeps/i386/fpu/s_sincosf.S b/sysdeps/i386/fpu/s_sincosf.S
index 5bb13f3c33..1b72ee568f 100644
--- a/sysdeps/i386/fpu/s_sincosf.S
+++ b/sysdeps/i386/fpu/s_sincosf.S
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,18 +19,33 @@
Boston, MA 02111-1307, USA. */
#include <machine/asm.h>
+#include "bp-sym.h"
+#include "bp-asm.h"
-ENTRY(__sincosf)
- flds 4(%esp)
+#define PARMS LINKAGE /* no space for saved regs */
+#define ANGLE PARMS
+#define SINP ANGLE+4
+#define COSP SINP+PTR_SIZE
+
+ .text
+ENTRY (BP_SYM (__sincosf))
+ ENTER
+
+ flds ANGLE(%esp)
fsincos
- movl 8(%esp), %ecx
- movl 12(%esp), %edx
+ movl SINP(%esp), %ecx
+ CHECK_BOUNDS_BOTH_WIDE (%ecx, SINP(%esp), $4)
+ movl COSP(%esp), %edx
+ CHECK_BOUNDS_BOTH_WIDE (%edx, COSP(%esp), $4)
fnstsw %ax
testl $0x400,%eax
jnz 1f
fstps (%edx)
fstps (%ecx)
+
+ LEAVE
ret
+
.align ALIGNARG(4)
1: fldpi
fadd %st(0)
@@ -43,6 +58,8 @@ ENTRY(__sincosf)
fsincos
fstps (%edx)
fstps (%ecx)
+
+ LEAVE
ret
-END(__sincosf)
-weak_alias(__sincosf, sincosf)
+END (BP_SYM (__sincosf))
+weak_alias (BP_SYM (__sincosf), BP_SYM (sincosf))
diff --git a/sysdeps/i386/fpu/s_sincosl.S b/sysdeps/i386/fpu/s_sincosl.S
index 8b6694f09f..c474e112af 100644
--- a/sysdeps/i386/fpu/s_sincosl.S
+++ b/sysdeps/i386/fpu/s_sincosl.S
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,18 +19,33 @@
Boston, MA 02111-1307, USA. */
#include <machine/asm.h>
+#include "bp-sym.h"
+#include "bp-asm.h"
-ENTRY(__sincosl)
- fldt 4(%esp)
+#define PARMS LINKAGE /* no space for saved regs */
+#define ANGLE PARMS
+#define SINP ANGLE+12
+#define COSP SINP+PTR_SIZE
+
+ .text
+ENTRY (BP_SYM (__sincosl))
+ ENTER
+
+ fldt ANGLE(%esp)
fsincos
- movl 16(%esp), %ecx
- movl 20(%esp), %edx
+ movl SINP(%esp), %ecx
+ CHECK_BOUNDS_BOTH_WIDE (%ecx, SINP(%esp), $12)
+ movl COSP(%esp), %edx
+ CHECK_BOUNDS_BOTH_WIDE (%edx, COSP(%esp), $12)
fnstsw %ax
testl $0x400,%eax
jnz 1f
fstpt (%edx)
fstpt (%ecx)
+
+ LEAVE
ret
+
.align ALIGNARG(4)
1: fldpi
fadd %st(0)
@@ -43,6 +58,8 @@ ENTRY(__sincosl)
fsincos
fstpt (%edx)
fstpt (%ecx)
+
+ LEAVE
ret
-END(__sincosl)
-weak_alias(__sincosl, sincosl)
+END (BP_SYM (__sincosl))
+weak_alias (BP_SYM (__sincosl), BP_SYM (sincosl))