* [PATCH] RISC-V: Handle rouding mode correctly on zfinx
@ 2023-07-05 8:11 Kito Cheng
2023-07-05 14:15 ` Jeff Law
0 siblings, 1 reply; 3+ messages in thread
From: Kito Cheng @ 2023-07-05 8:11 UTC (permalink / raw)
To: gcc-patches, kito.cheng, palmer, jeffreyalaw; +Cc: Kito Cheng
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.
---
libgcc/config/riscv/sfp-machine.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgcc/config/riscv/sfp-machine.h b/libgcc/config/riscv/sfp-machine.h
index ded594d75d87..38e2817bffa2 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)); \
--
2.40.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RISC-V: Handle rouding mode correctly on zfinx
2023-07-05 8:11 [PATCH] RISC-V: Handle rouding mode correctly on zfinx Kito Cheng
@ 2023-07-05 14:15 ` Jeff Law
2023-07-06 6:33 ` Kito Cheng
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2023-07-05 14:15 UTC (permalink / raw)
To: Kito Cheng, gcc-patches, kito.cheng, palmer
On 7/5/23 02:11, Kito Cheng wrote:
> 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.
OK
jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RISC-V: Handle rouding mode correctly on zfinx
2023-07-05 14:15 ` Jeff Law
@ 2023-07-06 6:33 ` Kito Cheng
0 siblings, 0 replies; 3+ messages in thread
From: Kito Cheng @ 2023-07-06 6:33 UTC (permalink / raw)
To: Jeff Law; +Cc: gcc-patches, kito.cheng, palmer
Committed to trunk, and plan to back port to GCC 13 branch 1 week later :)
On Wed, Jul 5, 2023 at 10:15 PM Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
>
> On 7/5/23 02:11, Kito Cheng wrote:
> > 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.
> OK
> jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-06 6:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-05 8:11 [PATCH] RISC-V: Handle rouding mode correctly on zfinx Kito Cheng
2023-07-05 14:15 ` Jeff Law
2023-07-06 6:33 ` Kito Cheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).