diff options
Diffstat (limited to 'sysdeps/i386')
-rw-r--r-- | sysdeps/i386/fpu/s_floor.S | 12 | ||||
-rw-r--r-- | sysdeps/i386/fpu/s_floorf.S | 12 | ||||
-rw-r--r-- | sysdeps/i386/fpu/s_floorl.S | 17 |
3 files changed, 23 insertions, 18 deletions
diff --git a/sysdeps/i386/fpu/s_floor.S b/sysdeps/i386/fpu/s_floor.S index 2d6287dc79..ed837dae40 100644 --- a/sysdeps/i386/fpu/s_floor.S +++ b/sysdeps/i386/fpu/s_floor.S @@ -9,10 +9,10 @@ RCSID("$NetBSD: s_floor.S,v 1.4 1995/05/09 00:01:59 jtc Exp $") ENTRY(__floor) fldl 4(%esp) - subl $8,%esp - cfi_adjust_cfa_offset (8) + subl $32,%esp + cfi_adjust_cfa_offset (32) - fstcw 4(%esp) /* store fpu control word */ + fnstenv 4(%esp) /* store fpu environment */ /* We use here %edx although only the low 1 bits are defined. But none of the operations should care and they are faster @@ -25,10 +25,10 @@ ENTRY(__floor) frndint /* round */ - fldcw 4(%esp) /* restore original control word */ + fldenv 4(%esp) /* restore original environment */ - addl $8,%esp - cfi_adjust_cfa_offset (-8) + addl $32,%esp + cfi_adjust_cfa_offset (-32) ret END (__floor) weak_alias (__floor, floor) diff --git a/sysdeps/i386/fpu/s_floorf.S b/sysdeps/i386/fpu/s_floorf.S index e969fbe587..84b6f7ed99 100644 --- a/sysdeps/i386/fpu/s_floorf.S +++ b/sysdeps/i386/fpu/s_floorf.S @@ -9,10 +9,10 @@ RCSID("$NetBSD: s_floorf.S,v 1.3 1995/05/09 00:04:32 jtc Exp $") ENTRY(__floorf) flds 4(%esp) - subl $8,%esp - cfi_adjust_cfa_offset (8) + subl $32,%esp + cfi_adjust_cfa_offset (32) - fstcw 4(%esp) /* store fpu control word */ + fnstenv 4(%esp) /* store fpu environment */ /* We use here %edx although only the low 1 bits are defined. But none of the operations should care and they are faster @@ -25,10 +25,10 @@ ENTRY(__floorf) frndint /* round */ - fldcw 4(%esp) /* restore original control word */ + fldenv 4(%esp) /* restore original environment */ - addl $8,%esp - cfi_adjust_cfa_offset (-8) + addl $32,%esp + cfi_adjust_cfa_offset (-32) ret END (__floorf) weak_alias (__floorf, floorf) diff --git a/sysdeps/i386/fpu/s_floorl.S b/sysdeps/i386/fpu/s_floorl.S index 1206554c4a..dc74a0c446 100644 --- a/sysdeps/i386/fpu/s_floorl.S +++ b/sysdeps/i386/fpu/s_floorl.S @@ -10,10 +10,10 @@ RCSID("$NetBSD: $") ENTRY(__floorl) fldt 4(%esp) - subl $8,%esp - cfi_adjust_cfa_offset (8) + subl $32,%esp + cfi_adjust_cfa_offset (32) - fstcw 4(%esp) /* store fpu control word */ + fnstenv 4(%esp) /* store fpu environment */ /* We use here %edx although only the low 1 bits are defined. But none of the operations should care and they are faster @@ -26,10 +26,15 @@ ENTRY(__floorl) frndint /* round */ - fldcw 4(%esp) /* restore original control word */ + /* Preserve "invalid" exceptions from sNaN input. */ + fnstsw + andl $0x1, %eax + orl %eax, 8(%esp) - addl $8,%esp - cfi_adjust_cfa_offset (-8) + fldenv 4(%esp) /* restore original environment */ + + addl $32,%esp + cfi_adjust_cfa_offset (-32) ret END (__floorl) weak_alias (__floorl, floorl) |