From 022e1aa7670264f520137fa8e41a83a257364f0a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 12 Jul 2022 17:01:46 -0700 Subject: [PATCH] Sync libm with upstream freebsd. This is a complete update. Test: treehugger Change-Id: I91cc4d57ea49b46b607fde8fa30e2e04ecc9e690 --- libm/upstream-freebsd/lib/msun/src/math_private.h | 8 ++++---- libm/upstream-freebsd/lib/msun/src/w_cabsf.c | 3 +-- libm/upstream-freebsd/lib/msun/src/w_drem.c | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libm/upstream-freebsd/lib/msun/src/math_private.h b/libm/upstream-freebsd/lib/msun/src/math_private.h index b91b54cea..df526e71e 100644 --- a/libm/upstream-freebsd/lib/msun/src/math_private.h +++ b/libm/upstream-freebsd/lib/msun/src/math_private.h @@ -460,7 +460,7 @@ do { \ * or by having |c| a few percent smaller than |a|. Pre-normalization of * (a, b) may help. * - * This is is a variant of an algorithm of Kahan (see Knuth (1981) 4.2.2 + * This is a variant of an algorithm of Kahan (see Knuth (1981) 4.2.2 * exercise 19). We gain considerable efficiency by requiring the terms to * be sufficiently normalized and sufficiently increasing. */ @@ -644,7 +644,7 @@ rnintl(long double x) * return type provided their arg is a floating point integer. They can * sometimes be more efficient because no rounding is required. */ -#if (defined(amd64) || defined(__i386__)) && defined(__GNUCLIKE_ASM) +#if defined(amd64) || defined(__i386__) #define irint(x) \ (sizeof(x) == sizeof(float) && \ sizeof(__float_t) == sizeof(long double) ? irintf(x) : \ @@ -657,7 +657,7 @@ rnintl(long double x) #define i64rint(x) ((int64_t)(x)) /* only needed for ld128 so not opt. */ -#if defined(__i386__) && defined(__GNUCLIKE_ASM) +#if defined(__i386__) static __inline int irintf(float x) { @@ -677,7 +677,7 @@ irintd(double x) } #endif -#if (defined(__amd64__) || defined(__i386__)) && defined(__GNUCLIKE_ASM) +#if defined(__amd64__) || defined(__i386__) static __inline int irintl(long double x) { diff --git a/libm/upstream-freebsd/lib/msun/src/w_cabsf.c b/libm/upstream-freebsd/lib/msun/src/w_cabsf.c index e7bfe220a..b5065c8a5 100644 --- a/libm/upstream-freebsd/lib/msun/src/w_cabsf.c +++ b/libm/upstream-freebsd/lib/msun/src/w_cabsf.c @@ -15,8 +15,7 @@ static const char rcsid[] = #include "math_private.h" float -cabsf(z) - float complex z; +cabsf(float complex z) { return hypotf(crealf(z), cimagf(z)); diff --git a/libm/upstream-freebsd/lib/msun/src/w_drem.c b/libm/upstream-freebsd/lib/msun/src/w_drem.c index 0f6840934..74008a5c8 100644 --- a/libm/upstream-freebsd/lib/msun/src/w_drem.c +++ b/libm/upstream-freebsd/lib/msun/src/w_drem.c @@ -8,8 +8,7 @@ #include double -drem(x, y) - double x, y; +drem(double x, double y) { return remainder(x, y); }