Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/bf16_arith_1.h

raw
1 #define DO_REGREG_OPS(OP, NAME) \
2 void varith_##NAME (__bf16 *dst, __bf16 *src, int count) \
3 { \
4 for (int i = 0; i < count; ++i) \
5 dst[i] = dst[i] OP src[i]; \
6 }
7
8 #define DO_IMMEDIATE_OPS(VALUE, OP, NAME) \
9 void varithimm_##NAME (__bf16 *dst, int count) \
10 { \
11 for (int i = 0; i < count; ++i) \
12 dst[i] = dst[i] OP (__bf16) VALUE; \
13 }
14
15 #define DO_ARITH_OPS(OP, NAME) \
16 DO_REGREG_OPS (OP, NAME); \
17 DO_IMMEDIATE_OPS (0.5, OP, NAME ## pointfive); \
18 DO_IMMEDIATE_OPS (2, OP, NAME ## 2); \
19 DO_IMMEDIATE_OPS (2.5, OP, NAME ## twopoint5); \
20 DO_IMMEDIATE_OPS (-0.5, OP, NAME ## minuspointfive);
21
22 DO_ARITH_OPS (+, add)
23 DO_ARITH_OPS (-, minus)
24 DO_ARITH_OPS (*, mult)