https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119187
Tamar Christina <tnfchris at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Target Milestone|--- |17.0
Assignee|unassigned at gcc dot gnu.org |tnfchris at gcc dot
gnu.org
--- Comment #11 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Ok, I've gotten quite far with this now.
--- input
#include <arm_neon.h>
void foo (uint8_t *a, uint8_t *b, uint8_t *c, int n)
{
for (int i = 0; i < n; i+=8, a+=8, b+=8, c+=8)
{
uint8x8_t av1 = vld1_u8 (a);
uint8x8_t bv1 = vld1_u8 (b);
vst1_u8 (c, vadd_u8 (av1, bv1));
}
}
--- -O1 -march=armv8-a
.L3:
ldr d31, [x0, x4]
ldr d30, [x1, x4]
add v31.8b, v31.8b, v30.8b
str d31, [x2, x4]
add x4, x4, 8
cmp w3, w4
bgt .L3
--- -O3 -march=armv8-a
.L5:
ldr q31, [x0, x4]
ldr q30, [x1, x4]
add v30.16b, v31.16b, v30.16b
str q30, [x2, x4]
add x4, x4, 16
cmp x4, x7
bne .L5
--- -O3 -march=armv8-a+sve
.L5:
ldr q31, [x0, x3]
ldr q30, [x1, x3]
add v30.16b, v31.16b, v30.16b
str q30, [x2, x3]
add x3, x3, 16
cmp x5, x3
bne .L5
lsl w3, w4, 4
cmp w6, w3
beq .L1
.L4:
sub w6, w6, w3
ubfiz x3, x3, 3, 32
whilelo p7.b, xzr, x6
ld1b z29.b, p7/z, [x0, x3]
ld1b z28.b, p7/z, [x1, x3]
add z28.b, z28.b, z29.b
st1b z28.b, p7, [x2, x3]
.L1:
--- -O3 -march=armv8-a+sve -mautovec-preference=sve-only
.L4:
ld1b z31.b, p7/z, [x0, x4]
ld1b z30.b, p7/z, [x1, x4]
add z30.b, z30.b, z31.b
st1b z30.b, p7, [x2, x4]
add x4, x4, x5
whilelo p7.b, x4, x3
b.any .L4
But I'm not quite happy with how I handle group_size. Need to have a think
about it.