| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -mcpu=neoverse-n1+sve -fdump-tree-vect" } */ |
| 3 |
/* { dg-final { check-function-bodies "**" "" } } */ |
| 4 |
|
| 5 |
#include <stdint.h> |
| 6 |
#include <string.h> |
| 7 |
|
| 8 |
#define N 8 |
| 9 |
#define L 8 |
| 10 |
|
| 11 |
/* |
| 12 |
**f: |
| 13 |
** ... |
| 14 |
** ld1w z[0-9]+.s, p([0-9]+)/z, \[x[0-9]+, z[0-9]+.s, sxtw\] |
| 15 |
** ld1w z[0-9]+.s, p([0-9]+)/z, \[x[0-9]+, z[0-9]+.s, sxtw\] |
| 16 |
** st1w z[0-9]+.s, p\1, \[x[0-9]+, z[0-9]+.s, sxtw\] |
| 17 |
** incb x([0-9]+), all, mul #2 |
| 18 |
** st1w z[0-9]+.s, p\2, \[x\3, z[0-9]+.s, sxtw\] |
| 19 |
** ret |
| 20 |
** ... |
| 21 |
*/ |
| 22 |
void f(const uint8_t * restrict seq1, |
| 23 |
const uint8_t *idx, uint8_t *seq_out) { |
| 24 |
for (int i = 0; i < L; ++i) { |
| 25 |
uint8_t h = idx[i]; |
| 26 |
memcpy((void *)&seq_out[i * N], (const void *)&seq1[h * N / 2], N / 2); |
| 27 |
} |
| 28 |
} |
| 29 |
|