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