added fpclassifyl
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27272 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7fb33cd07d
commit
9c91170f95
|
@ -104,7 +104,7 @@ extern float log10f(float x);
|
||||||
extern float log1pf(float x);
|
extern float log1pf(float x);
|
||||||
extern float logbf(float x);
|
extern float logbf(float x);
|
||||||
extern float logf(float x);
|
extern float logf(float x);
|
||||||
extern long lroundf(float x);
|
extern long lroundf(float x);
|
||||||
extern float modff(float x, float *y);
|
extern float modff(float x, float *y);
|
||||||
extern float powf(float x, float y);
|
extern float powf(float x, float y);
|
||||||
extern float roundf(float x);
|
extern float roundf(float x);
|
||||||
|
@ -129,9 +129,10 @@ extern double fmod(double x, double y);
|
||||||
extern double frexp(double x, int *_exponent);
|
extern double frexp(double x, int *_exponent);
|
||||||
extern double gamma(double x);
|
extern double gamma(double x);
|
||||||
extern double ldexp(double x, int exponent);
|
extern double ldexp(double x, int exponent);
|
||||||
|
extern double lgamma(double x);
|
||||||
extern double log(double x);
|
extern double log(double x);
|
||||||
extern double log10(double x);
|
extern double log10(double x);
|
||||||
extern long lround(double x);
|
extern long lround(double x);
|
||||||
extern double modf(double x, double *y);
|
extern double modf(double x, double *y);
|
||||||
extern double pow(double x, double y);
|
extern double pow(double x, double y);
|
||||||
extern double round(double x);
|
extern double round(double x);
|
||||||
|
@ -143,12 +144,10 @@ extern double tanh(double x);
|
||||||
extern double trunc(double x);
|
extern double trunc(double x);
|
||||||
|
|
||||||
/* long double math functions */
|
/* long double math functions */
|
||||||
|
extern long double lgammal(long double x);
|
||||||
extern long double roundl(long double x);
|
extern long double roundl(long double x);
|
||||||
extern long lroundl(long double x);
|
extern long lroundl(long double x);
|
||||||
|
|
||||||
/* TODO: add and fix those! */
|
|
||||||
extern /*long*/ double lgamma(/*long*/ double x);
|
|
||||||
|
|
||||||
/* some BSD non-ANSI or POSIX math functions */
|
/* some BSD non-ANSI or POSIX math functions */
|
||||||
extern double acosh(double x);
|
extern double acosh(double x);
|
||||||
extern double asinh(double x);
|
extern double asinh(double x);
|
||||||
|
|
|
@ -141,6 +141,7 @@ MergeObject posix_gnu_arch_$(TARGET_ARCH)_other.o :
|
||||||
e_sqrt.c e_sqrtf.c # e_sqrtl.c
|
e_sqrt.c e_sqrtf.c # e_sqrtl.c
|
||||||
# s_fdim.c s_fdimf.c # s_fdiml.S
|
# s_fdim.c s_fdimf.c # s_fdiml.S
|
||||||
# s_fabs.S s_fabsf.S # s_fabsl.S
|
# s_fabs.S s_fabsf.S # s_fabsl.S
|
||||||
|
s_fpclassifyl.c
|
||||||
# s_isnan.c s_isnanf.S
|
# s_isnan.c s_isnanf.S
|
||||||
s_rint.c s_rintf.c # s_rintl.c
|
s_rint.c s_rintf.c # s_rintl.c
|
||||||
# t_sqrt.c
|
# t_sqrt.c
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
/* Return classification value corresponding to argument. m68k version.
|
||||||
|
Copyright (C) 1997, 2001, 2002 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
Fixed for m68k by Andreas Schwab <schwab@suse.de>.
|
||||||
|
|
||||||
|
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, write to the Free
|
||||||
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
|
02111-1307 USA. */
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "math_private.h"
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
__fpclassifyl (long double x)
|
||||||
|
{
|
||||||
|
u_int32_t ex, hx, lx;
|
||||||
|
int retval = FP_NORMAL;
|
||||||
|
|
||||||
|
GET_LDOUBLE_WORDS (ex, hx, lx, x);
|
||||||
|
ex &= 0x7fff;
|
||||||
|
if ((ex | hx | lx) == 0)
|
||||||
|
retval = FP_ZERO;
|
||||||
|
else if (ex == 0 && (hx & 0x80000000) == 0)
|
||||||
|
retval = FP_SUBNORMAL;
|
||||||
|
else if (ex == 0x7fff)
|
||||||
|
retval = ((hx & 0x7fffffff) | lx) != 0 ? FP_NAN : FP_INFINITE;
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
libm_hidden_def (__fpclassifyl)
|
|
@ -144,6 +144,7 @@ MergeObject posix_gnu_arch_$(TARGET_ARCH)_s.o :
|
||||||
s_fabs.S s_fabsf.S s_fabsl.S
|
s_fabs.S s_fabsf.S s_fabsl.S
|
||||||
s_finite.S s_finitef.S s_finitel.S
|
s_finite.S s_finitef.S s_finitel.S
|
||||||
s_floor.S s_floorf.S s_floorl.S
|
s_floor.S s_floorf.S s_floorl.S
|
||||||
|
s_fpclassifyl.c
|
||||||
s_frexp.S s_frexpf.S s_frexpl.S
|
s_frexp.S s_frexpf.S s_frexpl.S
|
||||||
s_ilogb.S s_ilogbf.S
|
s_ilogb.S s_ilogbf.S
|
||||||
s_isinfl.c
|
s_isinfl.c
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
/* Return classification value corresponding to argument.
|
||||||
|
Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
|
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, write to the Free
|
||||||
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
|
02111-1307 USA. */
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "math_private.h"
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
__fpclassifyl (long double x)
|
||||||
|
{
|
||||||
|
u_int32_t ex, hx, lx;
|
||||||
|
int retval = FP_NORMAL;
|
||||||
|
|
||||||
|
GET_LDOUBLE_WORDS (ex, hx, lx, x);
|
||||||
|
ex &= 0x7fff;
|
||||||
|
if ((ex | lx | hx) == 0)
|
||||||
|
retval = FP_ZERO;
|
||||||
|
else if (ex == 0 && (hx & 0x80000000) == 0)
|
||||||
|
retval = FP_SUBNORMAL;
|
||||||
|
else if (ex == 0x7fff)
|
||||||
|
retval = ((hx & 0x7fffffff) | lx) != 0 ? FP_NAN : FP_INFINITE;
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
libm_hidden_def (__fpclassifyl)
|
Loading…
Reference in New Issue