https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119702
Bug ID: 119702
Summary: PPCLE: Inefficient auto-vectorization for 64-bit
shifts on Power9
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: jens.seifert at de dot ibm.com
Target Milestone: ---
void lshift1(unsigned long long *a)
{
a[0] <<= 1;
a[1] <<= 1;
}
Output:
lshift1(unsigned long long*):
lxv 33,0(3)
xxspltib 32,1
vextsb2d 0,0
vsld 0,1,0
stxv 32,0(3)
blr
1) Left shift by 1 should be done by 64-bit add which requires no constant
2) vextsb2d is not required as PowerPC has a modulo shift. It does not matter
if additional bytes are set with shift amount.