xref: /freebsd/contrib/arm-optimized-routines/math/test/ulp_wrappers.h (revision 5a02ffc32e777041dd2dad4e651ed2a0865a0a5d)
1 /*
2  * Function wrappers for ulp.
3  *
4  * Copyright (c) 2022-2023, Arm Limited.
5  * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
6  */
7 
8 /* clang-format off */
9 
10 /* Wrappers for sincos.  */
sincosf_sinf(float x)11 static float sincosf_sinf(float x) {(void)cosf(x); return sinf(x);}
sincosf_cosf(float x)12 static float sincosf_cosf(float x) {(void)sinf(x); return cosf(x);}
sincos_sin(double x)13 static double sincos_sin(double x) {(void)cos(x); return sin(x);}
sincos_cos(double x)14 static double sincos_cos(double x) {(void)sin(x); return cos(x);}
15 #if USE_MPFR
sincos_mpfr_sin(mpfr_t y,const mpfr_t x,mpfr_rnd_t r)16 static int sincos_mpfr_sin(mpfr_t y, const mpfr_t x, mpfr_rnd_t r) { mpfr_cos(y,x,r); return mpfr_sin(y,x,r); }
sincos_mpfr_cos(mpfr_t y,const mpfr_t x,mpfr_rnd_t r)17 static int sincos_mpfr_cos(mpfr_t y, const mpfr_t x, mpfr_rnd_t r) { mpfr_sin(y,x,r); return mpfr_cos(y,x,r); }
18 #endif
19 
20 /* Wrappers for vector functions.  */
21 #ifdef __vpcs
Z_sinf(float x)22 static float Z_sinf(float x) { return _ZGVnN4v_sinf(argf(x))[0]; }
Z_cosf(float x)23 static float Z_cosf(float x) { return _ZGVnN4v_cosf(argf(x))[0]; }
Z_expf_1u(float x)24 static float Z_expf_1u(float x) { return _ZGVnN4v_expf_1u(argf(x))[0]; }
Z_expf(float x)25 static float Z_expf(float x) { return _ZGVnN4v_expf(argf(x))[0]; }
Z_exp2f_1u(float x)26 static float Z_exp2f_1u(float x) { return _ZGVnN4v_exp2f_1u(argf(x))[0]; }
Z_exp2f(float x)27 static float Z_exp2f(float x) { return _ZGVnN4v_exp2f(argf(x))[0]; }
Z_logf(float x)28 static float Z_logf(float x) { return _ZGVnN4v_logf(argf(x))[0]; }
Z_powf(float x,float y)29 static float Z_powf(float x, float y) { return _ZGVnN4vv_powf(argf(x),argf(y))[0]; }
Z_sin(double x)30 static double Z_sin(double x) { return _ZGVnN2v_sin(argd(x))[0]; }
Z_cos(double x)31 static double Z_cos(double x) { return _ZGVnN2v_cos(argd(x))[0]; }
Z_exp(double x)32 static double Z_exp(double x) { return _ZGVnN2v_exp(argd(x))[0]; }
Z_log(double x)33 static double Z_log(double x) { return _ZGVnN2v_log(argd(x))[0]; }
Z_pow(double x,double y)34 static double Z_pow(double x, double y) { return _ZGVnN2vv_pow(argd(x),argd(y))[0]; }
35 #endif
36 
37 /* clang-format on */
38