]> gcc.gnu.org Git - gcc.git/commit
Add saturating subtract built-ins.
authorMichael Meissner <meissner@linux.ibm.com>
Fri, 22 Mar 2024 04:51:29 +0000 (00:51 -0400)
committerMichael Meissner <meissner@linux.ibm.com>
Fri, 22 Mar 2024 04:51:29 +0000 (00:51 -0400)
commit0376ff1f351466628aa8fd9f304c6e8c6e3cdb82
treec1b1280c74333dd63172b29c9f927775b1388eb9
parent57f8bb746fcadd38e99dd9eee715f9ff15ad2822
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.

The patches have been tested on both little and big endian systems.  Can I check
it into the master branch?

2024-03-22   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.
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]
This page took 0.067095 seconds and 5 git commands to generate.