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] tile: create new math-tests.h header


On 11/18/2016 4:18 PM, Joseph Myers wrote:
On Fri, 18 Nov 2016, Chris Metcalf wrote:

On 11/18/2016 1:11 PM, Joseph Myers wrote:
On Fri, 18 Nov 2016, Chris Metcalf wrote:

We clearly should also tell libgcc not to bother preserving nan
payloads given that the hardware doesn't do it in any case; I'll pass
that along to the compiler team, but I'll also commit my original
patch since it seems to match the hardware behavior.
FWIW, I wouldn't expect any significant performance difference between
copying a payload and setting a payload to the canonical one (which is
what you get if !_FP_KEEPNANFRACP).
My assumption was that we should tweak it for consistency, not for
performance.  Is your sense that we might as well keep the NaN
payloads in libgcc even if we don't with inline float operations?
Consistency with hardware is logical (I think the reason for such hooks in
soft-fp is to allows its use in Linux kernel floating-point emulation to
behave the same as the hardware being emulated).  Note however that when
soft-fp creates a default NaN it also gives it a default sign - if that's
what you want for consistency with hardware, you'll need a new
math-tests.h hook for these canonicalize tests to disregard the sign of
the result as well as its payload.

Good point, but, the hardware does preserve the sign of NaN's, so
just disabling the payload testing is sufficient for the tests to pass.

I think we may just leave the payload copying enabled in soft-fp
unless you think it's a bad choice; it seems harmless and arguably
might give us better results in some circumstances.

--
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com


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