]> gcc.gnu.org Git - gcc.git/commit
Allow insns using 128-bit float to either either mode that supports it.
authorMichael Meissner <meissner@linux.ibm.com>
Wed, 10 Aug 2022 18:35:04 +0000 (14:35 -0400)
committerMichael Meissner <meissner@linux.ibm.com>
Wed, 10 Aug 2022 18:35:04 +0000 (14:35 -0400)
commit410da5fc9813c0afa22996d9e4df299469aa5e55
tree8d066363f8813bb9b2ef207bed7ac52248b84bca
parent72ae6a3f18acff8a909167f162c668fd773e0432
Allow insns using 128-bit float to either either mode that supports it.

This patch adds new predicates for IEEE 128-bit and IBM 128-bit registers.  The
predicate specifically allows either mode that supports the floating point
format (i.e. KFmode and TFmode when -mabi=ieeelongdouble is used).

The reason is to avoid adding a bunch of extra insns that have NOP conversions
to be able to recognize these patterns.  Or alternatively in the function
rs6000_expand_builtin we would have to have code that switches each of the
KFmode built-in functions to TFmode.

For example, if the user writes:

__float128 a, b, c, d;

// ...

a = __builtin_fmaf128_round_to_odd (b, c, -d);

If the mode that d uses is TFmode instead of KFmode, GCC would either abort or
possibly add a convert insn in the subject.  By adding the convert insn, the
multiply-subtract operation would not combine the negate and multiply-add
operation.

Currently when -mabi=ieeelongdouble is used, __float128 uses TFmode instead of
KFmode to be compatible with long double.

2022-08-10   Michael Meissner  <meissner@linux.ibm.com>

gcc/

* config/rs6000/predicates.md (ieee128_operand): New predicate.
(ibm128_operand): Likewise.
* config/rs6000/rs6000.md (unpack<mode>): Use ibm128_operand instead of
register_operand.
(unpack<mode>_dm): Likewise.
(unpack<mode>_nodm): Likewise.
(pack<mode>_hard): Likewise.
(unpack<mode>): Likewise.
(trunc<mode>sf2_hw): Use ieee128_operand instead of
altivec_register_operand.
(add<mode>3_odd): Likewise.
(sub<mode>3_odd): Likewise.
(mul<mode>3_odd): Likewise.
(div<mode>3_odd): Likewise.
(sqrt<mode>2_odd): Likewise.
(fma<mode>4_odd): Likewise.
(fms<mode>4_odd): Likewise.
(nfma<mode>4_odd): Likewise.
(nfms<mode>4_odd): Likewise.
(trunc<mode>df2_odd): Likewise.
* config/rs6000/vsx.md (xsxexpqp_<mode>): Use ieee128_operand instead of
altivec_register_operand.
(xsxsigqp_<mode>): Likewise.
(xsiexpqpf_<mode>): Likewise.
(xsiexpqp_<mode>): Likewise.
(xscmpexpqp_<code>_<mode>): Likewise.
(xscmpexpqp_<code>_<mode>): Likewise.
(xststdcqp_<mode>): Likewise.
(xststdcnegqp_<mode>): Likewise.
(xststdcqp_<mode): Likewise.
gcc/config/rs6000/predicates.md
gcc/config/rs6000/rs6000.md
gcc/config/rs6000/vsx.md
This page took 0.068138 seconds and 6 git commands to generate.