1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-11-15 15:21:18 +03:00

m68k: Remove SVID error handling on fmod

The m68k provided an optimized version through __m81_u(fmod)
(mathimpl.h), and gcc does not implement it through a builtin
(different than i386).

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
This commit is contained in:
Adhemerval Zanella
2025-10-08 10:55:05 -03:00
parent b19904cfb2
commit 6deadd4eb6
3 changed files with 22 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
libm {
GLIBC_2.43 {
# No SVID compatible error handling.
fmodf;
fmodf; fmod;
}
}

View File

@@ -15,24 +15,27 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
#include <math.h>
#include <math_private.h>
#include "mathimpl.h"
#include <libm-alias-double.h>
#include <libm-alias-finite.h>
#include <math.h>
#include "mathimpl.h"
#include "math_config.h"
#ifndef FUNC
# define FUNC __ieee754_fmod
# define FUNC_FINITE __fmod
#endif
#ifndef float_type
# define float_type double
#endif
float_type
FUNC (float_type x, float_type y)
double
__fmod (double x, double y)
{
return __m81_u(FUNC)(x, y);
uint64_t hx = asuint64 (x);
uint64_t hy = asuint64 (y);
/* fmod(+-Inf,y) or fmod(x,0) */
if (__glibc_unlikely ((is_inf (hx) || y == 0.0)
&& !is_nan (hy)
&& !is_nan (hx)))
return __math_invalid (x);
return __m81_u(fmod)(x, y);
}
#ifdef FUNC_FINITE
libm_alias_finite (FUNC, FUNC_FINITE)
#endif
strong_alias (__fmod, __ieee754_fmod)
libm_alias_finite (__ieee754_fmod, __fmod)
versioned_symbol (libm, __fmod, fmod, GLIBC_2_43);
libm_alias_double_other (__fmod, fmod)

View File

@@ -986,4 +986,5 @@ GLIBC_2.42 rsqrtf32 F
GLIBC_2.42 rsqrtf32x F
GLIBC_2.42 rsqrtf64 F
GLIBC_2.42 rsqrtl F
GLIBC_2.43 fmod F
GLIBC_2.43 fmodf F