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], PowerPC IEEE 128-bit fp, #11 (enable libgcc conversions)


On Tue, Dec 29, 2015 at 11:38 AM, Michael Meissner
<meissner@linux.vnet.ibm.com> wrote:
> This patch enables support of the __float128 software emulation functions in
> libgcc.  The patch is reworked from previous versions of this patch (listed as
> patch #8).
>
> This patch adds support for declaring emulation functions that either use the
> software emulation functions from the soft-fp subdirectory converted for
> PowerPC __float128 via sed, or by using the hardware instructions that will be
> present in ISA 3.0 (power9).  Thus if you compile code for power7/power8 and
> run it on a power9 system, it use the hardware support when running on power9.
>
> I removed the old comparison functions that was in previous versions of this
> patch, and instead went with the standard EQ, GE, LE, and UNORD software
> emulation support (patch #10 changes the compiler to use these functions).
>
> This patch adds support to use the hardware rounding modes and exceptions for
> software emulation that was done by Steven Munroe and Tulio Magno.
>
> The __float128 support is only enabled on 64-bit PowerPC Linux systems, where
> the base compler targets at least power7.  On big endian systems, you can use
> __float128 in 32-bit mode, but the support functions are not built on a purely
> 32-bit system.
>
> At the moment, there is no support for converting between decimal types and
> __float128, nor for the complex __float128 support.  These are being worked on,
> and should be done in the GCC 7.x time frame.  However, it is important to add
> the software emulation support in GCC 6.x now so that most users that want to
> use IEEE 128-bit floating point can use it, and that we can work on the glibc
> issues to fully support __float128 in the GCC 7.x time frame.  There might be
> problems that need to be fixed, but without the libgcc changes, nobody can use
> __float128.
>
> I have done bootstraps on a big-endian power7 system and little-endian power8
> system with no regressions.  I have also built a compiler on a SLES 11.3 system
> to make sure that it builds on systems without the ISA 3.0 instructions (in
> this case, the ifunc resolver always returns the software emulation function).
> Is this ok to install in the tree along with IEEE patch #10?
>
> 2015-12-29  Michael Meissner  <meissner@linux.vnet.ibm.com>
>             Steven Munroe (munroesj@linux.vnet.ibm.com)
>             Tulio Magno Quites Machado Filho <tulioqm@br.ibm.com>
>
>         * config/rs6000/floattikf-sw.c: New file to convert signed 128-bit
>         integers to IEEE 128-bit floating point.
>
>         * config/rs6000/float128-hw.c: New file for ISA 3.0 IEEE 128-bit
>         floating point hardware support.
>
>         * config/rs6000/fixkfti-sw.c: New file to convert IEEE 128-bit
>         floating point to signed 128-bit integer.
>
>         * config/rs6000/float128-ifunc.c: New file to pick either IEEE
>         128-bit floating point software emulation or use ISA 3.0 hardware
>         support if it is available.
>
>         * config/rs6000/fixunskfti-sw.c: New file to convert IEEE 128-bit
>         floating point to unsigned 128-bit integer.
>
>         * config/rs6000/extendkftf2-sw.c: New file to convert IBM extended
>         double to IEEE 128-bit floating point.
>
>         * config/rs6000/floatuntikf-sw.c: New file to convert unsigned
>         128-bit integer to IEEE 128-bit floating point.
>
>         * config/rs6000/trunctfkf2-sw.c: New file to convert IEEE 128-bit
>         floating point to IBM extended double.
>
>         * config/rs6000/t-float128: New file to build IEEE 128-bit
>         floating point emulator functions.
>
>         * config/rs6000/t-float128-hw: New file to build IEEE 128-bit
>         floating point emulator functions using ISA 3.0 hardware
>         instructions.
>
>         * config/rs6000/sfp-exceptions.c: New file to provide exception
>         support for IEEE 128-bit floating point.
>
>         * config/rs6000/quad-float128.h: New file to support IEEE 128-bit
>         floating point.
>
>         * config/rs6000/float128-sed: New file to convert TF names to KF
>         names for PowerPC IEEE 128-bit floating point support.
>
>         * config/rs6000/sfp-machine.h (_FP_W_TYPE_SIZE): Use 64-bit types
>         when building on 64-bit systems, or when VSX is enabled.
>         (_FP_W_TYPE): Likewise.
>         (_FP_WS_TYPE): Likewise.
>         (_FP_I_TYPE): Likewise.
>         (TItype): Define on 64-bit systems.
>         (UTItype): Likewise.
>         (TI_BITS): Likewise.
>         (_FP_MUL_MEAT_D): Add support for using 64-bit types.
>         (_FP_MUL_MEAT_Q): Likewise.
>         (_FP_DIV_MEAT_D): Likewise.
>         (_FP_DIV_MEAT_Q): Likewise.
>         (_FP_NANFRAC_D): Likewise.
>         (_FP_NANFRAC_Q): Likewise.
>         (ISA_BIT): Add exception support.
>         (FP_EX_INVALID): Likewise.
>         (FP_EX_OVERFLOW): Likewise.
>         (FP_EX_UNDERFLOW): Likewise.
>         (FP_EX_DIVZERO): Likewise.
>         (FP_EX_INEXACT): Likewise.
>         (FP_EX_ALL): Likewise.
>         (__sfp_handle_exceptions): Likewise.
>         (FP_HANDLE_EXCEPTIONS): Likewise.
>         (FP_RND_NEAREST): Likewise.
>         (FP_RND_ZERO): Likewise.
>         (FP_RND_PINF): Likewise.
>         (FP_RND_MINF): Likewise.
>         (FP_RND_MASK): Likewise.
>         (_FP_DECL_EX): Likewise.
>         (FP_INIT_ROUNDMODE): Likewise.
>         (FP_ROUNDMODE): Likewise.
>
>         * libgcc/config.host (powerpc*-*-linux*): If compiler can compile
>         VSX code, enable IEEE 128-bit floating point.
>
>         * Makefile.in (EXTRA_CLEAN): Add extra files to be delete with
>         make clean.
>         (FLAGS_TO_PASS): Likewise.
>         (clean rule): Likewise.
>
>         * configure.ac (powerpc*-*-linux*): Check whether the PowerPC
>         compiler can do __float128.
>         * configure: Regenerate.

The revised patch is okay with me in theory, but I would like Joseph
to check that this is the way he wants the solution addressed and
implemented.

Also, I cannot approve the Makefile.in change.

Thanks, David


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