summaryrefslogtreecommitdiff
path: root/lib/libm/arch/hppa/s_floor.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libm/arch/hppa/s_floor.c')
-rw-r--r--lib/libm/arch/hppa/s_floor.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libm/arch/hppa/s_floor.c b/lib/libm/arch/hppa/s_floor.c
index 9c65cdc5ed2..ef9c29dbd51 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.4 2003/10/31 23:22:37 mickey Exp $";
+static char rcsid[] = "$OpenBSD: s_floor.c,v 1.5 2009/06/30 20:20:20 kettenis Exp $";
#endif
#include <sys/types.h>
@@ -16,8 +16,7 @@ floor(double x)
u_int64_t ofpsr, fpsr;
__asm__ __volatile__("fstds %%fr0,0(%1)" : "=m" (ofpsr) : "r" (&ofpsr));
- fpsr = (ofpsr & ~((u_int64_t)FP_RM << (9 + 32))) |
- ((u_int64_t)FP_RZ << (9 + 32));
+ fpsr = ofpsr | ((u_int64_t)FP_RM << (9 + 32));
__asm__ __volatile__("fldds 0(%0), %%fr0" :: "r" (&fpsr));
__asm__ __volatile__("frnd,dbl %0,%0" : "+f" (x));