| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-march=rv32gcv -mabi=ilp32d -mrvv-vector-bits=scalable -fdump-tree-optimized-details -fno-vect-cost-model" } */ |
| 3 |
|
| 4 |
#include <stdint-gcc.h> |
| 5 |
|
| 6 |
void |
| 7 |
f (float *restrict a, float *restrict b, |
| 8 |
float *restrict c, float *restrict d, |
| 9 |
int n) |
| 10 |
{ |
| 11 |
for (int i = 0; i < n; ++i) |
| 12 |
{ |
| 13 |
a[i * 4] = c[i * 4] + d[i * 4]; |
| 14 |
a[i * 4 + 1] = c[i * 4] + d[i * 4 + 1]; |
| 15 |
a[i * 4 + 2] = c[i * 4 + 2] + d[i * 4 + 2]; |
| 16 |
a[i * 4 + 3] = c[i * 4 + 3] + d[i * 4 + 3]; |
| 17 |
b[i * 4] = c[i * 4 + 2] + d[i * 4]; |
| 18 |
b[i * 4 + 1] = c[i * 4 + 1] + d[i * 4 + 1]; |
| 19 |
b[i * 4 + 2] = c[i * 4 + 3] + d[i * 4 + 2]; |
| 20 |
b[i * 4 + 3] = c[i * 4 + 3] + d[i * 4 + 3]; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
/* FIXME: Since we don't have VECT cost model yet, LOAD_LANES/STORE_LANES are chosen |
| 25 |
instead of SLP when rvv-autotec-max-lmul=m1 or m2. */ |
| 26 |
/* { dg-final { scan-tree-dump "\.VEC_PERM" "optimized" { xfail { any-opts "-mrvv-max-lmul=m1" "-mrvv-max-lmul=m2" } } } } */ |
| 27 |
/* { dg-final { scan-assembler {\tvid\.v} { xfail { any-opts "-mrvv-max-lmul=m1" "-mrvv-max-lmul=m2" } } } } */ |
| 28 |
/* { dg-final { scan-assembler-not {\tvmul} } } */ |