This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH], Re-fix PR 70381 (disable -mfloat128 by default) and add workaround for PR 70589


On Thu, Apr 7, 2016 at 7:44 PM, Michael Meissner
<meissner@linux.vnet.ibm.com> wrote:
> After applying the fix for PR 70381 to not enable -mfloat128 by default, I
> discovered the IEEE 128-bit floating point emulation routines in libgcc are no
> longer being built.
>
> The reason for this is the configuration test involved compiling this program:
>
>         #pragma GCC target ("vsx,float128")
>         __float128 add (__float128 *a) { return *a + *(a+1); }
>
> to see if the __float128 support was enabled.  Unfortunately, I discovered that
> you can't currently set/disable float128 via the target option attribute or
> target pragmas. This is due to the fact that if -mfloat128 is disabled, the
> __float128 and __ibm128 keywords are not created.
>
> I raised this as a separate bug (70589).
>
> This patch does several things:
>
>    1)   It disables using float128 in target attributes or target pragmas.
>
>    2)   It fixes the configure test for software emulation to just see if the
>         ISA 2.06 (vsx) instruction set is available. The makefile options in
>         the PowerPC libgcc build ensures that -mfloat128 is used. I used
>         similar logic to detect ISA 3.0 to see if we have support for the IEEE
>         128-bit floating point hardware.
>
>    3)   I updated the documentation for -mfloat128.
>
>    4)   I added two executable tests to verify that the float emulation is
>         correct.  In working on adding the tests, I discovered I had the return
>         value from main inverted, and the test would fail.
>
> I have run a boostrap build and a make check to verify that the IEEE 128-bit
> floating point emulator in libgcc is indeed built. Are these patches ok to
> install in the GCC trunk?
>
> [gcc]
> 2016-04-07  Michael Meissner  <meissner@linux.vnet.ibm.com>
>
>         PR target/70589
>         * config/rs6000/rs6000.c (rs6000_opt_masks): Disable using the
>         target attribute and pragma from changing the -mfloat128
>         and -mfloat128-hardware options.
>
>         * doc/extend.texi (Additional Floating Types): Document PowerPC
>         __float128 restrictions.
>
> [libgcc]
> 2016-04-07  Michael Meissner  <meissner@linux.vnet.ibm.com>
>
>         PR target/70381
>         * configure.ac (powerpc*-*-linux*): Rework tests to build
>         __float128 emulation routines to not depend on using #pragma GCC
>         target to enable -mfloat128.
>         * configure: Regnerate.
>
> [gcc/testsuite]
> 2016-04-07  Michael Meissner  <meissner@linux.vnet.ibm.com>
>
>         PR target/70381
>         * gcc.target/powerpc/float128-1.c: New tests to make sure the
>         __float128 emulator is built and runs.
>         * gcc.target/powerpc/float128-1.c: Likewise.
>
>         * lib/target-supports.exp (check_ppc_float128_sw_available):
>         Rework tests for __float128 software and hardware
>         availability. Fix exit condition to return 0 on success.

This is okay.

Thanks, David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]