aboutsummaryrefslogtreecommitdiff
path: root/libgcc/config
diff options
context:
space:
mode:
authorKito Cheng <kito.cheng@sifive.com>2023-06-29 16:13:45 +0800
committerKito Cheng <kito.cheng@sifive.com>2023-07-06 14:31:55 +0800
commit0d40aeb9b85db87e4a502a530db5b89027d1a3b6 (patch)
treedf7fdc255003028a8e19027d779418609c3bbf32 /libgcc/config
parente1c23189abdd7bbbc066b2aa47ae4b7db0d69f2b (diff)
downloadgcc-0d40aeb9b85db87e4a502a530db5b89027d1a3b6.zip
gcc-0d40aeb9b85db87e4a502a530db5b89027d1a3b6.tar.gz
gcc-0d40aeb9b85db87e4a502a530db5b89027d1a3b6.tar.bz2
RISC-V: Handle rouding mode correctly on zfinx
Zfinx has provide fcsr like F, so rouding mode should use fcsr instead of `soft` fenv. libgcc/ChangeLog: * config/riscv/sfp-machine.h (FP_INIT_ROUNDMODE): Check zfinx. (FP_HANDLE_EXCEPTIONS): Ditto.
Diffstat (limited to 'libgcc/config')
-rw-r--r--libgcc/config/riscv/sfp-machine.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgcc/config/riscv/sfp-machine.h b/libgcc/config/riscv/sfp-machine.h
index ded594d..38e2817 100644
--- a/libgcc/config/riscv/sfp-machine.h
+++ b/libgcc/config/riscv/sfp-machine.h
@@ -113,7 +113,7 @@ typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
#define _FP_TININESS_AFTER_ROUNDING 1
-#ifdef __riscv_flen
+#if defined(__riscv_flen) || defined(__riscv_zfinx)
#define FP_INIT_ROUNDMODE \
do { \
__asm__ volatile ("frrm %0" : "=r" (_frm)); \