Bug 11585 - [ia64] signbit() macro on IA64 fails on long double -NaN
Summary: [ia64] signbit() macro on IA64 fails on long double -NaN
Status: RESOLVED WONTFIX
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: 2.12
: P2 normal
Target Milestone: 2.39
Assignee: H.J. Lu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-11 00:44 UTC by Petr Baudis
Modified: 2024-01-09 02:53 UTC (History)
7 users (show)

See Also:
Host: ia64-suse-linux-gnu
Target: ia64-suse-linux-gnu
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Baudis 2010-05-11 00:44:25 UTC
signbit() on a -NaN will not correctly detect the sign if the assembly version
is used. Small testcase:

#include <math.h>
int main()
{
  float f = -0.0/0.0;
  printf ("%d vs. %d\n", __signbitf(f), __builtin_signbit(f));
  return 0;
}

Prints: 0 vs. 1

If you force the use of mathinlines.h by compiling with -O2 -std=c99, the
result will be correct, but with just -O2 or -O0 without -std=c99
the mathinlines won't be used, and hence the incorrect implementation in
libc.so is called.

Unfortunately, fclass.m fclass9 as used in the assembly

.mfi
        fclass.m p6, p7 = farg0, @zero | @unorm | @norm | @inf | @neg
        ;;

seemingly cannot be used for NaN sign testing according to Intel specs - of
course the concept of NaN sign is kind of strange, but IEEE mandates it. 

Perhaps it would be best to disable the assembly version altogether?

(The description includes comments by Richard Guenther and Michael Matz from a
private Novell bug.)
Comment 1 Andreas Jaeger 2011-09-29 09:12:48 UTC
HJ, can you have a look at this, please?
Comment 2 Joseph Myers 2012-02-22 17:09:56 UTC
Suspending until there is an IA64 maintainer to add IA64 back to ports, CCing Aurelien.
Comment 3 Joseph Myers 2012-04-23 09:53:41 UTC
Unsuspending now IA64 is in ports, CC:ing IA64 maintainer.
Comment 4 Sourceware Commits 2024-01-08 20:09:55 UTC
The master branch has been updated by Adhemerval Zanella <azanella@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=460860f457e2a889785c506e8c77d4a7dff24d3e

commit 460860f457e2a889785c506e8c77d4a7dff24d3e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Mon Jan 8 10:21:17 2024 -0300

    Remove ia64-linux-gnu
    
    Linux 6.7 removed ia64 from the official tree [1], following the general
    principle that a glibc port needs upstream support for the architecture
    in all the components it depends on (binutils, GCC, and the Linux
    kernel).
    
    Apart from the removal of sysdeps/ia64 and sysdeps/unix/sysv/linux/ia64,
    there are updates to various comments referencing ia64 for which removal
    of those references seemed appropriate. The configuration is removed
    from README and build-many-glibcs.py.
    
    The CONTRIBUTED-BY, elf/elf.h, manual/contrib.texi (the porting
    mention), *.po files, config.guess, and longlong.h are not changed.
    
    For Linux it allows cleanup some clone2 support on multiple files.
    
    The following bug can be closed as WONTFIX: BZ 22634 [2], BZ 14250 [3],
    BZ 21634 [4], BZ 10163 [5], BZ 16401 [6], and BZ 11585 [7].
    
    [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43ff221426d33db909f7159fdf620c3b052e2d1c
    [2] https://sourceware.org/bugzilla/show_bug.cgi?id=22634
    [3] https://sourceware.org/bugzilla/show_bug.cgi?id=14250
    [4] https://sourceware.org/bugzilla/show_bug.cgi?id=21634
    [5] https://sourceware.org/bugzilla/show_bug.cgi?id=10163
    [6] https://sourceware.org/bugzilla/show_bug.cgi?id=16401
    [7] https://sourceware.org/bugzilla/show_bug.cgi?id=11585
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Comment 5 Adhemerval Zanella 2024-01-09 02:53:43 UTC
ia64 has been removed from glibc.