From cc1135d5bad5293c9b100c0c6e1aec731740295b Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Sat, 9 Dec 2017 10:49:25 -0800 Subject: [PATCH] Updating the PAL layer to support acosh, asinh, atanh, and cbrt --- src/pal/inc/pal.h | 12 ++++++ src/pal/src/cruntime/math.cpp | 77 +++++++++++++++++++++++++++++++++++ src/pal/src/include/pal/palinternal.h | 8 ++++ 3 files changed, 97 insertions(+) diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index 0e085bd..aff205d 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -4946,14 +4946,18 @@ CoCreateGuid(OUT GUID * pguid); #define atol PAL_atol #define labs PAL_labs #define acos PAL_acos +#define acosh PAL_acosh #define asin PAL_asin +#define asinh PAL_asinh #define atan2 PAL_atan2 #define exp PAL_exp #define log PAL_log #define log10 PAL_log10 #define pow PAL_pow #define acosf PAL_acosf +#define acoshf PAL_acoshf #define asinf PAL_asinf +#define asinhf PAL_asinhf #define atan2f PAL_atan2f #define expf PAL_expf #define logf PAL_logf @@ -5198,9 +5202,13 @@ PALIMPORT int __cdecl _finite(double); PALIMPORT int __cdecl _isnan(double); PALIMPORT double __cdecl _copysign(double, double); PALIMPORT double __cdecl acos(double); +PALIMPORT double __cdecl acosh(double); PALIMPORT double __cdecl asin(double); +PALIMPORT double __cdecl asinh(double); PALIMPORT double __cdecl atan(double); +PALIMPORT double __cdecl atanh(double); PALIMPORT double __cdecl atan2(double, double); +PALIMPORT double __cdecl cbrt(double); PALIMPORT double __cdecl ceil(double); PALIMPORT double __cdecl cos(double); PALIMPORT double __cdecl cosh(double); @@ -5222,9 +5230,13 @@ PALIMPORT int __cdecl _finitef(float); PALIMPORT int __cdecl _isnanf(float); PALIMPORT float __cdecl _copysignf(float, float); PALIMPORT float __cdecl acosf(float); +PALIMPORT float __cdecl acoshf(float); PALIMPORT float __cdecl asinf(float); +PALIMPORT float __cdecl asinhf(float); PALIMPORT float __cdecl atanf(float); +PALIMPORT float __cdecl atanhf(float); PALIMPORT float __cdecl atan2f(float, float); +PALIMPORT float __cdecl cbrtf(float); PALIMPORT float __cdecl ceilf(float); PALIMPORT float __cdecl cosf(float); PALIMPORT float __cdecl coshf(float); diff --git a/src/pal/src/cruntime/math.cpp b/src/pal/src/cruntime/math.cpp index 7b5175a..a36ac9a 100644 --- a/src/pal/src/cruntime/math.cpp +++ b/src/pal/src/cruntime/math.cpp @@ -143,6 +143,25 @@ PALIMPORT double __cdecl PAL_acos(double x) /*++ Function: + acosh + +See MSDN. +--*/ +PALIMPORT double __cdecl PAL_acosh(double x) +{ + double ret; + PERF_ENTRY(acosh); + ENTRY("acosh (x=%f)\n", x); + + ret = acosh(x); + + LOGEXIT("acosh returns double %f\n", ret); + PERF_EXIT(acosh); + return ret; +} + +/*++ +Function: asin See MSDN. @@ -173,6 +192,25 @@ PALIMPORT double __cdecl PAL_asin(double x) /*++ Function: + asinh + +See MSDN. +--*/ +PALIMPORT double __cdecl PAL_asinh(double x) +{ + double ret; + PERF_ENTRY(asinh); + ENTRY("asinh (x=%f)\n", x); + + ret = asinh(x); + + LOGEXIT("asinh returns double %f\n", ret); + PERF_EXIT(asinh); + return ret; +} + +/*++ +Function: atan2 See MSDN. @@ -515,6 +553,25 @@ PALIMPORT float __cdecl PAL_acosf(float x) /*++ Function: + acoshf + +See MSDN. +--*/ +PALIMPORT float __cdecl PAL_acoshf(float x) +{ + float ret; + PERF_ENTRY(acoshf); + ENTRY("acoshf (x=%f)\n", x); + + ret = acoshf(x); + + LOGEXIT("acoshf returns float %f\n", ret); + PERF_EXIT(acoshf); + return ret; +} + +/*++ +Function: asinf See MSDN. @@ -545,6 +602,26 @@ PALIMPORT float __cdecl PAL_asinf(float x) /*++ Function: + asinhf + +See MSDN. +--*/ +PALIMPORT float __cdecl PAL_asinhf(float x) +{ + float ret; + PERF_ENTRY(asinhf); + ENTRY("asinhf (x=%f)\n", x); + + ret = asinhf(x); + + LOGEXIT("asinhf returns float %f\n", ret); + PERF_EXIT(asinhf); + return ret; +} + + +/*++ +Function: atan2f See MSDN. diff --git a/src/pal/src/include/pal/palinternal.h b/src/pal/src/include/pal/palinternal.h index abebcb5..13ef867 100644 --- a/src/pal/src/include/pal/palinternal.h +++ b/src/pal/src/include/pal/palinternal.h @@ -447,9 +447,13 @@ function_name() to call the system's implementation #undef labs #undef llabs #undef acos +#undef acosh #undef asin +#undef asinh #undef atan +#undef atanh #undef atan2 +#undef cbrt #undef ceil #undef cos #undef cosh @@ -467,9 +471,13 @@ function_name() to call the system's implementation #undef tan #undef tanh #undef acosf +#undef acoshf #undef asinf +#undef asinhf #undef atanf +#undef atanhf #undef atan2f +#undef cbrtf #undef ceilf #undef cosf #undef coshf -- 2.7.4