/* { dg-do compile } */ /* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -ftree-vectorize -mrvv-max-lmul=dynamic -fdump-tree-vect-details" } */ #include void f3 (uint8_t *restrict a, uint8_t *restrict b, uint8_t *restrict c, uint8_t *restrict d, int n) { for (int i = 0; i < n; ++i) { a[i * 8] = c[i * 8] + d[i * 8]; a[i * 8 + 1] = c[i * 8] + d[i * 8 + 1]; a[i * 8 + 2] = c[i * 8 + 2] + d[i * 8 + 2]; a[i * 8 + 3] = c[i * 8 + 2] + d[i * 8 + 3]; a[i * 8 + 4] = c[i * 8 + 4] + d[i * 8 + 4]; a[i * 8 + 5] = c[i * 8 + 4] + d[i * 8 + 5]; a[i * 8 + 6] = c[i * 8 + 6] + d[i * 8 + 6]; a[i * 8 + 7] = c[i * 8 + 6] + d[i * 8 + 7]; b[i * 8] = c[i * 8 + 1] + d[i * 8]; b[i * 8 + 1] = c[i * 8 + 1] + d[i * 8 + 1]; b[i * 8 + 2] = c[i * 8 + 3] + d[i * 8 + 2]; b[i * 8 + 3] = c[i * 8 + 3] + d[i * 8 + 3]; b[i * 8 + 4] = c[i * 8 + 5] + d[i * 8 + 4]; b[i * 8 + 5] = c[i * 8 + 5] + d[i * 8 + 5]; b[i * 8 + 6] = c[i * 8 + 7] + d[i * 8 + 6]; b[i * 8 + 7] = c[i * 8 + 7] + d[i * 8 + 7]; } } /* { dg-final { scan-assembler {e8,m4} } } */ /* { dg-final { scan-assembler-not {jr} } } */ /* { dg-final { scan-assembler-times {ret} 1 } } */ /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it has unexpected spills" "vect" } } */