xref: /freebsd/contrib/arm-optimized-routines/pl/math/test/mathbench_funcs.h (revision cccdaf507eee8fb34494b4624eb85bb951e323c8)
1 // clang-format off
2 /*
3  * Function entries for mathbench.
4  *
5  * Copyright (c) 2022-2023, Arm Limited.
6  * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
7  */
8 
9 #define _ZSF1(fun, a, b) F(fun##f, a, b)
10 #define _ZSD1(f, a, b) D(f, a, b)
11 
12 #ifdef __vpcs
13 
14 #define _ZVF1(fun, a, b) F(__s_##fun##f, a, b) VF(__v_##fun##f, a, b) VNF(__vn_##fun##f, a, b) VNF(_ZGVnN4v_##fun##f, a, b)
15 #define _ZVD1(f, a, b) D(__s_##f, a, b) VD(__v_##f, a, b) VND(__vn_##f, a, b) VND(_ZGVnN2v_##f, a, b)
16 
17 #elif __aarch64__
18 
19 #define _ZVF1(fun, a, b) F(__s_##fun##f, a, b) VF(__v_##fun##f, a, b)
20 #define _ZVD1(f, a, b) D(__s_##f, a, b) VD(__v_##f, a, b)
21 
22 #elif WANT_VMATH
23 
24 #define _ZVF1(fun, a, b) F(__s_##fun##f, a, b)
25 #define _ZVD1(f, a, b) D(__s_##f, a, b)
26 
27 #else
28 
29 #define _ZVF1(f, a, b)
30 #define _ZVD1(f, a, b)
31 
32 #endif
33 
34 #if WANT_SVE_MATH
35 
36 #define _ZSVF1(fun, a, b) SVF(__sv_##fun##f_x, a, b) SVF(_ZGVsMxv_##fun##f, a, b)
37 #define _ZSVD1(f, a, b) SVD(__sv_##f##_x, a, b) SVD(_ZGVsMxv_##f, a, b)
38 
39 #else
40 
41 #define _ZSVF1(f, a, b)
42 #define _ZSVD1(f, a, b)
43 
44 #endif
45 
46 /* No auto-generated wrappers for binary functions - they have be
47    manually defined in mathbench_wrappers.h. We have to define silent
48    macros for them anyway as they will be emitted by PL_SIG.  */
49 #define _ZSF2(...)
50 #define _ZSD2(...)
51 #define _ZVF2(...)
52 #define _ZVD2(...)
53 #define _ZSVF2(...)
54 #define _ZSVD2(...)
55 
56 #include "mathbench_funcs_gen.h"
57 
58 /* PL_SIG only emits entries for unary functions, since if a function
59    needs to be wrapped in mathbench there is no way for it to know the
60    same of the wrapper. Add entries for binary functions, or any other
61    exotic signatures that need wrapping, below.  */
62 
63 {"atan2f", 'f', 0, -10.0, 10.0, {.f = atan2f_wrap}},
64 {"atan2",  'd', 0, -10.0, 10.0, {.d = atan2_wrap}},
65 {"powi",   'd', 0,  0.01, 11.1, {.d = powi_wrap}},
66 
67 {"__s_atan2f",       'f', 0,   -10.0, 10.0, {.f = __s_atan2f_wrap}},
68 {"__s_atan2",        'd', 0,   -10.0, 10.0, {.d = __s_atan2_wrap}},
69 {"__v_atan2f",       'f', 'v', -10.0, 10.0, {.vf = __v_atan2f_wrap}},
70 {"__v_atan2",        'd', 'v', -10.0, 10.0, {.vd = __v_atan2_wrap}},
71 {"__vn_atan2f",      'f', 'n', -10.0, 10.0, {.vnf = __vn_atan2f_wrap}},
72 {"_ZGVnN4vv_atan2f", 'f', 'n', -10.0, 10.0, {.vnf = _Z_atan2f_wrap}},
73 {"__vn_atan2",       'd', 'n', -10.0, 10.0, {.vnd = __vn_atan2_wrap}},
74 {"_ZGVnN2vv_atan2",  'd', 'n', -10.0, 10.0, {.vnd = _Z_atan2_wrap}},
75 
76 #if WANT_SVE_MATH
77 {"__sv_atan2f_x",    'f', 's', -10.0, 10.0, {.svf = __sv_atan2f_wrap}},
78 {"_ZGVsMxvv_atan2f", 'f', 's', -10.0, 10.0, {.svf = _Z_sv_atan2f_wrap}},
79 {"__sv_atan2_x",     'd', 's', -10.0, 10.0, {.svd = __sv_atan2_wrap}},
80 {"_ZGVsM2vv_atan2",  'd', 's', -10.0, 10.0, {.svd = _Z_sv_atan2_wrap}},
81 {"__sv_powif_x",     'f', 's', -10.0, 10.0, {.svf = __sv_powif_wrap}},
82 {"_ZGVsMxvv_powi",   'f', 's', -10.0, 10.0, {.svf = _Z_sv_powi_wrap}},
83 {"__sv_powi_x",      'd', 's', -10.0, 10.0, {.svd = __sv_powi_wrap}},
84 {"_ZGVsMxvv_powk",   'd', 's', -10.0, 10.0, {.svd = _Z_sv_powk_wrap}},
85 #endif
86   // clang-format on
87