This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] soft-fp: Add floattixf.c and floatuntixf.c


On Mon, 21 Jan 2019, H.J. Lu wrote:

> TI->XF conversions in libgcc2.c:
> 
> XFtype
> __floatdixf (DWtype u)
> {
>   XFtype d = (Wtype) (u >> W_TYPE_SIZE);
>   d *= Wtype_MAXp1_F;
>   d += (UWtype)u;
>   return d;
> }
> 
> have no rounding mode support.  Add floattixf.c and floatuntixf.c to

That doesn't need rounding mode support.  XFmode has 64-bit precision, so 
all 64-bit integer values can be represented exactly in XFmode, so that 
function only has a single possibly inexact operation (the addition), so 
only a single rounding, which will use the hardware rounding mode.  (The 
x87 rounding mode, not the SSE rounding mode, of course, but nothing 
should make those two rounding modes different other than a limited amount 
of code inside glibc that optimizes by knowing that certain code only ever 
uses one of the floating-point units so only needs that rounding mode 
changed.)

> soft-fp to support rounding mode.

I see no reasonable use for XFmode soft-fp functions in libgcc (other than 
the conversions to/from TFmode, of course); XFmode is only used in libgcc 
when it's a hardware type, which means the libgcc2.c functions that are 
based around hardware operations are preferable.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]