http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56828



             Bug #: 56828

           Summary: [PowerPC] Type cast of sNaN value

    Classification: Unclassified

           Product: gcc

           Version: unknown

            Status: UNCONFIRMED

          Severity: minor

          Priority: P3

         Component: target

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: tschwi...@gcc.gnu.org

            Target: powerpc





Created attachment 29791

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29791

snan.c



On PowerPC, in versions of GCC up to at least 4.7.2, a type cast -- which

is a IEEE 754-2008 general-computational convertFormat operation (IEEE

754-2008, 5.4.2) -- does not turn a sNaN into a qNaN (whilst raising an

INVALID exception), which is contrary to IEEE 754-2008 5.1 and 7.2.



See the attached snan.c, for which I get for powerpc-linux-gnu-gcc -m64

(additionally specifying -fsignaling-nans doesn't make a difference):



    7ff40000 0 0 0

    7ff40000 0

    7ff40000 0

    7fe00000

    7fa00000



The second like should have been: 7ffc0000 0 (or

similar; top-most fraction bit (0x0008000) set).



See also the discussion in

<http://news.gmane.org/find-root.php?message_id=%3c5151E427.1080106%40linux.vnet.ibm.com%3e>

and thereabouts, and the SNAN_TESTS_TYPE_CAST usage in glibc commit

572676160d5639edc0ecb663147bd291841458d1,

<http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=572676160d5639edc0ecb663147bd291841458d1>.

Reply via email to