mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 12:30:06 +00:00
math: Remove bogus math implementations
The exp10, exp10l, fma, fmaf, and fmal default implementation do not implement the appropriate semantics nor with an reasonable accuracy. They are also not used by any supported port.
This commit is contained in:
parent
42cc619dfb
commit
9c61303ebb
@ -1,33 +0,0 @@
|
||||
/* Copyright (C) 1998-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
#include <float.h>
|
||||
#include <libm-alias-finite.h>
|
||||
|
||||
double
|
||||
__ieee754_exp10 (double arg)
|
||||
{
|
||||
if (isfinite (arg) && arg < DBL_MIN_10_EXP - DBL_DIG - 10)
|
||||
return DBL_MIN * DBL_MIN;
|
||||
else
|
||||
/* This is a very stupid and inprecise implementation. It'll get
|
||||
replaced sometime (soon?). */
|
||||
return __ieee754_exp (M_LN10 * arg);
|
||||
}
|
||||
libm_alias_finite (__ieee754_exp10, __exp10)
|
@ -1,33 +0,0 @@
|
||||
/* Copyright (C) 1998-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
#include <float.h>
|
||||
#include <libm-alias-finite.h>
|
||||
|
||||
long double
|
||||
__ieee754_exp10l (long double arg)
|
||||
{
|
||||
if (isfinite (arg) && arg < LDBL_MIN_10_EXP - LDBL_DIG - 10)
|
||||
return LDBL_MIN * LDBL_MIN;
|
||||
else
|
||||
/* This is a very stupid and inprecise implementation. It'll get
|
||||
replaced sometime (soon?). */
|
||||
return __ieee754_expl (M_LN10l * arg);
|
||||
}
|
||||
libm_alias_finite (__ieee754_exp10, __exp10)
|
36
math/s_fma.c
36
math/s_fma.c
@ -1,36 +0,0 @@
|
||||
/* Compute x * y + z as ternary operation.
|
||||
Copyright (C) 1997-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define NO_MATH_REDIRECT
|
||||
#define dfmal __hide_dfmal
|
||||
#define f32xfmaf64 __hide_f32xfmaf64
|
||||
#include <math.h>
|
||||
#undef dfmal
|
||||
#undef f32xfmaf64
|
||||
#include <libm-alias-double.h>
|
||||
#include <math-narrow-alias.h>
|
||||
|
||||
double
|
||||
__fma (double x, double y, double z)
|
||||
{
|
||||
return (x * y) + z;
|
||||
}
|
||||
#ifndef __fma
|
||||
libm_alias_double (__fma, fma)
|
||||
libm_alias_double_narrow (__fma, fma)
|
||||
#endif
|
@ -1,30 +0,0 @@
|
||||
/* Compute x * y + z as ternary operation.
|
||||
Copyright (C) 1997-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define NO_MATH_REDIRECT
|
||||
#include <math.h>
|
||||
#include <libm-alias-float.h>
|
||||
|
||||
float
|
||||
__fmaf (float x, float y, float z)
|
||||
{
|
||||
return (x * y) + z;
|
||||
}
|
||||
#ifndef __fmaf
|
||||
libm_alias_float (__fma, fma)
|
||||
#endif
|
@ -1,32 +0,0 @@
|
||||
/* Compute x * y + z as ternary operation.
|
||||
Copyright (C) 1997-2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define NO_MATH_REDIRECT
|
||||
#define f64xfmaf128 __hide_f64xfmaf128
|
||||
#include <math.h>
|
||||
#undef f64xfmaf128
|
||||
#include <libm-alias-ldouble.h>
|
||||
#include <math-narrow-alias.h>
|
||||
|
||||
long double
|
||||
__fmal (long double x, long double y, long double z)
|
||||
{
|
||||
return (x * y) + z;
|
||||
}
|
||||
libm_alias_ldouble (__fma, fma)
|
||||
libm_alias_ldouble_narrow (__fma, fma)
|
Loading…
Reference in New Issue
Block a user