]> gcc.gnu.org Git - gcc.git/commit
Add saturating subtract built-ins.
authorMichael Meissner <meissner@linux.ibm.com>
Sat, 28 Jan 2023 03:12:16 +0000 (22:12 -0500)
committerMichael Meissner <meissner@linux.ibm.com>
Sat, 28 Jan 2023 03:12:16 +0000 (22:12 -0500)
commit5eabc54c122ce69f748422dab44ba23303bdf469
tree0be4a3939c88a1cc6c86e5f7f08b67b10a1edd27
parent40b9c24f489deada5aefc4e2327babf330bb67de
Add saturating subtract built-ins.

This patch adds support for a saturating subtract built-in function that may be
added to a future PowerPC processor.  Note, if it is added, the name of the
built-in function may change before GCC 13 is released.  If the name changes,
we will submit a patch changing the name.

I also added support for providing dense math built-in functions, even though
at present, we have not added any new built-in functions for dense math.  It is
likely we will want to add new dense math built-in functions as the dense math
support is fleshed out.

I tested this patch on a little endian power10 system with long double using
the tradiational IBM double double format.  Assuming the other 6 patches for
-mcpu=future are checked in (or at least the first patch), can I check this
patch into the master branch for GCC 13.

2023-01-27   Michael Meissner  <meissner@linux.ibm.com>

gcc/

* config/rs6000/rs6000-builtin.cc (rs6000_invalid_builtin): Add support
for flagging invalid use of future built-in functions.
(rs6000_builtin_is_supported): Add support for future built-in
functions.
* config/rs6000/rs6000-builtins.def (__builtin_saturate_subtract32): New
built-in function for -mcpu=future.
(__builtin_saturate_subtract64): Likewise.
* config/rs6000/rs6000-gen-builtins.cc (enum bif_stanza): Add stanzas
for -mcpu=future built-ins.
(stanza_map): Likewise.
(enable_string): Likewise.
(struct attrinfo): Likewise.
(parse_bif_attrs): Likewise.
(write_decls): Likewise.
* config/rs6000/rs6000.md (sat_sub<mode>3): Add saturating subtract
built-in insn declarations.
(sat_sub<mode>3_dot): Likewise.
(sat_sub<mode>3_dot2): Likewise.
* doc/extend.texi (Future PowerPC built-ins): New section.

gcc/testsuite/

* gcc.target/powerpc/subfus-1.c: New test.
* gcc.target/powerpc/subfus-2.c: Likewise.
* lib/target-supports.exp (check_effective_target_powerpc_future_ok):
New effective target.
gcc/config/rs6000/rs6000-builtin.cc
gcc/config/rs6000/rs6000-builtins.def
gcc/config/rs6000/rs6000-gen-builtins.cc
gcc/config/rs6000/rs6000.md
gcc/doc/extend.texi
gcc/testsuite/gcc.target/powerpc/subfus-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/subfus-2.c [new file with mode: 0644]
gcc/testsuite/lib/target-supports.exp
This page took 0.06544 seconds and 6 git commands to generate.