Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_convert_float2int-2.h

raw
1 #include <stdint-gcc.h>
2
3 #define DEF_LOOP(OLD_TYPE, NEW_TYPE) \
4 void __attribute__ ((noipa)) \
5 test_##OLD_TYPE##_2_##NEW_TYPE (NEW_TYPE *__restrict r, \
6 OLD_TYPE *__restrict a, NEW_TYPE b, \
7 OLD_TYPE *__restrict pred, int n) \
8 { \
9 for (int i = 0; i < n; ++i) \
10 { \
11 r[i] = pred[i] ? (NEW_TYPE) a[i] : b; \
12 } \
13 }
14
15 /* FP -> INT */
16 #define TEST_ALL_F2X_SAME(T) \
17 T (float, uint32_t) \
18 T (float, int32_t) \
19 T (double, uint64_t) \
20 T (double, int64_t)
21
22 /* FP -> wider-INT */
23 #define TEST_ALL_F2X_WIDER(T) \
24 T (float, uint64_t) \
25 T (float, int64_t)
26
27 /* FP -> narrower-INT */
28 #define TEST_ALL_F2X_NARROWER(T) \
29 T (float, uint8_t) \
30 T (float, int8_t) \
31 T (float, uint16_t) \
32 T (float, int16_t) \
33 T (double, uint8_t) \
34 T (double, int8_t) \
35 T (double, uint16_t) \
36 T (double, int16_t) \
37 T (double, uint32_t) \
38 T (double, int32_t)
39
40 TEST_ALL_F2X_SAME (DEF_LOOP)
41 TEST_ALL_F2X_WIDER (DEF_LOOP)
42 TEST_ALL_F2X_NARROWER (DEF_LOOP)