]> gcc.gnu.org Git - gcc.git/commit
rs6000: Fix vector_set_var_p9 by considering BE [PR108807]
authorKewen Lin <linkw@linux.ibm.com>
Tue, 4 Apr 2023 02:47:54 +0000 (21:47 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Mon, 17 Apr 2023 02:52:06 +0000 (21:52 -0500)
commitd39451523912981e897faa7942a2634c058524fb
tree8943fc4278f14449fd24e0a5643807bd1b43e45f
parent6aef0a6d7494075749ede3d3d898c139beffcfcd
rs6000: Fix vector_set_var_p9 by considering BE [PR108807]

As PR108807 exposes, the current handling in function
rs6000_expand_vector_set_var_p9 doesn't take care of big
endianness.  Currently the function is to rotate the
target vector by moving element to-be-set to element 0,
set element 0 with the given val, then rotate back.  To
get the permutation control vector for the rotation, it
makes use of lvsr and lvsl, but the element ordering is
different for BE and LE (like element 0 is the most
significant one on BE while the least significant one on
LE), this patch is to add consideration for BE and make
sure permutation control vectors for rotations are expected.

As tested, it helped to fix the below failures:

FAIL: gcc.target/powerpc/pr79251-run.p9.c execution test
FAIL: gcc.target/powerpc/pr89765-mc.c execution test
FAIL: gcc.target/powerpc/vsx-builtin-10d.c execution test
FAIL: gcc.target/powerpc/vsx-builtin-11d.c execution test
FAIL: gcc.target/powerpc/vsx-builtin-14d.c execution test
FAIL: gcc.target/powerpc/vsx-builtin-16d.c execution test
FAIL: gcc.target/powerpc/vsx-builtin-18d.c execution test
FAIL: gcc.target/powerpc/vsx-builtin-9d.c execution test
PR target/108807

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_expand_vector_set_var_p9): Fix gen
function for permutation control vector by considering big endianness.

(cherry picked from commit d634e6088f139ee700d79ec73b1ad6436096a6ff)
gcc/config/rs6000/rs6000.cc
This page took 0.076267 seconds and 6 git commands to generate.