This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] soft-fp: Add floattixf.c and floatuntixf.c
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 21 Jan 2019 22:39:34 +0000
- Subject: Re: [PATCH] soft-fp: Add floattixf.c and floatuntixf.c
- References: <20190121194255.13036-1-hjl.tools@gmail.com>
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