]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000, fix vec_replace_unaligned built-in arguments
authorCarl Love <cel@us.ibm.com>
Wed, 26 Jul 2023 15:31:53 +0000 (11:31 -0400)
committerCarl Love <cel@us.ibm.com>
Wed, 26 Jul 2023 15:36:25 +0000 (11:36 -0400)
commitb51795c832cf6e724d61919eb18a383223b76694
tree0e039bb6b084c3474bbfd82bf9cd7c49d94c3629
parent9d804f9b2709b38235a2fe4c6705f2af6784aa2a
rs6000, fix vec_replace_unaligned built-in arguments

The first argument of the vec_replace_unaligned built-in should always be
of type vector unsigned char, as specified in gcc/doc/extend.texi.

This patch fixes the builtin definitions and updates the test cases to use
the correct arguments.  The original test file is renamed and a second test
file is added for a new test case.

gcc/ChangeLog:
* config/rs6000/rs6000-builtins.def: Rename
__builtin_altivec_vreplace_un_uv2di as __builtin_altivec_vreplace_un_udi
__builtin_altivec_vreplace_un_uv4si as __builtin_altivec_vreplace_un_usi
__builtin_altivec_vreplace_un_v2df as __builtin_altivec_vreplace_un_df
__builtin_altivec_vreplace_un_v2di as __builtin_altivec_vreplace_un_di
__builtin_altivec_vreplace_un_v4sf as __builtin_altivec_vreplace_un_sf
__builtin_altivec_vreplace_un_v4si as __builtin_altivec_vreplace_un_si.
Rename VREPLACE_UN_UV2DI as VREPLACE_UN_UDI, VREPLACE_UN_UV4SI as
VREPLACE_UN_USI, VREPLACE_UN_V2DF as VREPLACE_UN_DF,
VREPLACE_UN_V2DI as VREPLACE_UN_DI, VREPLACE_UN_V4SF as
VREPLACE_UN_SF, VREPLACE_UN_V4SI as VREPLACE_UN_SI.
Rename vreplace_un_v2di as vreplace_un_di, vreplace_un_v4si as
vreplace_un_si, vreplace_un_v2df as vreplace_un_df,
vreplace_un_v2di as vreplace_un_di, vreplace_un_v4sf as
vreplace_un_sf, vreplace_un_v4si as vreplace_un_si.
* config/rs6000/rs6000-c.cc (find_instance): Add case
RS6000_OVLD_VEC_REPLACE_UN.
* config/rs6000/rs6000-overload.def (__builtin_vec_replace_un):
Fix first argument type.  Rename VREPLACE_UN_UV4SI as
VREPLACE_UN_USI, VREPLACE_UN_V4SI as VREPLACE_UN_SI,
VREPLACE_UN_UV2DI as VREPLACE_UN_UDI, VREPLACE_UN_V2DI as
VREPLACE_UN_DI, VREPLACE_UN_V4SF as VREPLACE_UN_SF,
VREPLACE_UN_V2DF as VREPLACE_UN_DF.
* config/rs6000/vsx.md (REPLACE_ELT): Rename the mode_iterator
REPLACE_ELT_V for vector modes.
(REPLACE_ELT): New scalar mode iterator.
(REPLACE_ELT_char): Add scalar attributes.
(vreplace_un_<mode>): Change iterator and mode attribute.

gcc/testsuite/ChangeLog:
* gcc.target/powerpc/vec-replace-word-runnable.c: Renam
vec-replace-word-runnable_1.c.
* gcc.target/powerpc/vec-replace-word-runnable_1.c
(dg-options): add -flax-vector-conversions.
(vec_replace_unaligned) Fix first argument type.
(vresult_uchar): Fix expected results.
(vec_replace_unaligned): Update for loop to check uchar results.
Remove extra spaces in if statements. Insert missing spaces in
for statements.
* gcc.target/powerpc/vec-replace-word-runnable_2.c: New test file.
gcc/config/rs6000/rs6000-builtins.def
gcc/config/rs6000/rs6000-c.cc
gcc/config/rs6000/rs6000-overload.def
gcc/config/rs6000/vsx.md
gcc/testsuite/gcc.target/powerpc/vec-replace-word-runnable_1.c [moved from gcc/testsuite/gcc.target/powerpc/vec-replace-word-runnable.c with 51% similarity]
gcc/testsuite/gcc.target/powerpc/vec-replace-word-runnable_2.c [new file with mode: 0644]