Module Name: src Committed By: riastradh Date: Thu May 16 00:56:11 UTC 2024
Modified Files: src/lib/libc/arch/riscv/gen: fpgetround.c fpsetround.c Log Message: riscv: Nix shifting around FRRM and FSRM in libc too. These read and write the floating-point rounding mode directly, not the whole floating-point control and status register. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpgetround.c \ src/lib/libc/arch/riscv/gen/fpsetround.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/arch/riscv/gen/fpgetround.c diff -u src/lib/libc/arch/riscv/gen/fpgetround.c:1.3 src/lib/libc/arch/riscv/gen/fpgetround.c:1.4 --- src/lib/libc/arch/riscv/gen/fpgetround.c:1.3 Sun May 7 12:41:47 2023 +++ src/lib/libc/arch/riscv/gen/fpgetround.c Thu May 16 00:56:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fpgetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $ */ +/* $NetBSD: fpgetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $ */ /* * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fpgetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $"); +__RCSID("$NetBSD: fpgetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -47,5 +47,5 @@ __weak_alias(fpgetround,_fpgetround) fp_rnd fpgetround(void) { - return __SHIFTOUT(fcsr_read(), FCSR_FRM); + return fcsr_frm_read(); } Index: src/lib/libc/arch/riscv/gen/fpsetround.c diff -u src/lib/libc/arch/riscv/gen/fpsetround.c:1.3 src/lib/libc/arch/riscv/gen/fpsetround.c:1.4 --- src/lib/libc/arch/riscv/gen/fpsetround.c:1.3 Sun May 7 12:41:47 2023 +++ src/lib/libc/arch/riscv/gen/fpsetround.c Thu May 16 00:56:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fpsetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $ */ +/* $NetBSD: fpsetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $ */ /* * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fpsetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $"); +__RCSID("$NetBSD: fpsetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -47,5 +47,5 @@ __weak_alias(fpsetround,_fpsetround) fp_rnd fpsetround(fp_rnd rnd_dir) { - return __SHIFTOUT(fcsr_frm_write(__SHIFTIN(rnd_dir, FCSR_FRM)), FCSR_FRM); + return fcsr_frm_write(rnd_dir); }