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

Kito Cheng kito.cheng@gmail.com
Wed Jan 22 07:06:00 GMT 2020


Hi Jim, Keith:

I agree both should return error (-1), the problem seems more
complicated if we consider long double.
But those functions are seems like useless now, so yeah, let's always
return error :P

Thanks :)

On Wed, Jan 22, 2020 at 6:43 AM Jim Wilson <jimw@sifive.com> wrote:
>
> 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