This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
Re: [Bug math/15384] New: One constant fewer in ieee754/dbl-64/wordsize-64/s_finite.c
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: "marc.glisse at normalesup dot org" <sourceware-bugzilla at sourceware dot org>
- Cc: glibc-bugs at sourceware dot org
- Date: Sun, 21 Apr 2013 12:39:37 +0200
- Subject: Re: [Bug math/15384] New: One constant fewer in ieee754/dbl-64/wordsize-64/s_finite.c
- References: <bug-15384-131 at http dot sourceware dot org/bugzilla/>
On Sun, Apr 21, 2013 at 10:06:00AM +0000, marc.glisse at normalesup dot org wrote:
> http://sourceware.org/bugzilla/show_bug.cgi?id=15384
>
> Bug #: 15384
> Summary: One constant fewer in
> ieee754/dbl-64/wordsize-64/s_finite.c
> Product: glibc
> Version: unspecified
> Status: NEW
> Severity: enhancement
> Priority: P2
> Component: math
> AssignedTo: unassigned@sourceware.org
> ReportedBy: marc.glisse@normalesup.org
> Classification: Unclassified
>
>
> Hello,
>
> this is very minor, and I don't even know what platforms use this file, but in
> ieee754/dbl-64/wordsize-64/s_finite.c:
>
> int
> __finite(double x)
> {
> int64_t lx;
> EXTRACT_WORDS64(lx,x);
> return
> (int)((uint64_t)((lx&INT64_C(0x7fffffffffffffff))-INT64_C(0x7ff0000000000000))>>63);
> }
>
It could be simplified more. Constants are not necessary here. I will
post patch to libc-alpha.
> The first constant 0x7fffffffffffffff is unnecessary, it would work just as
> well with 0x7ff0000000000000, so there is only one constant loaded. The same
> applies to the 32 bit version, but for platforms like x86 that embed 32 bit
> constants in the instruction it probably wouldn't matter.
>
> --
> Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.