1 /* { dg-do compile } */
2 /* { dg-options "-march=rv32gcv -mabi=ilp32 -O3 -ftree-vectorize --param riscv-autovec-lmul=dynamic -fdump-tree-vect-details" } */
4 #include <stdint-gcc.h>
7 foo (int32_t *__restrict a
, int32_t *__restrict b
, int32_t *__restrict c
,
8 int32_t *__restrict a2
, int32_t *__restrict b2
, int32_t *__restrict c2
,
9 int32_t *__restrict a3
, int32_t *__restrict b3
, int32_t *__restrict c3
,
10 int32_t *__restrict a4
, int32_t *__restrict b4
, int32_t *__restrict c4
,
11 int32_t *__restrict a5
, int32_t *__restrict b5
, int32_t *__restrict c5
,
12 int32_t *__restrict d
, int32_t *__restrict d2
, int32_t *__restrict d3
,
13 int32_t *__restrict d4
, int32_t *__restrict d5
, int n
, int m
)
15 for (int i
= 0; i
< n
; i
++)
18 a2
[i
] = b2
[i
] + c2
[i
];
19 a3
[i
] = b3
[i
] + c3
[i
];
20 a4
[i
] = b4
[i
] + c4
[i
];
24 d3
[i
] = a3
[i
] * a2
[i
];
25 d4
[i
] = a2
[i
] * d2
[i
];
26 d5
[i
] = a
[i
] * a2
[i
] * a3
[i
] * a4
[i
] * d
[i
];
30 /* { dg-final { scan-assembler {e32,m4} } } */
31 /* { dg-final { scan-assembler-not {csrr} } } */
32 /* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 1 "vect" } } */