[Bug target/99293] Built-in vec_splat generates sub-optimal code for -mcpu=power10
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Aug 28 03:48:42 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99293
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Michael Meissner
<meissner@gcc.gnu.org>:
https://gcc.gnu.org/g:9aabf931dde5120767b8ee60652489b6db95f41e
commit r15-11526-g9aabf931dde5120767b8ee60652489b6db95f41e
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Thu Aug 27 23:47:09 2026 -0400
Backport PR target/99293
We had optimizations for splat of a vector extract for the other vector
types, but we missed having one for V2DI and V2DF. This patch adds a
combiner insn to do this optimization.
In looking at the source, we had similar optimizations for V4SI and V4SF
extract and splats, but we missed doing V2DI/V2DF.
Without the patch for the code:
vector long long splat_dup_l_0 (vector long long v)
{
return __builtin_vec_splats (__builtin_vec_extract (v, 0));
}
the compiler generates (on a little endian power9):
splat_dup_l_0:
mfvsrld 9,34
mtvsrdd 34,9,9
blr
Now it generates:
splat_dup_l_0:
xxpermdi 34,34,34,3
blr
This change was backported from the changes checked into the master
branch on 2026-08-03.
2026-08-27 Michael Meissner <meissner@linux.ibm.com>
gcc/
PR target/99293
* config/rs6000/vsx.md (vsx_splat_extract_<mode>): New insn.
gcc/testsuite/
PR target/99293
* gcc.target/powerpc/pr99293.c: New test.
* gcc.target/powerpc/builtins-1.c: Update instruction count.
More information about the Gcc-bugs
mailing list