rs6000: Optimize code generation of vec_reve [PR100868]
authorHaochen Gui <guihaoc@gcc.gnu.org>
Wed, 17 Nov 2021 08:16:02 +0000 (16:16 +0800)
committerHaochen Gui <guihaoc@gcc.gnu.org>
Tue, 23 Nov 2021 08:31:59 +0000 (16:31 +0800)
commitf4eae6450e46224454ce067ac43bd7e9f66fc18b
tree5c4790b7651c13829bc2a245740e95589162cfad
parent1ddf11d3647f68e0c31016935f19d843d54030b4
rs6000: Optimize code generation of vec_reve [PR100868]

gcc/
PR target/100868
* config/rs6000/altivec.md (altivec_vreve<mode>2 for VEC_K): Use
xxbrq for v16qi, xxbrq + xxbrh for v8hi and xxbrq + xxbrw for v4si
or v4sf when p9_vector is set.
(altivec_vreve<mode>2 for VEC_64): Defined. Implemented by xxswapd.

gcc/testsuite/
PR target/100868
* gcc.target/powerpc/vec_reve_1.c: New test.
* gcc.target/powerpc/vec_reve_2.c: Likewise.
gcc/config/rs6000/altivec.md
gcc/testsuite/gcc.target/powerpc/vec_reve_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec_reve_2.c [new file with mode: 0644]