1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -ftree-vectorize --param riscv-autovec-lmul=dynamic -fdump-tree-vect-details" } */
4 #include <stdint-gcc.h>
6 f3 (uint8_t *restrict a
, uint8_t *restrict b
,
7 uint8_t *restrict c
, uint8_t *restrict d
,
10 for (int i
= 0; i
< n
; ++i
)
12 a
[i
* 8] = c
[i
* 8] + d
[i
* 8];
13 a
[i
* 8 + 1] = c
[i
* 8] + d
[i
* 8 + 1];
14 a
[i
* 8 + 2] = c
[i
* 8 + 2] + d
[i
* 8 + 2];
15 a
[i
* 8 + 3] = c
[i
* 8 + 2] + d
[i
* 8 + 3];
16 a
[i
* 8 + 4] = c
[i
* 8 + 4] + d
[i
* 8 + 4];
17 a
[i
* 8 + 5] = c
[i
* 8 + 4] + d
[i
* 8 + 5];
18 a
[i
* 8 + 6] = c
[i
* 8 + 6] + d
[i
* 8 + 6];
19 a
[i
* 8 + 7] = c
[i
* 8 + 6] + d
[i
* 8 + 7];
20 b
[i
* 8] = c
[i
* 8 + 1] + d
[i
* 8];
21 b
[i
* 8 + 1] = c
[i
* 8 + 1] + d
[i
* 8 + 1];
22 b
[i
* 8 + 2] = c
[i
* 8 + 3] + d
[i
* 8 + 2];
23 b
[i
* 8 + 3] = c
[i
* 8 + 3] + d
[i
* 8 + 3];
24 b
[i
* 8 + 4] = c
[i
* 8 + 5] + d
[i
* 8 + 4];
25 b
[i
* 8 + 5] = c
[i
* 8 + 5] + d
[i
* 8 + 5];
26 b
[i
* 8 + 6] = c
[i
* 8 + 7] + d
[i
* 8 + 6];
27 b
[i
* 8 + 7] = c
[i
* 8 + 7] + d
[i
* 8 + 7];
31 /* { dg-final { scan-assembler {e8,m4} } } */
32 /* { dg-final { scan-assembler-not {jr} } } */
33 /* { dg-final { scan-assembler-times {ret} 1 } } */
34 /* { dg-final { scan-tree-dump-not "Preferring smaller LMUL loop because it has unexpected spills" "vect" } } */