This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 12/28] math: Use wordsize-64 version for isnan
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: "Gabriel F. T. Gomes" <gabriel at inconstante dot eti dot br>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: nd <nd at arm dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Tue, 11 Jun 2019 17:15:48 +0000
- Subject: Re: [PATCH 12/28] math: Use wordsize-64 version for isnan
Hi Gabriel,
> I don't actually understand what the impact on 32-bits platforms would
> be, so I can't comment on that, but, if this patch turns out to be
> problematic for 32-bits, we could patch sysdeps/ieee754/ldbl-opt files
> to be mindful of __WORDSIZE and selectively include files from
> sysdeps/ieee754/dbl-64 or sysdeps/ieee754/dbl-64/wordsize-64 (see
> attached patch for an explanation of what I mean).
I don't believe using simple masking, compares and fixed shifts can
result in a noticeable difference on 32-bit targets. It could make a
difference if it involves full 64-bit multiply, division or non-constant shift.
However rather than making the already complex scheme even more
complex, I would suggest to have if (WORDSIZE == 4) special paths
if there are cases where it helps. That way we can merge all wordsize-64
code into the generic variant and remove the wordsize-64 directories
completely.
Having only one variant of each function actually makes it reasonable to
optimise it.
Wilco