This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libphobos: RISC-V: Fix soft-float build errors with IEEE exception flags
- From: Jim Wilson <jimw at sifive dot com>
- To: "Maciej W. Rozycki" <macro at wdc dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Iain Buclaw <ibuclaw at gdcproject dot org>, David Abdurachmanov <david dot abdurachmanov at gmail dot com>, Kito Cheng <kito dot cheng at gmail dot com>, Palmer Dabbelt <palmer at sifive dot com>, Andrew Waterman <andrew at sifive dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 6 May 2019 12:03:17 -0700
- Subject: Re: [PATCH] libphobos: RISC-V: Fix soft-float build errors with IEEE exception flags
- References: <alpine.DEB.2.20.1905020024000.4073@tpp.hgst.com> <CAFyWVaYdHs56aSmTdSVyAvOAcQL+XP=R4s2vjv4eh7oCvt+oLA@mail.gmail.com> <alpine.DEB.2.20.1905032042520.4073@tpp.hgst.com> <alpine.DEB.2.20.1905032249420.4073@tpp.hgst.com>
On Fri, May 3, 2019 at 3:11 PM Maciej W. Rozycki <macro@wdc.com> wrote:
> Hmm, I've been thinking a little bit about this hybrid mode and I have
> one question: how do we pass the IEEE rounding mode setting between `fcsr'
> and softfp where we have `-march=rv32imafc -mabi=ilp32' and
> `-march=rv32imac -mabi=ilp32' object modules interlinked?
If you look at libgcc/config/riscv/sfp-machine.h you will see
definitions of FP_INIT_ROUNDMODE and FP_HANDLE_EXCEPTIONS for reading
rounding mode from the fcsr before soft-float FP operations, and
storing the exception flags back into fcsr after soft-float FP
operations, if FP regs exist.. Whether this actually works, I don't
know, I haven't tested it. I think in practice people using
soft-float libraries are probably not relying on rounding modes and
exception flags much if at all, so this is unlikely to be a problem.
If someone does find a problem, I will worry about how to fix it then.
Jim