diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-05-12 02:28:26 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-05-12 02:28:26 +0000 |
commit | 10f22b55af831e4b1912fffaed6c9ac7be342dee (patch) | |
tree | 0be3c078b9023fde3d7a3cf4fd64872e9c5e4788 /lib/libm/arch | |
parent | 9e7ac9fdf9707d29bc05f884fe30f83a28b1d177 (diff) |
Correct defines for fenv rounding modes and change fenv_t and fexcept_t
from unsigned long long to unsigned int.
ok kettenis@
Diffstat (limited to 'lib/libm/arch')
-rw-r--r-- | lib/libm/arch/riscv64/fenv.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/libm/arch/riscv64/fenv.c b/lib/libm/arch/riscv64/fenv.c index 56b9545f23b..5143ddf7d60 100644 --- a/lib/libm/arch/riscv64/fenv.c +++ b/lib/libm/arch/riscv64/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.2 2021/05/11 12:05:13 jsg Exp $ */ +/* $OpenBSD: fenv.c,v 1.3 2021/05/12 02:28:25 jsg Exp $ */ /*- * Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG> * All rights reserved. @@ -30,10 +30,6 @@ #include <fenv.h> #include <machine/ieeefp.h> -/* We need to be able to map status flag positions to mask flag positions */ -#define _FPUSW_SHIFT 8 -#define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT) - #define __get_fcsr(r) asm volatile("frcsr %0" : "=r" (r)) #define __set_fcsr(r) asm volatile("fscsr %0" : "+r" (r)) #define __get_flags(r) asm volatile("frflags %0" : "=r" (r)) @@ -146,7 +142,7 @@ fegetround(void) fenv_t r; __get_frm(r); - return ((r >> _ROUND_SHIFT) & _ROUND_MASK); + return (r & _ROUND_MASK); } DEF_STD(fegetround); |