From 65956c76e1d1e0a55febc2925318b8216fb1757a Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Fri, 6 Jan 2023 20:12:33 +0000 Subject: [PATCH] Bug 1760633: Apply the fdlibm patches for the new files to the in-tree files r=arai This updates our previously in-tree files to account for the new files we added. Differential Revision: https://phabricator.services.mozilla.com/D164818 --- modules/fdlibm/moz.yaml | 2 +- modules/fdlibm/src/fdlibm.h | 22 ++++++++++++++++++++-- modules/fdlibm/src/math_private.h | 14 ++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/modules/fdlibm/moz.yaml b/modules/fdlibm/moz.yaml index 1a2f568909fd..52fda3d63bbc 100644 --- a/modules/fdlibm/moz.yaml +++ b/modules/fdlibm/moz.yaml @@ -17,7 +17,7 @@ origin: # Revision to pull in # Must be a long or short commit SHA (long preferred) - revision: 369ea0520a3061c07400d7cd32172efb6af39815 + revision: bd5e624a861433dee76fe00a8acedc9564425332 license: "BSD-2-Clause" license-file: LICENSE diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h index 09316d20c209..048e7639525d 100644 --- a/modules/fdlibm/src/fdlibm.h +++ b/modules/fdlibm/src/fdlibm.h @@ -15,10 +15,14 @@ */ #ifndef mozilla_imported_fdlibm_h -#define mozilla_imported_fdlibm_h +#define mozilla_imported_fdlibm_h namespace fdlibm { +#ifndef M_PI_2 +#define M_PI_2 1.57079632679489661923 /* pi/2 */ +#endif + double acos(double); double asin(double); double atan(double); @@ -45,6 +49,7 @@ double acosh(double); double asinh(double); double atanh(double); double cbrt(double); +double exp2(double); double expm1(double); double hypot(double, double); double log1p(double); @@ -54,13 +59,26 @@ double copysign(double, double); double nearbyint(double); double scalbn(double, int); double trunc(double); +float acosf(float); +float asinf(float); +float atanf(float); +float cosf(float); +float sinf(float); +float tanf(float); +float exp2f(float); +float expf(float); +float logf(float); +float powf(float, float); +float sqrtf(float); float ceilf(float); +float fabsf(float); float floorf(float); float nearbyintf(float); float rintf(float); +float scalbnf(float, int); float truncf(float); } /* namespace fdlibm */ -#endif /* mozilla_imported_fdlibm_h */ +#endif /* !mozilla_imported_fdlibm_h */ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h index 165260f00f20..f4373f27834a 100644 --- a/modules/fdlibm/src/math_private.h +++ b/modules/fdlibm/src/math_private.h @@ -871,22 +871,34 @@ irintl(long double x) #define __ieee754_scalbf scalbf #define acos fdlibm::acos +#define acosf fdlibm::acosf #define asin fdlibm::asin +#define asinf fdlibm::asinf #define atan fdlibm::atan +#define atanf fdlibm::atanf #define atan2 fdlibm::atan2 #define cos fdlibm::cos +#define cosf fdlibm::cosf #define sin fdlibm::sin +#define sinf fdlibm::sinf #define tan fdlibm::tan +#define tanf fdlibm::tanf #define cosh fdlibm::cosh #define sinh fdlibm::sinh #define tanh fdlibm::tanh #define exp fdlibm::exp +#define expf fdlibm::expf +#define exp2 fdlibm::exp2 +#define exp2f fdlibm::exp2f #define log fdlibm::log +#define logf fdlibm::logf #define log10 fdlibm::log10 #define pow fdlibm::pow +#define powf fdlibm::powf #define ceil fdlibm::ceil #define ceilf fdlibm::ceilf #define fabs fdlibm::fabs +#define fabsf fdlibm::fabsf #define floor fdlibm::floor #define acosh fdlibm::acosh #define asinh fdlibm::asinh @@ -899,6 +911,7 @@ irintl(long double x) #define scalb fdlibm::scalb #define copysign fdlibm::copysign #define scalbn fdlibm::scalbn +#define scalbnf fdlibm::scalbnf #define trunc fdlibm::trunc #define truncf fdlibm::truncf #define floorf fdlibm::floorf @@ -906,6 +919,7 @@ irintl(long double x) #define nearbyintf fdlibm::nearbyintf #define rint fdlibm::rint #define rintf fdlibm::rintf +#define sqrtf fdlibm::sqrtf /* fdlibm kernel function */ int __kernel_rem_pio2(double*,double*,int,int,int);