On Fri, May 3, 2019 at 3:11 PM Maciej W. Rozycki <ma...@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

Reply via email to