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

Jim Wilson jimw@sifive.com
Tue Jan 21 22:43:00 GMT 2020


I think fpgetroundtoi and fpsetroundtoi should always return error.

I found a reference in a NEC V810 manual that has separate bits for FP
rounding and FP->INT conversion rounding.  Hence it needs two separate
interfaces to be able to access the two sets of rounding bits.  For
bonus points, it mentions that tkcw means task control word.  tkcw is
used in the newlib sysvi386 port implementation of these functions.
So I think some very old (pre x87?) x86 ports also had two separate
sets of rounding bits, and this is why newlib has the second set of
functions.  I didn't find a reference to confirm this though.  But for
any modern machine, there is only one set of FP rounding flags, and
hence I think the fp{get,set}roundtoi functions are useless, and
should always return error.

Jim



More information about the Newlib mailing list