From 082b2bbe4b986ddddbd2e0a3eedcec855fb27271 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Fri, 31 Oct 2003 23:22:38 +0000 Subject: these are supposed to round towards zero; found by millert@ while testing perl 5.8.1 --- lib/libm/arch/hppa/s_floor.c | 4 ++-- lib/libm/arch/hppa/s_floorf.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libm') 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 @@ -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 @@ -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)); -- cgit v1.2.3