| 1 |
/* { dg-do run { target { riscv_v } } } */ |
| 2 |
|
| 3 |
|
| 4 |
#include "scatter_store_64-6.c" |
| 5 |
#include <assert.h> |
| 6 |
|
| 7 |
int |
| 8 |
main (void) |
| 9 |
{ |
| 10 |
#define RUN_LOOP(DATA_TYPE, BITS) \ |
| 11 |
DATA_TYPE dest_##DATA_TYPE[128]; \ |
| 12 |
DATA_TYPE dest2_##DATA_TYPE[128]; \ |
| 13 |
DATA_TYPE src_##DATA_TYPE[128]; \ |
| 14 |
INDEX##BITS indices_##DATA_TYPE##_##BITS[128]; \ |
| 15 |
for (int i = 0; i < 128; i++) \ |
| 16 |
{ \ |
| 17 |
dest_##DATA_TYPE[i] = (DATA_TYPE) ((i * 81 + 735) & (BITS - 1)); \ |
| 18 |
dest2_##DATA_TYPE[i] = (DATA_TYPE) ((i * 81 + 735) & (BITS - 1)); \ |
| 19 |
src_##DATA_TYPE[i] = (DATA_TYPE) ((i * 13 + 9107) & (BITS - 1)); \ |
| 20 |
indices_##DATA_TYPE##_##BITS[i] = (DATA_TYPE) ((i * 3 + 67) % 128); \ |
| 21 |
} \ |
| 22 |
f_##DATA_TYPE (dest_##DATA_TYPE, src_##DATA_TYPE, \ |
| 23 |
indices_##DATA_TYPE##_##BITS); \ |
| 24 |
for (int i = 0; i < 128; i++) \ |
| 25 |
assert (dest_##DATA_TYPE[indices_##DATA_TYPE##_##BITS[i]] \ |
| 26 |
== (src_##DATA_TYPE[i] + 1)); |
| 27 |
|
| 28 |
RUN_LOOP (int8_t, 16) |
| 29 |
RUN_LOOP (uint8_t, 16) |
| 30 |
RUN_LOOP (int16_t, 16) |
| 31 |
RUN_LOOP (uint16_t, 16) |
| 32 |
RUN_LOOP (_Float16, 16) |
| 33 |
RUN_LOOP (int32_t, 16) |
| 34 |
RUN_LOOP (uint32_t, 16) |
| 35 |
RUN_LOOP (float, 16) |
| 36 |
RUN_LOOP (int64_t, 16) |
| 37 |
RUN_LOOP (uint64_t, 16) |
| 38 |
RUN_LOOP (double, 16) |
| 39 |
return 0; |
| 40 |
} |