rs6000: Fix LE code gen for vec_cnt[lt]z_lsbb [PR95082]
authorBill Schmidt <wschmidt@linux.ibm.com>
Thu, 3 Feb 2022 03:24:22 +0000 (21:24 -0600)
committerBill Schmidt <wschmidt@linux.ibm.com>
Thu, 3 Feb 2022 17:17:18 +0000 (11:17 -0600)
commit3f30f2d1dbb3228b8468b26239fe60c2974ce2ac
tree1e0093d4b7d93b42d43e077a90d4d2fffc9a8e39
parenteecee223f435fa01fb07a2fdba1615b89627d710
rs6000: Fix LE code gen for vec_cnt[lt]z_lsbb [PR95082]

These built-ins were misimplemented as always having big-endian semantics.

2022-01-18  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
PR target/95082
* config/rs6000/rs6000-builtin.cc (rs6000_expand_builtin): Handle
endianness for vclzlsbb and vctzlsbb.
* config/rs6000/rs6000-builtins.def (VCLZLSBB_V16QI): Change
default pattern and indicate a different pattern will be used for
big endian.
(VCLZLSBB_V4SI): Likewise.
(VCLZLSBB_V8HI): Likewise.
(VCTZLSBB_V16QI): Likewise.
(VCTZLSBB_V4SI): Likewise.
(VCTZLSBB_V8HI): Likewise.

gcc/testsuite/
PR target/95082
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-0.c: Restrict to -mbig.
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-3.c: New.
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-4.c: New.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-0.c: Restrict to -mbig.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-1.c: Likewise.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-3.c: New.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-4.c: New.
gcc/config/rs6000/rs6000-builtin.cc
gcc/config/rs6000/rs6000-builtins.def
gcc/testsuite/gcc.target/powerpc/vsu/vec-cntlz-lsbb-0.c
gcc/testsuite/gcc.target/powerpc/vsu/vec-cntlz-lsbb-1.c
gcc/testsuite/gcc.target/powerpc/vsu/vec-cntlz-lsbb-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsu/vec-cntlz-lsbb-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsu/vec-cnttz-lsbb-0.c
gcc/testsuite/gcc.target/powerpc/vsu/vec-cnttz-lsbb-1.c
gcc/testsuite/gcc.target/powerpc/vsu/vec-cnttz-lsbb-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsu/vec-cnttz-lsbb-4.c [new file with mode: 0644]