| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-march=rv64gcv_zvfh -mabi=lp64d -fdump-tree-vect-details" } */ |
| 3 |
|
| 4 |
#include <stdint-gcc.h> |
| 5 |
|
| 6 |
#define INDEX8 uint8_t |
| 7 |
|
| 8 |
#define TEST_LOOP(DATA_TYPE, BITS) \ |
| 9 |
void __attribute__ ((noinline, noclone)) \ |
| 10 |
f_##DATA_TYPE (DATA_TYPE *restrict dest, DATA_TYPE *restrict src, \ |
| 11 |
INDEX##BITS *restrict indices, INDEX##BITS *restrict cond) \ |
| 12 |
{ \ |
| 13 |
for (int i = 0; i < 128; ++i) \ |
| 14 |
if (cond[i]) \ |
| 15 |
dest[indices[i]] = src[i] + 1; \ |
| 16 |
} |
| 17 |
|
| 18 |
#define TEST_ALL(T) \ |
| 19 |
T (int8_t, 8) \ |
| 20 |
T (uint8_t, 8) \ |
| 21 |
T (int16_t, 8) \ |
| 22 |
T (uint16_t, 8) \ |
| 23 |
T (_Float16, 8) \ |
| 24 |
T (int32_t, 8) \ |
| 25 |
T (uint32_t, 8) \ |
| 26 |
T (float, 8) \ |
| 27 |
T (int64_t, 8) \ |
| 28 |
T (uint64_t, 8) \ |
| 29 |
T (double, 8) |
| 30 |
|
| 31 |
TEST_ALL (TEST_LOOP) |
| 32 |
|
| 33 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 11 "vect" } } */ |
| 34 |
/* { dg-final { scan-tree-dump " \.MASK_LEN_SCATTER_STORE" "vect" } } */ |
| 35 |
/* { dg-final { scan-tree-dump-not " \.SCATTER_STORE" "vect" } } */ |
| 36 |
/* { dg-final { scan-tree-dump-not " \.MASK_SCATTER_STORE" "vect" } } */ |