[PATCH 4/4] riscv: Addfpgetroundtoi and fpsetroundtoi stubs

Keith Packard keithp@keithp.com
Tue Jan 21 08:23:00 GMT 2020


Kito Cheng <kito.cheng@gmail.com> writes:

> According RISC-V ISA spec, V20190608 11.7:
> "All floating-point to integer and integer to floating-point
> conversion instructions round according to the rm field."
> So seem like FP_RDI_RD would be better value if hard float is available.

I just realized -- we might be able to do that on targets with hard
float and double, but many targets have only hard float and use software
for doubles. In this case, the rounding mode will differ between float
(hardware) and double (software).

So, perhaps this API should just return -1 as well...

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20200121/4d2e4de7/attachment.sig>


More information about the Newlib mailing list