diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-06-06 18:03:13 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-06-06 18:03:13 +0000 |
commit | 10ce8995f7e30f37ff40fc34979f5cd02328a1aa (patch) | |
tree | de92c2fdc7ffad556f18756faa9a042f2d4aadf3 /lib/libm/arch | |
parent | 3f73c5e38cd581435818ee9ebdb527c7687c6bc3 (diff) |
2nd patch for stack mishandling; wd@ics.nara-wu.ac.jp
Diffstat (limited to 'lib/libm/arch')
-rw-r--r-- | lib/libm/arch/i387/e_exp.S | 16 | ||||
-rw-r--r-- | lib/libm/arch/i387/s_ceil.S | 16 | ||||
-rw-r--r-- | lib/libm/arch/i387/s_ceilf.S | 16 | ||||
-rw-r--r-- | lib/libm/arch/i387/s_floor.S | 16 | ||||
-rw-r--r-- | lib/libm/arch/i387/s_floorf.S | 16 |
5 files changed, 35 insertions, 45 deletions
diff --git a/lib/libm/arch/i387/e_exp.S b/lib/libm/arch/i387/e_exp.S index 87db828e639..210e2d2e2f2 100644 --- a/lib/libm/arch/i387/e_exp.S +++ b/lib/libm/arch/i387/e_exp.S @@ -9,17 +9,15 @@ RCSID("$NetBSD: e_exp.S,v 1.4.6.1 1996/07/03 19:27:36 jtc Exp $") /* e^x = 2^(x * log2(e)) */ ENTRY(__ieee754_exp) - pushl %ebp - movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw 4(%esp) /* store fpu control word */ + movw 4(%esp),%dx orw $0x0180,%dx - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,(%esp) + fldcw (%esp) /* load modfied control word */ - fldl 8(%ebp) + fldl 12(%esp) fldl2e fmulp /* x * log2(e) */ fstl %st(1) @@ -32,7 +30,7 @@ ENTRY(__ieee754_exp) fscale /* e^x */ fstpl %st(1) - fldcw -12(%ebp) /* restore original control word */ + fldcw 4(%esp) /* restore original control word */ - leave + addl $8,%esp ret diff --git a/lib/libm/arch/i387/s_ceil.S b/lib/libm/arch/i387/s_ceil.S index 0802c0ecdf9..19ba537b424 100644 --- a/lib/libm/arch/i387/s_ceil.S +++ b/lib/libm/arch/i387/s_ceil.S @@ -8,21 +8,19 @@ RCSID("$NetBSD: s_ceil.S,v 1.4 1995/05/08 23:52:13 jtc Exp $") ENTRY(ceil) - pushl %ebp - movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw 4(%esp) /* store fpu control word */ + movw 4(%esp),%dx orw $0x0800,%dx /* round towards +oo */ andw $0xfbff,%dx - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,(%esp) + fldcw (%esp) /* load modfied control word */ - fldl 8(%ebp); /* round */ + fldl 12(%esp); /* round */ frndint - fldcw -12(%ebp) /* restore original control word */ + fldcw 4(%esp) /* restore original control word */ - leave + addl $8,%esp ret diff --git a/lib/libm/arch/i387/s_ceilf.S b/lib/libm/arch/i387/s_ceilf.S index 253f4fc6933..4836bd94753 100644 --- a/lib/libm/arch/i387/s_ceilf.S +++ b/lib/libm/arch/i387/s_ceilf.S @@ -8,21 +8,19 @@ RCSID("$NetBSD: s_ceilf.S,v 1.3 1995/05/08 23:52:44 jtc Exp $") ENTRY(ceilf) - pushl %ebp - movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw 4(%esp) /* store fpu control word */ + movw 4(%esp),%dx orw $0x0800,%dx /* round towards +oo */ andw $0xfbff,%dx - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,(%esp) + fldcw (%esp) /* load modfied control word */ - flds 8(%ebp); /* round */ + flds 12(%esp); /* round */ frndint - fldcw -12(%ebp) /* restore original control word */ + fldcw 4(%esp) /* restore original control word */ - leave + addl $8,%esp ret diff --git a/lib/libm/arch/i387/s_floor.S b/lib/libm/arch/i387/s_floor.S index e39369fc906..af45c342082 100644 --- a/lib/libm/arch/i387/s_floor.S +++ b/lib/libm/arch/i387/s_floor.S @@ -8,21 +8,19 @@ RCSID("$NetBSD: s_floor.S,v 1.4 1995/05/09 00:01:59 jtc Exp $") ENTRY(floor) - pushl %ebp - movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw 4(%esp) /* store fpu control word */ + movw 4(%esp),%dx orw $0x0400,%dx /* round towards -oo */ andw $0xf7ff,%dx - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,(%esp) + fldcw (%esp) /* load modfied control word */ - fldl 8(%ebp); /* round */ + fldl 12(%esp); /* round */ frndint - fldcw -12(%ebp) /* restore original control word */ + fldcw 4(%esp) /* restore original control word */ - leave + addl $8,%esp ret diff --git a/lib/libm/arch/i387/s_floorf.S b/lib/libm/arch/i387/s_floorf.S index 4c0f87bc384..d4270ae5f90 100644 --- a/lib/libm/arch/i387/s_floorf.S +++ b/lib/libm/arch/i387/s_floorf.S @@ -8,21 +8,19 @@ RCSID("$NetBSD: s_floorf.S,v 1.3 1995/05/09 00:04:32 jtc Exp $") ENTRY(floorf) - pushl %ebp - movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw 4(%esp) /* store fpu control word */ + movw 4(%esp),%dx orw $0x0400,%dx /* round towards -oo */ andw $0xf7ff,%dx - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,(%esp) + fldcw (%esp) /* load modfied control word */ - flds 8(%ebp); /* round */ + flds 12(%esp); /* round */ frndint - fldcw -12(%ebp) /* restore original control word */ + fldcw 4(%esp) /* restore original control word */ - leave + addl $8,%esp ret |