OLD | NEW |
1 #include <stdint.h> | 1 #include <stdint.h> |
2 #include "test_arith.def" | 2 #include "test_arith.def" |
3 | 3 |
| 4 // Vector types |
| 5 typedef int32_t v4si32 __attribute__((vector_size(16))); |
| 6 typedef uint32_t v4ui32 __attribute__((vector_size(16))); |
| 7 typedef int16_t v8si16 __attribute__((vector_size(16))); |
| 8 typedef uint16_t v8ui16 __attribute__((vector_size(16))); |
| 9 typedef int8_t v16si8 __attribute__((vector_size(16))); |
| 10 typedef uint8_t v16ui8 __attribute__((vector_size(16))); |
| 11 typedef float v4f32 __attribute__((vector_size(16))); |
| 12 |
4 #define X(inst, op, isdiv) \ | 13 #define X(inst, op, isdiv) \ |
5 bool test##inst(bool a, bool b); \ | 14 bool test##inst(bool a, bool b); \ |
6 uint8_t test##inst(uint8_t a, uint8_t b); \ | 15 uint8_t test##inst(uint8_t a, uint8_t b); \ |
7 uint16_t test##inst(uint16_t a, uint16_t b); \ | 16 uint16_t test##inst(uint16_t a, uint16_t b); \ |
8 uint32_t test##inst(uint32_t a, uint32_t b); \ | 17 uint32_t test##inst(uint32_t a, uint32_t b); \ |
9 uint64_t test##inst(uint64_t a, uint64_t b); | 18 uint64_t test##inst(uint64_t a, uint64_t b); \ |
| 19 v4ui32 test##inst(v4ui32 a, v4ui32 b); \ |
| 20 v8ui16 test##inst(v8ui16 a, v8ui16 b); \ |
| 21 v16ui8 test##inst(v16ui8 a, v16ui8 b); |
10 UINTOP_TABLE | 22 UINTOP_TABLE |
11 #undef X | 23 #undef X |
12 | 24 |
13 #define X(inst, op, isdiv) \ | 25 #define X(inst, op, isdiv) \ |
14 bool test##inst(bool a, bool b); \ | 26 bool test##inst(bool a, bool b); \ |
15 int8_t test##inst(int8_t a, int8_t b); \ | 27 int8_t test##inst(int8_t a, int8_t b); \ |
16 int16_t test##inst(int16_t a, int16_t b); \ | 28 int16_t test##inst(int16_t a, int16_t b); \ |
17 int32_t test##inst(int32_t a, int32_t b); \ | 29 int32_t test##inst(int32_t a, int32_t b); \ |
18 int64_t test##inst(int64_t a, int64_t b); | 30 int64_t test##inst(int64_t a, int64_t b); \ |
| 31 v4si32 test##inst(v4si32 a, v4si32 b); \ |
| 32 v8si16 test##inst(v8si16 a, v8si16 b); \ |
| 33 v16si8 test##inst(v16si8 a, v16si8 b); |
19 SINTOP_TABLE | 34 SINTOP_TABLE |
20 #undef X | 35 #undef X |
21 | 36 |
22 float myFrem(float a, float b); | 37 float myFrem(float a, float b); |
23 double myFrem(double a, double b); | 38 double myFrem(double a, double b); |
| 39 v4f32 myFrem(v4f32 a, v4f32 b); |
24 | 40 |
25 #define X(inst, op, func) \ | 41 #define X(inst, op, func) \ |
26 float test##inst(float a, float b); \ | 42 float test##inst(float a, float b); \ |
27 double test##inst(double a, double b); | 43 double test##inst(double a, double b); \ |
| 44 v4f32 test##inst(v4f32 a, v4f32 b); |
28 FPOP_TABLE | 45 FPOP_TABLE |
29 #undef X | 46 #undef X |
30 | 47 |
31 float mySqrt(float a); | 48 float mySqrt(float a); |
32 double mySqrt(double a); | 49 double mySqrt(double a); |
| 50 // mySqrt for v4f32 is currently unsupported. |
OLD | NEW |