]> gcc.gnu.org Git - gcc.git/commit
Fix PR target/109140
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 28 Mar 2023 08:13:24 +0000 (10:13 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Tue, 28 Mar 2023 08:41:33 +0000 (10:41 +0200)
commita21bd7faba67997a6da457dbda16f15bca1a9156
tree9ac8b825fe424984218248aad8fabf7372d36535
parent5cea00da1d3c5b37c77230ff863d7c1916a512f2
Fix PR target/109140

This is a regression present on the mainline and 12 branch at -O2, but the
issue is related to vectorization so was present at -O3 in earlier versions.

The vcondu expander that was added for VIS 3 more than a decade ago does not
fully work, because it does not filter out the unsigned condition codes (the
instruction is an UNSPEC that accepts only signed condition codes).

While I was at it, I also added the missing vcond and vcondu expanders for
the new comparison instructions that were added in VIS 4.

gcc/
PR target/109140
* config/sparc/sparc.cc (sparc_expand_vcond): Call signed_condition
on operand #3 to get the final condition code.  Use std::swap.
* config/sparc/sparc.md (vcondv8qiv8qi): New VIS 4 expander.
(fucmp<gcond:code>8<P:mode>_vis): Move around.
(fpcmpu<gcond:code><GCM:gcm_name><P:mode>_vis): Likewise.
(vcondu<GCM:mode><GCM:mode>): New VIS 4 expander.

gcc/testsuite/
* gcc.target/sparc/20230328-1.c: New test.
* gcc.target/sparc/20230328-2.c: Likewise.
* gcc.target/sparc/20230328-3.c: Likewise.
* gcc.target/sparc/20230328-4.c: Likewise.
gcc/config/sparc/sparc.cc
gcc/config/sparc/sparc.md
gcc/testsuite/gcc.target/sparc/20230328-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/sparc/20230328-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/sparc/20230328-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/sparc/20230328-4.c [new file with mode: 0644]
This page took 0.060962 seconds and 6 git commands to generate.