This series of 11 patches adds the preliminary support on PowerPC servers for 2 forms of 16-bit floating point.
1: _Float16 -- IEEE 754 16-bit floating point 2: __bfloat16 -- Google brain16 16-bit floating point This is only added on the little endian PowerPC servers that support ISA 2.08 (power8) and later systems. On ISA 2.07 (power8) systems, both _Float16 and __bfloat16 will be done with software emulation. On ISA 3.0 (power9) systems, _Float16 will be handled directly using the XSCVHPDP and XSCVDPHP instructions that can convert between _Float16 and double scalar values. The __bfloat16 types will be handled via software emulation. On ISA 3.1 (power10 and power11) systems, both _Float16 and __bfloat16 will be handled directly. In ISA 3.1, __bfloat16 will use the XVCVBF16SPN and XVCVSPBF16 instructions that convert between the even elements of __bfloat16 vectors and vectors of float. I'm sure there are other things that will be needed to be done in the future, but I would like to add these patches now to work on the remaining bugs in the future. There are 11 patches in this patch set. It is assumed that the following patches have been applied before these patches can be applied: * https://gcc.gnu.org/pipermail/gcc-patches/2025-November/700539.html * https://gcc.gnu.org/pipermail/gcc-patches/2025-November/700540.html * https://gcc.gnu.org/pipermail/gcc-patches/2025-November/700542.html * https://gcc.gnu.org/pipermail/gcc-patches/2025-November/700543.html * https://gcc.gnu.org/pipermail/gcc-patches/2025-November/700544.html These patches do not actually need the -mcpu=future additions that the above patches provide, but there might need to be minor adjustments made if those patches are not applied. The patches are: Patch #1: Add infrastructure for _Float16 and __bfloat16 types that will be added in the next patch. Patch #2: Add initial 16-bit floating point support. Patch #3: Add HF/BF emulation functions to libgcc. Patch #4: Add conversions between _Float16 and float/double. Patch #5: Add conversions between __bfloat16 and float/double. Patch #6: Add conversions between 16-bit floating point and other scalar modes. Patch #7: Add BF/HF negative, absolute value operations. In order to provide these operations, logical (AND, IOR, XOR, etc.) are also provided. Patch #8: Add support for 16-bit floating point vectorization. Patch #9: Optimize __bfloat16 scalar code. Patch #10: Add --with-powerpc-float16 and --with-powerpc-float16-disable-warning configuration options. Patch #11: Add _Float16 and __bfloat16 tests. I have been built bootstrap compilers on both little endian and big endian PowerPC server systems and there were no regressions. Note, the 16-bit floating point tests will only run on the little endian PowerPC servers. -- Michael Meissner, IBM PO Box 98, Ayer, Massachusetts, USA, 01432 email: [email protected]
