gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/clz-template.h
raw| 1 | #include <stdint-gcc.h> |
| 2 | |
| 3 | #define TEST_TYPE(TYPE) \ |
| 4 | __attribute__ ((noipa)) void vclz_##TYPE (TYPE *restrict dst, \ |
| 5 | TYPE *restrict a, int n) \ |
| 6 | { \ |
| 7 | for (int i = 0; i < n; i++) \ |
| 8 | dst[i] = __builtin_clz (a[i]); \ |
| 9 | } |
| 10 | |
| 11 | #define TEST_ALL() \ |
| 12 | TEST_TYPE (int8_t) \ |
| 13 | TEST_TYPE (uint8_t) \ |
| 14 | TEST_TYPE (int16_t) \ |
| 15 | TEST_TYPE (uint16_t) \ |
| 16 | TEST_TYPE (int32_t) \ |
| 17 | TEST_TYPE (uint32_t) \ |
| 18 | TEST_TYPE (int64_t) \ |
| 19 | TEST_TYPE (uint64_t) |
| 20 | |
| 21 | TEST_ALL() |