[Bug target/104124] Poor optimization for vector splat DW with small consts
meissner at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 27 21:16:08 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104124
--- Comment #3 from Michael Meissner <meissner at gcc dot gnu.org> ---
There are two things going on.
1) There is no vspltisd instruction, so we can't generate a single instruction
to load constants other than 0 or -1. Unfortunately, this was not added in
either power9 or power10.
2) On the power9 and power10 we have the xxspltib and vecsb2d instructions, and
we generate those if -mcpu=power9.
To add support for new types of constants, the procedure is:
1) You need to modify easy_altivec_constant and gen_altivec_constant in
rs6000.c (or rs6000.cc in GCC 12). Then add new predicates in predicate.md for
these new patterns.
2) Look for the predicates "easy_vector_constant_add_self" and so forth in
predicates.md and add a new predicate here.
3) Then in altivec.md, look for the define_splits that use the various
easy_vector_const_* functions and add a new pattern.
More information about the Gcc-bugs
mailing list