xref: /freebsd/contrib/arm-optimized-routines/pl/math/test/mathbench_funcs.h (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
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 #if defined(__vpcs) && __aarch64__
13 
14 #define _ZVF1(fun, a, b) VNF(_ZGVnN4v_##fun##f, a, b)
15 #define _ZVD1(f, a, b) VND(_ZGVnN2v_##f, a, b)
16 
17 #else
18 
19 #define _ZVF1(f, a, b)
20 #define _ZVD1(f, a, b)
21 
22 #endif
23 
24 #if WANT_SVE_MATH
25 
26 #define _ZSVF1(fun, a, b) SVF(_ZGVsMxv_##fun##f, a, b)
27 #define _ZSVD1(f, a, b) SVD(_ZGVsMxv_##f, a, b)
28 
29 #else
30 
31 #define _ZSVF1(f, a, b)
32 #define _ZSVD1(f, a, b)
33 
34 #endif
35 
36 /* No auto-generated wrappers for binary functions - they have be
37    manually defined in mathbench_wrappers.h. We have to define silent
38    macros for them anyway as they will be emitted by PL_SIG.  */
39 #define _ZSF2(...)
40 #define _ZSD2(...)
41 #define _ZVF2(...)
42 #define _ZVD2(...)
43 #define _ZSVF2(...)
44 #define _ZSVD2(...)
45 
46 #include "mathbench_funcs_gen.h"
47 
48 /* PL_SIG only emits entries for unary functions, since if a function
49    needs to be wrapped in mathbench there is no way for it to know the
50    same of the wrapper. Add entries for binary functions, or any other
51    exotic signatures that need wrapping, below.  */
52 
53 {"atan2f", 'f', 0, -10.0, 10.0, {.f = atan2f_wrap}},
54 {"atan2",  'd', 0, -10.0, 10.0, {.d = atan2_wrap}},
55 {"powi",   'd', 0,  0.01, 11.1, {.d = powi_wrap}},
56 
57 {"_ZGVnN4vv_atan2f", 'f', 'n', -10.0, 10.0, {.vnf = _Z_atan2f_wrap}},
58 {"_ZGVnN2vv_atan2",  'd', 'n', -10.0, 10.0, {.vnd = _Z_atan2_wrap}},
59 {"_ZGVnN4vv_hypotf", 'f', 'n', -10.0, 10.0, {.vnf = _Z_hypotf_wrap}},
60 {"_ZGVnN2vv_hypot",  'd', 'n', -10.0, 10.0, {.vnd = _Z_hypot_wrap}},
61 {"_ZGVnN2vv_pow",    'd', 'n', -10.0, 10.0, {.vnd = xy_Z_pow}},
62 {"x_ZGVnN2vv_pow",   'd', 'n', -10.0, 10.0, {.vnd = x_Z_pow}},
63 {"y_ZGVnN2vv_pow",   'd', 'n', -10.0, 10.0, {.vnd = y_Z_pow}},
64 {"_ZGVnN4vl4l4_sincosf", 'f', 'n', -3.1, 3.1, {.vnf = _Z_sincosf_wrap}},
65 {"_ZGVnN2vl8l8_sincos", 'd', 'n', -3.1, 3.1, {.vnd = _Z_sincos_wrap}},
66 {"_ZGVnN4v_cexpif", 'f', 'n', -3.1, 3.1, {.vnf = _Z_cexpif_wrap}},
67 {"_ZGVnN2v_cexpi", 'd', 'n', -3.1, 3.1, {.vnd = _Z_cexpi_wrap}},
68 
69 #if WANT_SVE_MATH
70 {"_ZGVsMxvv_atan2f", 'f', 's', -10.0, 10.0, {.svf = _Z_sv_atan2f_wrap}},
71 {"_ZGVsMxvv_atan2",  'd', 's', -10.0, 10.0, {.svd = _Z_sv_atan2_wrap}},
72 {"_ZGVsMxvv_hypotf", 'f', 's', -10.0, 10.0, {.svf = _Z_sv_hypotf_wrap}},
73 {"_ZGVsMxvv_hypot",  'd', 's', -10.0, 10.0, {.svd = _Z_sv_hypot_wrap}},
74 {"_ZGVsMxvv_powi",   'f', 's', -10.0, 10.0, {.svf = _Z_sv_powi_wrap}},
75 {"_ZGVsMxvv_powk",   'd', 's', -10.0, 10.0, {.svd = _Z_sv_powk_wrap}},
76 {"_ZGVsMxvv_powf",   'f', 's', -10.0, 10.0, {.svf = xy_Z_sv_powf}},
77 {"x_ZGVsMxvv_powf",  'f', 's', -10.0, 10.0, {.svf = x_Z_sv_powf}},
78 {"y_ZGVsMxvv_powf",  'f', 's', -10.0, 10.0, {.svf = y_Z_sv_powf}},
79 {"_ZGVsMxvv_pow",    'd', 's', -10.0, 10.0, {.svd = xy_Z_sv_pow}},
80 {"x_ZGVsMxvv_pow",   'd', 's', -10.0, 10.0, {.svd = x_Z_sv_pow}},
81 {"y_ZGVsMxvv_pow",   'd', 's', -10.0, 10.0, {.svd = y_Z_sv_pow}},
82 {"_ZGVsMxvl4l4_sincosf", 'f', 's', -3.1, 3.1, {.svf = _Z_sv_sincosf_wrap}},
83 {"_ZGVsMxvl8l8_sincos", 'd', 's', -3.1, 3.1, {.svd = _Z_sv_sincos_wrap}},
84 {"_ZGVsMxv_cexpif", 'f', 's', -3.1, 3.1, {.svf = _Z_sv_cexpif_wrap}},
85 {"_ZGVsMxv_cexpi", 'd', 's', -3.1, 3.1, {.svd = _Z_sv_cexpi_wrap}},
86 #endif
87     // clang-format on
88