Complete action from 2001-12-18:

* libc/machine/i386/f_*: Remove duplicate files.
This commit is contained in:
Corinna Vinschen 2015-01-23 10:16:00 +00:00
parent 5ae2368e92
commit 2ee3908b45
18 changed files with 5 additions and 697 deletions

View file

@ -1,3 +1,8 @@
2015-01-23 Corinna Vinschen <vinschen@redhat.com>
Complete action from 2001-12-18:
* libc/machine/i386/f_*: Remove duplicate files.
2015-01-22 Yaakov Selkowitz <yselkowi@redhat.com>
* libc/sys/sparc64/sys/time.h: #include <sys/types.h> for time_t.

View file

@ -1,37 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of atan2 using Intel float instructions.
double _f_atan2 (double y, double x);
Function computes arctan ( y / x ).
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_atan2)
SOTYPE_FUNCTION(_f_atan2)
SYM (_f_atan2):
pushl ebp
movl esp,ebp
fldl 8(ebp)
fldl 16(ebp)
fpatan
leave
ret
#endif

View file

@ -1,37 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of atan2f using Intel float instructions.
float _f_atan2f (float y, float x);
Function computes arctan ( y / x ).
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_atan2f)
SOTYPE_FUNCTION(_f_atan2f)
SYM (_f_atan2f):
pushl ebp
movl esp,ebp
flds 8(ebp)
flds 12(ebp)
fpatan
leave
ret
#endif

View file

@ -1,47 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998,2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of exp using Intel float instructions.
double _f_exp (double x);
Function computes e ** x. The following special cases exist:
1. if x is 0.0 ==> return 1.0
2. if x is infinity ==> return infinity
3. if x is -infinity ==> return 0.0
4. if x is NaN ==> return x
There is no error checking or setting of errno.
*/
#include <math.h>
#include <ieeefp.h>
#include "f_math.h"
double _f_exp (double x)
{
if (check_finite(x))
{
double result;
asm ("fldl2e; fmulp; fld %%st; frndint; fsub %%st,%%st(1); fxch;" \
"fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1); fmulp" :
"=t"(result) : "0"(x));
return result;
}
else if (x == -infinity())
return 0.0;
return x;
}
#endif

View file

@ -1,47 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of exp using Intel float instructions.
float _f_expf (float x);
Function computes e ** x. The following special cases exist:
1. if x is 0.0 ==> return 1.0
2. if x is infinity ==> return infinity
3. if x is -infinity ==> return 0.0
4. if x is NaN ==> return x
There is no error checking or setting of errno.
*/
#include <math.h>
#include <ieeefp.h>
#include "f_math.h"
float _f_expf (float x)
{
if (check_finitef(x))
{
float result;
asm ("fldl2e; fmulp; fld %%st; frndint; fsub %%st,%%st(1); fxch;" \
"fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1); fmulp" :
"=t"(result) : "0"(x));
return result;
}
else if (x == -infinityf())
return 0.0;
return x;
}
#endif

View file

@ -1,48 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of frexp using Intel float instructions.
double _f_frexp (double x, int *exp);
Function splits x into y * 2 ** z. It then
returns the value of y and updates *exp with z.
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_frexp)
SOTYPE_FUNCTION(_f_frexp)
SYM (_f_frexp):
pushl ebp
movl esp,ebp
fldl 8(ebp)
movl 16(ebp),eax
fxtract
fld1
fchs
fxch
fscale
fstp st1
fxch
fld1
faddp
fistpl 0(eax)
leave
ret
#endif

View file

@ -1,48 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of frexpf using Intel float instructions.
float _f_frexpf (float x, int *exp);
Function splits x into y * 2 ** z. It then
returns the value of y and updates *exp with z.
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_frexpf)
SOTYPE_FUNCTION(_f_frexpf)
SYM (_f_frexpf):
pushl ebp
movl esp,ebp
flds 8(ebp)
movl 12(ebp),eax
fxtract
fld1
fchs
fxch
fscale
fstp st1
fxch
fld1
faddp
fistpl 0(eax)
leave
ret
#endif

View file

@ -1,38 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of ldexp using Intel float instructions.
double _f_ldexp (double x, int exp);
Function calculates x * 2 ** exp.
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_ldexp)
SOTYPE_FUNCTION(_f_ldexp)
SYM (_f_ldexp):
pushl ebp
movl esp,ebp
fild 16(ebp)
fldl 8(ebp)
fscale
fstp st1
leave
ret
#endif

View file

@ -1,38 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of ldexpf using Intel float instructions.
float _f_ldexpf (float x, int exp);
Function calculates x * 2 ** exp.
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_ldexpf)
SOTYPE_FUNCTION(_f_ldexpf)
SYM (_f_ldexpf):
pushl ebp
movl esp,ebp
fild 12(ebp)
flds 8(ebp)
fscale
fstp st1
leave
ret
#endif

View file

@ -1,40 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of log using Intel float instructions.
double _f_log (double x);
Function calculates the log base e of x.
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_log)
SOTYPE_FUNCTION(_f_log)
SYM (_f_log):
pushl ebp
movl esp,ebp
fld1
fldl2e
fdivrp
fldl 8(ebp)
fyl2x
leave
ret
#endif

View file

@ -1,40 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of log10 using Intel float instructions.
double _f_log10 (double x);
Function calculates the log base 10 of x.
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_log10)
SOTYPE_FUNCTION(_f_log10)
SYM (_f_log10):
pushl ebp
movl esp,ebp
fld1
fldl2t
fdivrp
fldl 8(ebp)
fyl2x
leave
ret
#endif

View file

@ -1,40 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of logf using Intel float instructions.
float _f_log10f (float x);
Function calculates the log base 10 of x.
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_log10f)
SOTYPE_FUNCTION(_f_log10f)
SYM (_f_log10f):
pushl ebp
movl esp,ebp
fld1
fldl2t
fdivrp
flds 8(ebp)
fyl2x
leave
ret
#endif

View file

@ -1,40 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of logf using Intel float instructions.
float _f_logf (float x);
Function calculates the log base e of x.
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_logf)
SOTYPE_FUNCTION(_f_logf)
SYM (_f_logf):
pushl ebp
movl esp,ebp
fld1
fldl2e
fdivrp
flds 8(ebp)
fyl2x
leave
ret
#endif

View file

@ -1,29 +0,0 @@
#ifndef __F_MATH_H__
#define __F_MATH_H__
#include <_ansi.h>
#include "fdlibm.h"
__inline__
static
int
_DEFUN (check_finite, (x),
double x)
{
__int32_t hx;
GET_HIGH_WORD(hx,x);
return (int)((__uint32_t)((hx&0x7fffffff)-0x7ff00000)>>31);
}
__inline__
static
int
_DEFUN (check_finitef, (x),
float x)
{
__int32_t ix;
GET_FLOAT_WORD(ix,x);
return (int)((__uint32_t)((ix&0x7fffffff)-0x7f800000)>>31);
}
#endif /* __F_MATH_H__ */

View file

@ -1,47 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of pow using Intel float instructions.
double _f_pow (double x, double y);
Function calculates x to power of y.
The function optimizes the case where x is >0.0 and y is finite.
In such a case, there is no error checking or setting of errno.
All other cases defer to normal pow() function which will
set errno as normal.
*/
#include <math.h>
#include <ieeefp.h>
#include "f_math.h"
double _f_pow (double x, double y)
{
/* following sequence handles the majority of cases for pow() */
if (x > 0.0 && check_finite(y))
{
double result;
/* calculate x ** y as 2 ** (y log2(x)). On Intel, can only
raise 2 to an integer or a small fraction, thus, we have
to perform two steps 2**integer portion * 2**fraction. */
asm ("fldl 8(%%ebp); fyl2x; fld %%st; frndint; fsub %%st,%%st(1);" \
"fxch; fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1);"\
"fmulp" : "=t" (result) : "0" (y));
return result;
}
else /* all other strange cases, defer to normal pow() */
return pow (x,y);
}
#endif

View file

@ -1,47 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of pow using Intel float instructions.
float _f_powf (float x, float y);
Function calculates x to power of y.
The function optimizes the case where x is >0.0 and y is finite.
In such a case, there is no error checking or setting of errno.
All other cases defer to normal powf() function which will
set errno as normal.
*/
#include <math.h>
#include <ieeefp.h>
#include "f_math.h"
float _f_powf (float x, float y)
{
/* following sequence handles the majority of cases for pow() */
if (x > 0.0 && check_finitef(y))
{
float result;
/* calculate x ** y as 2 ** (y log2(x)). On Intel, can only
raise 2 to an integer or a small fraction, thus, we have
to perform two steps 2**integer portion * 2**fraction. */
asm ("flds 8(%%ebp); fyl2x; fld %%st; frndint; fsub %%st,%%st(1);" \
"fxch; fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1);"\
"fmulp" : "=t" (result) : "0" (y));
return result;
}
else /* all other strange cases, defer to normal pow() */
return powf (x,y);
}
#endif

View file

@ -1,37 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of tan using Intel float instructions.
double _f_tan (double x);
Function calculates the tangent of x.
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_tan)
SOTYPE_FUNCTION(_f_tan)
SYM (_f_tan):
pushl ebp
movl esp,ebp
fldl 8(ebp)
fptan
fincstp
leave
ret
#endif

View file

@ -1,37 +0,0 @@
/*
* ====================================================
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if !defined(_SOFT_FLOAT)
/*
Fast version of tanf using Intel float instructions.
float _f_tanf (float x);
Function calculates the tangent of x.
There is no error checking or setting of errno.
*/
#include "i386mach.h"
.global SYM (_f_tanf)
SOTYPE_FUNCTION(_f_tanf)
SYM (_f_tanf):
pushl ebp
movl esp,ebp
flds 8(ebp)
fptan
fincstp
leave
ret
#endif