Skip to content

Commit 0f7044c

Browse files
committed
pl/math: Remove all non-vpcs Neon variants
These routines are not used anywhere except our own tests, and prevent us from reducing dependency on the v_math.h wrappers. They are removed, along with associated test/bench infrastructure.
1 parent 7a2e12c commit 0f7044c

84 files changed

Lines changed: 54 additions & 613 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎pl/math/include/mathlib.h‎

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -54,45 +54,6 @@ typedef __attribute__((__neon_vector_type__(2))) double __f64x2_t;
5454
#error Unsupported compiler
5555
#endif
5656

57-
/* Vector functions following the base PCS. */
58-
__f32x4_t __v_acoshf (__f32x4_t);
59-
__f64x2_t __v_acosh (__f64x2_t);
60-
__f32x4_t __v_acosf (__f32x4_t);
61-
__f64x2_t __v_acos (__f64x2_t);
62-
__f32x4_t __v_asinf (__f32x4_t);
63-
__f64x2_t __v_asin (__f64x2_t);
64-
__f32x4_t __v_asinhf (__f32x4_t);
65-
__f64x2_t __v_asinh (__f64x2_t);
66-
__f32x4_t __v_atanf (__f32x4_t);
67-
__f64x2_t __v_atan (__f64x2_t);
68-
__f32x4_t __v_atan2f (__f32x4_t, __f32x4_t);
69-
__f64x2_t __v_atan2 (__f64x2_t, __f64x2_t);
70-
__f32x4_t __v_atanhf (__f32x4_t);
71-
__f64x2_t __v_atanh (__f64x2_t);
72-
__f32x4_t __v_cbrtf (__f32x4_t);
73-
__f64x2_t __v_cbrt (__f64x2_t);
74-
__f32x4_t __v_coshf (__f32x4_t);
75-
__f64x2_t __v_cosh (__f64x2_t);
76-
__f32x4_t __v_erff (__f32x4_t);
77-
__f64x2_t __v_erf (__f64x2_t);
78-
__f32x4_t __v_erfcf (__f32x4_t);
79-
__f64x2_t __v_erfc (__f64x2_t);
80-
__f64x2_t __v_exp2 (__f64x2_t);
81-
__f32x4_t __v_expm1f (__f32x4_t);
82-
__f64x2_t __v_expm1 (__f64x2_t);
83-
__f32x4_t __v_log10f (__f32x4_t);
84-
__f64x2_t __v_log10 (__f64x2_t);
85-
__f32x4_t __v_log1pf (__f32x4_t);
86-
__f64x2_t __v_log1p (__f64x2_t);
87-
__f32x4_t __v_log2f (__f32x4_t);
88-
__f64x2_t __v_log2 (__f64x2_t);
89-
__f32x4_t __v_sinhf (__f32x4_t);
90-
__f64x2_t __v_sinh (__f64x2_t);
91-
__f32x4_t __v_tanf (__f32x4_t);
92-
__f64x2_t __v_tan (__f64x2_t);
93-
__f32x4_t __v_tanhf (__f32x4_t);
94-
__f64x2_t __v_tanh (__f64x2_t);
95-
9657
#if __GNUC__ >= 9 || __clang_major__ >= 8
9758
#define __vpcs __attribute__((__aarch64_vector_pcs__))
9859

‎pl/math/test/mathbench_funcs.h‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@
99
#define _ZSF1(fun, a, b) F(fun##f, a, b)
1010
#define _ZSD1(f, a, b) D(f, a, b)
1111

12-
#ifdef __vpcs
12+
#if defined(__vpcs) && __aarch64__
1313

14-
#define _ZVF1(fun, 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) 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) VF(__v_##fun##f, a, b)
20-
#define _ZVD1(f, a, b) VD(__v_##f, a, b)
14+
#define _ZVF1(fun, a, b) VNF(__vn_##fun##f, a, b) VNF(_ZGVnN4v_##fun##f, a, b)
15+
#define _ZVD1(f, a, b) VND(__vn_##f, a, b) VND(_ZGVnN2v_##f, a, b)
2116

2217
#else
2318

@@ -59,8 +54,6 @@
5954
{"atan2", 'd', 0, -10.0, 10.0, {.d = atan2_wrap}},
6055
{"powi", 'd', 0, 0.01, 11.1, {.d = powi_wrap}},
6156

62-
{"__v_atan2f", 'f', 'v', -10.0, 10.0, {.vf = __v_atan2f_wrap}},
63-
{"__v_atan2", 'd', 'v', -10.0, 10.0, {.vd = __v_atan2_wrap}},
6457
{"__vn_atan2f", 'f', 'n', -10.0, 10.0, {.vnf = __vn_atan2f_wrap}},
6558
{"_ZGVnN4vv_atan2f", 'f', 'n', -10.0, 10.0, {.vnf = _Z_atan2f_wrap}},
6659
{"__vn_atan2", 'd', 'n', -10.0, 10.0, {.vnd = __vn_atan2_wrap}},

‎pl/math/test/mathbench_wrappers.h‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,7 @@ powi_wrap (double x)
2424
}
2525

2626
#if WANT_VMATH
27-
#if __aarch64__
28-
29-
static v_double
30-
__v_atan2_wrap (v_double x)
31-
{
32-
return __v_atan2 (v_double_dup (5.0), x);
33-
}
34-
35-
static v_float
36-
__v_atan2f_wrap (v_float x)
37-
{
38-
return __v_atan2f (v_float_dup (5.0f), x);
39-
}
40-
41-
#ifdef __vpcs
27+
#if __aarch64__ && defined(__vpcs)
4228

4329
__vpcs static v_double
4430
__vn_atan2_wrap (v_double x)
@@ -64,8 +50,7 @@ _Z_atan2f_wrap (v_float x)
6450
return _ZGVnN4vv_atan2f (v_float_dup (5.0f), x);
6551
}
6652

67-
#endif // __vpcs
68-
#endif // __arch64__
53+
#endif // __arch64__ && __vpcs
6954
#endif // WANT_VMATH
7055

7156
#if WANT_SVE_MATH

‎pl/math/test/runulp.sh‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ check atan2 nan nan x -nan -nan
4141

4242
# vector functions
4343
flags="${ULPFLAGS:--q}"
44-
runv=
45-
check __v_log10f 1 && runv=1
4644
runvn=
4745
check __vn_log10f 1 && runvn=1
4846
runsv=

‎pl/math/test/ulp_funcs.h‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,12 @@
55
* SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
66
*/
77

8-
#ifdef __vpcs
8+
#if defined(__vpcs) && __aarch64__
99

10-
#define _ZVF1(f) VF1 (f) ZVNF1 (f)
11-
#define _ZVD1(f) VD1 (f) ZVND1 (f)
12-
#define _ZVF2(f) VF2 (f) ZVNF2 (f)
13-
#define _ZVD2(f) VD2 (f) ZVND2 (f)
14-
15-
#elif __aarch64
16-
17-
#define _ZVF1(f) VF1 (f)
18-
#define _ZVD1(f) VD1 (f)
19-
#define _ZVF2(f) VF2 (f)
20-
#define _ZVD2(f) VD2 (f)
10+
#define _ZVF1(f) ZVNF1 (f)
11+
#define _ZVD1(f) ZVND1 (f)
12+
#define _ZVF2(f) ZVNF2 (f)
13+
#define _ZVD2(f) ZVND2 (f)
2114

2215
#else
2316

‎pl/math/test/ulp_wrappers.h‎

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,12 @@ DECL_POW_INT_REF(ref_powi, long double, double, int)
7575
#define ZVD1_WRAP(func) static double Z_##func(double x) { return _ZGVnN2v_##func(argd(x))[0]; }
7676
#define ZVD2_WRAP(func) static double Z_##func(double x, double y) { return _ZGVnN2vv_##func(argd(x), argd(y))[0]; }
7777

78-
#ifdef __vpcs
78+
#if defined(__vpcs) && __aarch64__
7979

80-
#define ZVNF1_WRAP(func) VF1_WRAP(func) VNF1_WRAP(func) ZVF1_WRAP(func)
81-
#define ZVNF2_WRAP(func) VF2_WRAP(func) VNF2_WRAP(func) ZVF2_WRAP(func)
82-
#define ZVND1_WRAP(func) VD1_WRAP(func) VND1_WRAP(func) ZVD1_WRAP(func)
83-
#define ZVND2_WRAP(func) VD2_WRAP(func) VND2_WRAP(func) ZVD2_WRAP(func)
84-
85-
#elif __aarch64__
86-
87-
#define ZVNF1_WRAP(func) VF1_WRAP(func) VNF1_WRAP(func)
88-
#define ZVNF2_WRAP(func) VF2_WRAP(func) VNF2_WRAP(func)
89-
#define ZVND1_WRAP(func) VD1_WRAP(func) VND1_WRAP(func)
90-
#define ZVND2_WRAP(func) VD2_WRAP(func) VND2_WRAP(func)
91-
92-
#elif WANT_VMATH
93-
94-
#define ZVNF1_WRAP(func) VF1_WRAP(func)
95-
#define ZVNF2_WRAP(func) VF2_WRAP(func)
96-
#define ZVND1_WRAP(func) VD1_WRAP(func)
97-
#define ZVND2_WRAP(func) VD2_WRAP(func)
80+
#define ZVNF1_WRAP(func) VNF1_WRAP(func) ZVF1_WRAP(func)
81+
#define ZVNF2_WRAP(func) VNF2_WRAP(func) ZVF2_WRAP(func)
82+
#define ZVND1_WRAP(func) VND1_WRAP(func) ZVD1_WRAP(func)
83+
#define ZVND2_WRAP(func) VND2_WRAP(func) ZVD2_WRAP(func)
9884

9985
#else
10086

‎pl/math/v_acos_2u.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ VPCS_ATTR v_f64_t V_NAME (acos) (v_f64_t x)
102102

103103
return v_fma_f64 (mul, y, add);
104104
}
105-
VPCS_ALIAS
105+
PL_ALIAS (V_NAME (acos), _ZGVnN2v_acos)
106106

107107
PL_SIG (V, D, 1, acos, -1.0, 1.0)
108108
PL_TEST_ULP (V_NAME (acos), 1.02)

‎pl/math/v_acosf_1u4.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ VPCS_ATTR v_f32_t V_NAME (acosf) (v_f32_t x)
9696

9797
return v_fma_f32 (mul, y, add);
9898
}
99-
VPCS_ALIAS
99+
PL_ALIAS (V_NAME (acosf), _ZGVnN4v_acosf)
100100

101101
PL_SIG (V, F, 1, acos, -1.0, 1.0)
102102
PL_TEST_ULP (V_NAME (acosf), 0.82)

‎pl/math/v_acosh_3u5.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ VPCS_ATTR v_f64_t V_NAME (acosh) (v_f64_t x)
3737
v_f64_t u = xm1 * (x + 1);
3838
return log1p_inline (xm1 + v_sqrt_f64 (u));
3939
}
40-
VPCS_ALIAS
40+
PL_ALIAS (V_NAME (acosh), _ZGVnN2v_acosh)
4141

4242
PL_SIG (V, D, 1, acosh, 1.0, 10.0)
4343
PL_TEST_ULP (V_NAME (acosh), 2.53)

‎pl/math/v_acoshf_3u1.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ VPCS_ATTR v_f32_t V_NAME (acoshf) (v_f32_t x)
5050
return special_case (x, y, special);
5151
return y;
5252
}
53-
VPCS_ALIAS
53+
PL_ALIAS (V_NAME (acoshf), _ZGVnN4v_acoshf)
5454

5555
PL_SIG (V, F, 1, acosh, 1.0, 10.0)
5656
#if WANT_SIMD_EXCEPT

0 commit comments

Comments
 (0)