aboutsummaryrefslogtreecommitdiff
path: root/pl/math/test/mathbench_wrappers.h
blob: eba960eb96ac7ae5828d56bea2ea4697ded92cb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
 * Function wrappers for mathbench.
 *
 * Copyright (c) 2022-2023, Arm Limited.
 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
 */

static double
atan2_wrap (double x)
{
  return atan2 (5.0, x);
}

static float
atan2f_wrap (float x)
{
  return atan2f (5.0f, x);
}

static double
powi_wrap (double x)
{
  return __builtin_powi (x, (int) round (x));
}

#if WANT_VMATH
#if __aarch64__

static double
__s_atan2_wrap (double x)
{
  return __s_atan2 (5.0, x);
}

static float
__s_atan2f_wrap (float x)
{
  return __s_atan2f (5.0f, x);
}

static v_double
__v_atan2_wrap (v_double x)
{
  return __v_atan2 (v_double_dup (5.0), x);
}

static v_float
__v_atan2f_wrap (v_float x)
{
  return __v_atan2f (v_float_dup (5.0f), x);
}

#ifdef __vpcs

__vpcs static v_double
__vn_atan2_wrap (v_double x)
{
  return __vn_atan2 (v_double_dup (5.0), x);
}

__vpcs static v_float
__vn_atan2f_wrap (v_float x)
{
  return __vn_atan2f (v_float_dup (5.0f), x);
}

__vpcs static v_double
_Z_atan2_wrap (v_double x)
{
  return _ZGVnN2vv_atan2 (v_double_dup (5.0), x);
}

__vpcs static v_float
_Z_atan2f_wrap (v_float x)
{
  return _ZGVnN4vv_atan2f (v_float_dup (5.0f), x);
}

#endif // __vpcs
#endif // __arch64__
#endif // WANT_VMATH

#if WANT_SVE_MATH

static sv_float
__sv_atan2f_wrap (sv_float x, sv_bool pg)
{
  return __sv_atan2f_x (x, svdup_n_f32 (5.0f), pg);
}

static sv_float
_Z_sv_atan2f_wrap (sv_float x, sv_bool pg)
{
  return _ZGVsMxvv_atan2f (x, svdup_n_f32 (5.0f), pg);
}

static sv_double
__sv_atan2_wrap (sv_double x, sv_bool pg)
{
  return __sv_atan2_x (x, svdup_n_f64 (5.0), pg);
}

static sv_double
_Z_sv_atan2_wrap (sv_double x, sv_bool pg)
{
  return _ZGVsMxvv_atan2 (x, svdup_n_f64 (5.0), pg);
}

static sv_float
_Z_sv_powi_wrap (sv_float x, sv_bool pg)
{
  return _ZGVsMxvv_powi (x, svcvt_s32_f32_x (pg, x), pg);
}

static sv_float
__sv_powif_wrap (sv_float x, sv_bool pg)
{
  return __sv_powif_x (x, svcvt_s32_f32_x (pg, x), pg);
}

static sv_double
_Z_sv_powk_wrap (sv_double x, sv_bool pg)
{
  return _ZGVsMxvv_powk (x, svcvt_s64_f64_x (pg, x), pg);
}

static sv_double
__sv_powi_wrap (sv_double x, sv_bool pg)
{
  return __sv_powi_x (x, svcvt_s64_f64_x (pg, x), pg);
}

#endif // WANT_SVE_MATH