summaryrefslogtreecommitdiff
path: root/lib/libm
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-10-31 23:22:38 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-10-31 23:22:38 +0000
commit082b2bbe4b986ddddbd2e0a3eedcec855fb27271 (patch)
tree253bb5e60d1d6f3def0e4610aa2b03e83d044dad /lib/libm
parent2a598b6fb99344287c080db5a9f99c301f5b75b3 (diff)
these are supposed to round towards zero; found by millert@ while testing perl 5.8.1
Diffstat (limited to 'lib/libm')
-rw-r--r--lib/libm/arch/hppa/s_floor.c4
-rw-r--r--lib/libm/arch/hppa/s_floorf.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libm/arch/hppa/s_floor.c b/lib/libm/arch/hppa/s_floor.c
index 22be65c1fe4..9c65cdc5ed2 100644
--- a/lib/libm/arch/hppa/s_floor.c
+++ b/lib/libm/arch/hppa/s_floor.c
@@ -3,7 +3,7 @@
*/
#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: s_floor.c,v 1.3 2003/01/16 19:17:33 mickey Exp $";
+static char rcsid[] = "$OpenBSD: s_floor.c,v 1.4 2003/10/31 23:22:37 mickey Exp $";
#endif
#include <sys/types.h>
@@ -17,7 +17,7 @@ floor(double x)
__asm__ __volatile__("fstds %%fr0,0(%1)" : "=m" (ofpsr) : "r" (&ofpsr));
fpsr = (ofpsr & ~((u_int64_t)FP_RM << (9 + 32))) |
- ((u_int64_t)FP_RN << (9 + 32));
+ ((u_int64_t)FP_RZ << (9 + 32));
__asm__ __volatile__("fldds 0(%0), %%fr0" :: "r" (&fpsr));
__asm__ __volatile__("frnd,dbl %0,%0" : "+f" (x));
diff --git a/lib/libm/arch/hppa/s_floorf.c b/lib/libm/arch/hppa/s_floorf.c
index 25756a29937..6631d3e5d5e 100644
--- a/lib/libm/arch/hppa/s_floorf.c
+++ b/lib/libm/arch/hppa/s_floorf.c
@@ -3,7 +3,7 @@
*/
#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: s_floorf.c,v 1.3 2003/01/16 19:17:33 mickey Exp $";
+static char rcsid[] = "$OpenBSD: s_floorf.c,v 1.4 2003/10/31 23:22:37 mickey Exp $";
#endif
#include <sys/types.h>
@@ -17,7 +17,7 @@ floorf(float x)
__asm__ __volatile__("fstds %%fr0,0(%1)" : "=m" (ofpsr) : "r" (&ofpsr));
fpsr = (ofpsr & ~((u_int64_t)FP_RM << (9 + 32))) |
- ((u_int64_t)FP_RN << (9 + 32));
+ ((u_int64_t)FP_RZ << (9 + 32));
__asm__ __volatile__("fldds 0(%0), %%fr0" :: "r" (&fpsr));
__asm__ __volatile__("frnd,sgl %0,%0" : "+f" (x));