]> git.ipfire.org Git - thirdparty/gcc.git/commit
Disable generation of scalar modulo instructions.
authorPat Haugen <pthaugen@linux.ibm.com>
Tue, 19 Sep 2023 18:19:59 +0000 (13:19 -0500)
committerPat Haugen <pthaugen@linux.ibm.com>
Tue, 19 Sep 2023 18:27:46 +0000 (13:27 -0500)
commit58ab38213b979811d314f68e3f455c28a1d44140
treec7565087e4cca3f91396680488de882c5d726618
parent81d5ca0b9b8431f1bd7a5ec8a2c94f04bb0cf032
Disable generation of scalar modulo instructions.

It was recently discovered that the scalar modulo instructions can suffer
noticeable performance issues for certain input values. This patch disables
their generation since the equivalent div/mul/sub sequence does not suffer
the same problem.

gcc/
* config/rs6000/rs6000.cc (rs6000_rtx_costs): Check whether the
modulo instruction is disabled.
* config/rs6000/rs6000.h (RS6000_DISABLE_SCALAR_MODULO): New.
* config/rs6000/rs6000.md (mod<mode>3, *mod<mode>3): Check it.
(define_expand umod<mode>3): New.
(define_insn umod<mode>3): Rename to *umod<mode>3 and check if the modulo
instruction is disabled.
(umodti3, modti3): Check if the modulo instruction is disabled.

gcc/testsuite/
* gcc.target/powerpc/clone1.c: Add xfails.
* gcc.target/powerpc/clone3.c: Likewise.
* gcc.target/powerpc/mod-1.c: Update scan strings and add xfails.
* gcc.target/powerpc/mod-2.c: Likewise.
* gcc.target/powerpc/p10-vdivq-vmodq.c: Add xfails.
gcc/config/rs6000/rs6000.cc
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/rs6000.md
gcc/testsuite/gcc.target/powerpc/clone1.c
gcc/testsuite/gcc.target/powerpc/clone3.c
gcc/testsuite/gcc.target/powerpc/mod-1.c
gcc/testsuite/gcc.target/powerpc/mod-2.c
gcc/testsuite/gcc.target/powerpc/p10-vdivq-vmodq.c