]> gcc.gnu.org Git - gcc.git/commit
Update float 128-bit conversions, PR target/107299.
authorMichael Meissner <meissner@linux.ibm.com>
Wed, 9 Nov 2022 05:38:18 +0000 (00:38 -0500)
committerMichael Meissner <meissner@linux.ibm.com>
Thu, 17 Nov 2022 21:49:37 +0000 (16:49 -0500)
commit2b963dafca71a90b3aea1c4f650cc2565865237c
treecaa76c6de773e8f15abfe55bd37bedb37ec13a15
parentf95e05f7f6a08eab88230aa851f3bc82358b0f14
Update float 128-bit conversions, PR target/107299.

This patch fixes two tests that are still failing when long double is IEEE
128-bit after the previous 2 patches for PR target/107299 have been applied.
The tests are:

gcc.target/powerpc/convert-fp-128.c
gcc.target/powerpc/pr85657-3.c

This patch is a rewrite of the patch submitted on August 18th:

| https://gcc.gnu.org/pipermail/gcc-patches/2022-August/599988.html

This patch reworks the conversions between 128-bit binary floating point types.
Previously, we would call rs6000_expand_float128_convert to do all conversions.
Now, we only define the conversions between the same representation that turn
into a NOP.  The appropriate extend or truncate insn is generated, and after
register allocation, it is converted to a move.

This patch also fixes two places where we want to override the external name
for the conversion function, and the wrong optab was used.  Previously,
rs6000_expand_float128_convert would handle the move or generate the call as
needed.  Now, it lets the machine independent code generate the call.  But if
we use the machine independent code to generate the call, we need to update the
name for two optabs where a truncate would be used in terms of converting
between the modes.  This patch updates those two optabs.

I tested this patch on:

    1) LE Power10 using --with-cpu=power10 --with-long-double-format=ieee
    2) LE Power10 using --with-cpu=power10 --with-long-double-format=ibm
    3) LE Power9  using --with-cpu=power9  --with-long-double-format=ibm
    4) BE Power8  using --with-cpu=power8  --with-long-double-format=ibm

In the past I have also tested this exact patch on the following systems:

    1) LE Power10 using --with-cpu=power9  --with-long-double-format=ibm
    2) LE Power10 using --with-cpu=power8  --with-long-double-format=ibm
    3) LE Power10 using --with-cpu=power10 --with-long-double-format=ibm

There were no regressions in the bootstrap process or running the tests (after
applying all 3 patches for PR target/107299).  Can I check this patch into the
trunk?

2022-11-09   Michael Meissner  <meissner@linux.ibm.com>

gcc/

PR target/107299
* config/rs6000/rs6000.cc (init_float128_ieee): Use the correct
float_extend or float_truncate optab based on how the machine converts
between IEEE 128-bit and IBM 128-bit.
* config/rs6000/rs6000.md (IFKF): Delete.
(IFKF_reg): Delete.
(extendiftf2): Rewrite to be a move if IFmode and TFmode are both IBM
128-bit.  Do not run if TFmode is IEEE 128-bit.
(extendifkf2): Delete.
(extendtfkf2): Delete.
(extendtfif2): Delete.
(trunciftf2): Delete.
(truncifkf2): Delete.
(trunckftf2): Delete.
(extendkftf2): Implement conversion of IEEE 128-bit types as a move.
(trunctfif2): Delete.
(trunctfkf2): Implement conversion of IEEE 128-bit types as a move.
(extend<mode>tf2_internal): Delete.
(extendtf<mode>2_internal): Delete.
gcc/config/rs6000/rs6000.cc
gcc/config/rs6000/rs6000.md
This page took 0.06541 seconds and 6 git commands to generate.