Clean up <machine/ieeefp.h> and make sure the rounding mode bits match the
authorkettenis <kettenis@openbsd.org>
Thu, 29 Apr 2021 17:19:18 +0000 (17:19 +0000)
committerkettenis <kettenis@openbsd.org>
Thu, 29 Apr 2021 17:19:18 +0000 (17:19 +0000)
commit4cf001dcc25cc2a1e539f59074a67b24c366319a
tree649054942babc1e8a561673ef05ebf599d811008
parent45a69b092c959ec815740e67960f097f4b27b5e9
Clean up <machine/ieeefp.h> and make sure the rounding mode bits match the
hardware.  Implement fp[gs]etround(3) and fp[gs]etsticky(3) and tweak
the fp[gs]etmask(3) implementation to provide the right weak symbols.
This implementation deliberately ignores the additional
"round to nearest, away from zero" as this interface is derived from
i386-specific code and the i387 FPU doesn't implement such a rounding
mode.  This is a legacy API and code should use <fenv.h> instead.

ok drahn@
lib/libc/arch/riscv64/gen/fpgetmask.c
lib/libc/arch/riscv64/gen/fpgetround.c [new file with mode: 0644]
lib/libc/arch/riscv64/gen/fpgetsticky.c [new file with mode: 0644]
lib/libc/arch/riscv64/gen/fpsetmask.c
lib/libc/arch/riscv64/gen/fpsetround.c [new file with mode: 0644]
lib/libc/arch/riscv64/gen/fpsetsticky.c [new file with mode: 0644]
sys/arch/riscv64/include/ieeefp.h