https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109498
Bug ID: 109498
Summary: SVE support for ctz
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: rsandifo at gcc dot gnu.org
Target Milestone: ---
Target: aarch64*-*-*
We fail to vectorise the following function with SVE:
// -march=armv8.2-a+sve -O2
void
ctz (int *__restrict x, int *__restrict y, int n)
{
for (int i = 0; i < n; i++)
x[i] = __builtin_ctz (y[i]);
}
It should use a combination of RBIT + CLZ.