https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125966

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by jeevitha <[email protected]>:

https://gcc.gnu.org/g:e77c745aa5ec0c83c65484d8ccfb8e30ec26c591

commit r17-7057-ge77c745aa5ec0c83c65484d8ccfb8e30ec26c591
Author: Jeevitha <[email protected]>
Date:   Thu Dec 3 00:35:18 2026 -0500

    rs6000: Target requires int128 support [PR125966]

    The fp128_conversions.c test inspects the 128-bit conversion results
    through a union of two 64-bit halves, and assumes throughout that
    element [1] holds the most significant half and element [0] the least
    significant one.  That is only true on little endian: __float128 and
    __int128_t are single 128-bit scalars, so which array element holds
    the most significant half depends on the target endianness.  Add
    MSW/LSW macros for the two halves and use them when reading the union.

    Each check only aborted when both halves differed, so a single
    corrupted half went unnoticed.  Use "||" instead.  Two expected values
    were wrong and had been hidden by this:

      - (__int128) 12345.6789 is 12345, so its most significant half is
        0, not 0x1407374883526960.
      - (__int128) -6789.12345 is -6789, so its most significant half is
        0xffffffffffffffff (sign extension), not 0.

    The long double check assumed IBM double-double.  When long double is
    IEEE 128-bit, the stored value has the __float128 layout, so the check
    aborted on little endian.  Select the expected value and the halves
    to compare (LD_HI/LD_LO) on __LONG_DOUBLE_IEEE128__.

    Both tests use __int128, so add the missing int128 effective-target
    check, the -m32 variants now report UNSUPPORTED instead of FAIL.

    Tested on powerpc64-linux-gnu and powerpc64le-linux-gnu, the builds were
    configured with --with-long-double-128 / --with-long-double-format=ieee.

    2026-12-03  Manjunath Matti  <[email protected]>

    gcc/testsuite/ChangeLog:

            PR target/125966
            * gcc.target/powerpc/fp128_conversions.c: Require int128
            effective target check.  Expect two xscvsqqp when long double
            is not IBM 128-bit.
            (MSW, LSW, LD_HI, LD_LO): New macros.
            (main): Use them when reading the union.  Fail if either half
            of a result is wrong.  Fix the expected most significant halves
            of the conv_fp128_2_i128 results.  Handle IEEE 128-bit long
            double.  Print the result in the DEBUG output.
            * gcc.target/powerpc/int_128bit-runnable.c: Require int128
            effective target check.

Reply via email to