diff options
-rw-r--r-- | math/exp2f.c | 2 | ||||
-rw-r--r-- | math/expf.c | 2 | ||||
-rw-r--r-- | math/include/mathlib.h (renamed from math/include/arm_math.h) | 24 | ||||
-rw-r--r-- | math/log2f.c | 2 | ||||
-rw-r--r-- | math/logf.c | 2 | ||||
-rw-r--r-- | math/math_config.h | 1 | ||||
-rw-r--r-- | math/powf.c | 2 | ||||
-rw-r--r-- | math/single/e_expf.c | 5 | ||||
-rw-r--r-- | math/single/e_logf.c | 6 | ||||
-rw-r--r-- | math/single/e_powf.c | 5 | ||||
-rw-r--r-- | math/single/e_rem_pio2.c | 5 | ||||
-rw-r--r-- | math/single/funder.c | 2 | ||||
-rw-r--r-- | math/single/math_private.h | 7 | ||||
-rw-r--r-- | math/single/poly.c | 2 | ||||
-rw-r--r-- | math/single/rredf.c | 2 | ||||
-rw-r--r-- | math/single/rredf.h | 6 | ||||
-rw-r--r-- | math/single/s_sincosf.c | 12 | ||||
-rw-r--r-- | math/single/s_tanf.c | 4 | ||||
-rw-r--r-- | test/mathtest.c | 11 |
19 files changed, 41 insertions, 61 deletions
diff --git a/math/exp2f.c b/math/exp2f.c index fca66fe..ae080f3 100644 --- a/math/exp2f.c +++ b/math/exp2f.c @@ -43,7 +43,7 @@ top12 (float x) } float -ARM__exp2f (float x) +exp2f (float x) { uint32_t abstop; uint64_t ki, t; diff --git a/math/expf.c b/math/expf.c index 6b81310..90fd3b7 100644 --- a/math/expf.c +++ b/math/expf.c @@ -47,7 +47,7 @@ top12 (float x) } float -ARM__expf (float x) +expf (float x) { uint32_t abstop; uint64_t ki, t; diff --git a/math/include/arm_math.h b/math/include/mathlib.h index e5f8fd4..43962ab 100644 --- a/math/include/arm_math.h +++ b/math/include/mathlib.h @@ -1,5 +1,5 @@ /* - * arm_math.h - ARM math library function definitions + * Public API. * * Copyright (c) 2015, Arm Limited. * SPDX-License-Identifier: Apache-2.0 @@ -17,17 +17,11 @@ * limitations under the License. */ -/* Double precision */ -__attribute__((const)) double ARM__sin(double); -__attribute__((const)) double ARM__cos(double); -double ARM__tan(double); - -/* Single precision */ -float ARM__sinf(float); -float ARM__cosf(float); -float ARM__tanf(float); -float ARM__expf(float); -float ARM__exp2f(float); -float ARM__logf(float); -float ARM__log2f(float); -float ARM__powf(float, float); +float sinf(float); +float cosf(float); +float tanf(float); +float expf(float); +float exp2f(float); +float logf(float); +float log2f(float); +float powf(float, float); diff --git a/math/log2f.c b/math/log2f.c index dab7005..488d731 100644 --- a/math/log2f.c +++ b/math/log2f.c @@ -35,7 +35,7 @@ Relative error: 1.9 * 2^-26 (before rounding.) #define OFF 0x3f330000 float -ARM__log2f (float x) +log2f (float x) { /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */ double_t z, r, r2, p, y, y0, invc, logc; diff --git a/math/logf.c b/math/logf.c index eb06a63..91a2cf8 100644 --- a/math/logf.c +++ b/math/logf.c @@ -40,7 +40,7 @@ Relative error: 1.957 * 2^-26 (before rounding.) #define OFF 0x3f330000 float -ARM__logf (float x) +logf (float x) { /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */ double_t z, r, r2, y, y0, invc, logc; diff --git a/math/math_config.h b/math/math_config.h index 247351e..4e0f643 100644 --- a/math/math_config.h +++ b/math/math_config.h @@ -20,7 +20,6 @@ #ifndef _MATH_CONFIG_H #define _MATH_CONFIG_H -#include "arm_math.h" #include <math.h> #include <stdint.h> diff --git a/math/powf.c b/math/powf.c index 8ffbe84..de9195f 100644 --- a/math/powf.c +++ b/math/powf.c @@ -144,7 +144,7 @@ zeroinfnan (uint32_t ix) } float -ARM__powf (float x, float y) +powf (float x, float y) { unsigned long sign_bias = 0; uint32_t ix, iy; diff --git a/math/single/e_expf.c b/math/single/e_expf.c index 4b0c368..9334650 100644 --- a/math/single/e_expf.c +++ b/math/single/e_expf.c @@ -22,13 +22,12 @@ * out of all recognition by SGT. */ -#include "arm_math.h" -#include "math_private.h" #include <math.h> #include <errno.h> +#include "math_private.h" float -ARM__expf(float X) +expf(float X) { int N; float XN, g, Rg, Result; unsigned ix = fai(X), edgecaseflag = 0; diff --git a/math/single/e_logf.c b/math/single/e_logf.c index d355743..a611ef9 100644 --- a/math/single/e_logf.c +++ b/math/single/e_logf.c @@ -22,14 +22,12 @@ * out of all recognition by SGT. */ -#include "arm_math.h" -#include "math_private.h" #include <math.h> #include <errno.h> - +#include "math_private.h" float -ARM__logf(float X) +logf(float X) { int N = 0; int aindex; diff --git a/math/single/e_powf.c b/math/single/e_powf.c index 6a196fd..1e75ea0 100644 --- a/math/single/e_powf.c +++ b/math/single/e_powf.c @@ -17,13 +17,12 @@ * limitations under the License. */ -#include "arm_math.h" -#include "math_private.h" #include <math.h> #include <errno.h> +#include "math_private.h" float -ARM__powf(float x, float y) +powf(float x, float y) { float logh, logl; float rlogh, rlogl; diff --git a/math/single/e_rem_pio2.c b/math/single/e_rem_pio2.c index ec18f35..29ce98d 100644 --- a/math/single/e_rem_pio2.c +++ b/math/single/e_rem_pio2.c @@ -17,11 +17,10 @@ * limitations under the License. */ -#include "arm_math.h" -#include "math_private.h" #include <math.h> +#include "math_private.h" -int ARM__ieee754_rem_pio2(double x, double *y) { +int __ieee754_rem_pio2(double x, double *y) { int q; y[1] = 0.0; /* default */ diff --git a/math/single/funder.c b/math/single/funder.c index 5e5f6b2..7779974 100644 --- a/math/single/funder.c +++ b/math/single/funder.c @@ -17,8 +17,8 @@ * limitations under the License. */ -#include "math_private.h" #include <fenv.h> +#include "math_private.h" __inline float __mathlib_flt_infnan2(float x, float y) { diff --git a/math/single/math_private.h b/math/single/math_private.h index 0b57072..56244c4 100644 --- a/math/single/math_private.h +++ b/math/single/math_private.h @@ -28,10 +28,8 @@ #include <errno.h> #include <stdint.h> -extern int ARM__ieee754_rem_pio2(double, double *); -extern double ARM__kernel_sin(double, double, int); -extern double ARM__kernel_cos(double, double); -extern double ARM__kernel_poly(const double *, int, double); +extern int __ieee754_rem_pio2(double, double *); +extern double __kernel_poly(const double *, int, double); #define __FP_IEEE #define __FP_FENV_EXCEPTIONS @@ -98,7 +96,6 @@ extern float __mathlib_flt_infnan2(float, float); extern double __mathlib_dbl_infnan(double); extern double __mathlib_dbl_infnan2(double, double); extern unsigned __ieee_status(unsigned, unsigned); -extern double ARM__kernel_tan(double, double, int); #define FLOAT_INFNAN(x) __mathlib_flt_infnan(x) #define FLOAT_INFNAN2(x,y) __mathlib_flt_infnan2(x,y) diff --git a/math/single/poly.c b/math/single/poly.c index 6f25bf5..b499496 100644 --- a/math/single/poly.c +++ b/math/single/poly.c @@ -17,7 +17,7 @@ * limitations under the License. */ -double ARM__kernel_poly(const double *coeffs, int n, double x) +double __kernel_poly(const double *coeffs, int n, double x) { double result = coeffs[--n]; diff --git a/math/single/rredf.c b/math/single/rredf.c index b463480..d5af534 100644 --- a/math/single/rredf.c +++ b/math/single/rredf.c @@ -47,7 +47,7 @@ extern "C" { * this value into a second register and we should change the * prototype! */ -float ARM__mathlib_rredf2(float x, int *q, unsigned k) +float __mathlib_rredf2(float x, int *q, unsigned k) { /* * First, weed out infinities and NaNs, and deal with them by diff --git a/math/single/rredf.h b/math/single/rredf.h index d888487..e639105 100644 --- a/math/single/rredf.h +++ b/math/single/rredf.h @@ -37,7 +37,7 @@ extern "C" { #endif /* __cplusplus */ -extern float ARM__mathlib_rredf2(float x, int *q, unsigned k); +extern float __mathlib_rredf2(float x, int *q, unsigned k); /* * Semantics of the function: @@ -53,7 +53,7 @@ extern float ARM__mathlib_rredf2(float x, int *q, unsigned k); * input value was trivial in some way (infinity, NaN, or so * small that we can safely return sin(x)=tan(x)=x,cos(x)=1). */ -static __inline float ARM__mathlib_rredf(float x, int *q) +static __inline float __mathlib_rredf(float x, int *q) { /* * First, extract the bit pattern of x as an integer, so that we @@ -146,7 +146,7 @@ static __inline float ARM__mathlib_rredf(float x, int *q) * That's enough to do in-line; if we're still playing, hand off * to the out-of-line main range reducer. */ - return ARM__mathlib_rredf2(x, q, k); + return __mathlib_rredf2(x, q, k); } #ifdef __cplusplus diff --git a/math/single/s_sincosf.c b/math/single/s_sincosf.c index 73712eb..4a1088d 100644 --- a/math/single/s_sincosf.c +++ b/math/single/s_sincosf.c @@ -21,18 +21,18 @@ * Source: my own head, and Remez-generated polynomial approximations. */ -#include "rredf.h" #include <fenv.h> -#include "math_private.h" #include <math.h> #include <errno.h> +#include "rredf.h" +#include "math_private.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef COSINE -#define FUNCNAME ARM__sinf +#define FUNCNAME sinf #define SOFTFP_FUNCNAME __softfp_sinf #define DO_SIN (!(q & 1)) #define NEGATE_SIN ((q & 2)) @@ -40,7 +40,7 @@ extern "C" { #define TRIVIAL_RESULT(x) FLOAT_CHECKDENORM(x) #define ERR_INF MATHERR_SINF_INF #else -#define FUNCNAME ARM__cosf +#define FUNCNAME cosf #define SOFTFP_FUNCNAME __softfp_cosf #define DO_SIN (q & 1) #define NEGATE_SIN (!(q & 2)) @@ -58,13 +58,13 @@ float FUNCNAME(float x) */ { /* - * I enclose the call to ARM__mathlib_rredf in braces so that + * I enclose the call to __mathlib_rredf in braces so that * the address-taken-ness of qq does not propagate * throughout the rest of the function, for what that might * be worth. */ int qq; - x = ARM__mathlib_rredf(x, &qq); + x = __mathlib_rredf(x, &qq); q = qq; } if (__builtin_expect(q < 0, 0)) { /* this signals tiny, inf, or NaN */ diff --git a/math/single/s_tanf.c b/math/single/s_tanf.c index f628165..3f874a6 100644 --- a/math/single/s_tanf.c +++ b/math/single/s_tanf.c @@ -31,7 +31,7 @@ extern "C" { #endif /* __cplusplus */ -float ARM__tanf(float x) +float tanf(float x) { int q; @@ -46,7 +46,7 @@ float ARM__tanf(float x) * be worth. */ int qq; - x = ARM__mathlib_rredf(x, &qq); + x = __mathlib_rredf(x, &qq); q = qq; } if (__builtin_expect(q < 0, 0)) { /* this signals tiny, inf, or NaN */ diff --git a/test/mathtest.c b/test/mathtest.c index 37b00ee..1199cd2 100644 --- a/test/mathtest.c +++ b/test/mathtest.c @@ -27,7 +27,6 @@ #include <errno.h> #include <limits.h> #include <fenv.h> -#include <arm_math.h> #ifndef math_errhandling # define math_errhandling 0 @@ -52,12 +51,12 @@ _Pragma(STR(import IMPORT_SYMBOL)) #endif -EXTERN_C int ARM__ieee754_rem_pio2(double, double *); +EXTERN_C int __ieee754_rem_pio2(double, double *); #include "../math/single/rredf.h" int sp_rem_pio2(float x, float *y) { int q; - *y = ARM__mathlib_rredf(x, &q); + *y = __mathlib_rredf(x, &q); return q; } @@ -209,11 +208,7 @@ int is_complex_rettype(int rettype) { #define ABSLOWERBOUND 0x4000000000000000LL #define PLUSMINUSPIO2 0x1000000000000000LL -#ifndef TEST_LOCAL_LIBM -#define ARM_PREFIX(x) ARM__##x -#else #define ARM_PREFIX(x) x -#endif #define TFUNC(arg,ret,name,tolerance) { t_func, arg, ret, (void*)&name, m_none, tolerance, #name } #define TFUNCARM(arg,ret,name,tolerance) { t_func, arg, ret, (void*)& ARM_PREFIX(name), m_none, tolerance, #name } @@ -1113,7 +1108,7 @@ int runtest(testdetail t) { case m_islessgreaterf: intres = islessgreater(s_arg1.f, s_arg2.f); break; case m_isunorderedf: intres = isunordered(s_arg1.f, s_arg2.f); break; - case m_rred: intres = 3 & ARM__ieee754_rem_pio2(d_arg1.f, d_res.da); break; + case m_rred: intres = 3 & __ieee754_rem_pio2(d_arg1.f, d_res.da); break; case m_rredf: intres = 3 & sp_rem_pio2(s_arg1.f, s_res.da); break; default: printf("unhandled macro: %s\n",t.func->name); |