Commit Graph

27 Commits

Author SHA1 Message Date
David Schultz
c4691a5da9 Remove i387 versions of asin() and acos(). Although the hardware
instruction was faster on the 486, it's slower than our MD version on
modern processors.

Determined by:	bde
PR:		67469
2005-02-20 22:51:08 +00:00
David Schultz
dab1571b90 Remove the float versions of the i387 trig functions obtained from
NetBSD.  They're buggy, giving particularly for inputs larger in
magnitude than 2**63.

Noticed by:	bde
PR:		67469
2005-02-20 22:50:40 +00:00
David Schultz
79b990338f Move machine-dependent crud to its own makefile. 2005-02-04 14:33:39 +00:00
David Schultz
e1b61b5b93 Remove wrappers and other cruft intended to support SVID, mistakes in
C90, and other arcana.  Most of these features were never fully
supported or enabled by default.

Ok:	bde, stefanf
2005-02-04 14:08:32 +00:00
David Schultz
f365db00e5 Mark all inline asms that read the floating-point control or status
registers as volatile.  Instructions that *wrote* to FP state were
already marked volatile, but apparently gcc has license to move
non-volatile asms past volatile asms.  This broke amd64's feupdateenv
at -O2 due to a WAR conflict between fnstsw and fldenv there.
2005-01-14 07:09:23 +00:00
David Schultz
fe69257da2 Import the subset of J.T. Conklin's single-precision x86-optimized
math routines that appear to be (a) correct and (b) faster than their
MI counterparts on my Pentium 4.

Obtained from:	NetBSD
2005-01-13 18:58:25 +00:00
David Schultz
3cdb8115d7 Things that are broken, unneeded, and unused since 1997 belong in the attic. 2005-01-13 15:43:22 +00:00
David Schultz
439e59cf85 Faster lrint() and llrint() implementations for x86. 2005-01-11 23:10:53 +00:00
Stefan Farfeleder
c8764bba5a Completely remove s_ilogb.S as the assembler implementation gives very little
speed improvement to none at all over the MI version.

Submitted by:	bde
2004-06-20 10:42:23 +00:00
Stefan Farfeleder
b6161bb16a Return the same result as the MI version for 0.0, INFINITY and NaN.
Reviewed by:	standards@
2004-06-19 09:30:00 +00:00
David Schultz
0b71a226d1 Add an fenv.h implementation for the i386 port.
Reviewed by:	standards@
2004-06-06 10:04:17 +00:00
Bruce Evans
46d31a8b36 Removed bogus 'l' suffixes in FP register to register instructions. 2000-06-06 12:12:36 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Bruce Evans
9970814b3e Fixed wrong mnemonic `setnel' that gas happened to generate correct object
code for.

Obtained from:	a slightly different fix in NetBSD
1997-04-30 20:37:52 +00:00
Bruce Evans
6b04d9918b Include <machine/asm.h> instead of kernel-only <machine/asmacros.h>. 1997-03-09 14:01:11 +00:00
Peter Wemm
7e546392b5 Revert $FreeBSD$ to $Id$ 1997-02-22 15:12:41 +00:00
Bruce Evans
487ddb8fa4 Compute (1 - x^2) as ((1 - x) * (1 + x)) instead of as (1 - x * x) to
avoid easily avoidable loss of precision when |x| is nearly 1.

Extended (64-bit) precision only moves the meaning of "nearly" here.

This probably could be done better by splitting up the range into
|x| <= 0.5 and |x| > 0.5 like the C version.  However, ucbtest
does't report any errors in this version.  Perhaps the C version
should be used anyway.  It's only 25% slower now on a P5, provided
the C version of sqrt() isn't used, and the C version could be
optimized better.

Errors checked by:	ucbtest
1997-02-20 12:37:49 +00:00
Bruce Evans
72d8d94d6f Fixed the i87 version of exp(). It returned NaN for args +-Inf. It had
some small (one or two ULP) inaccuracies.

Found by:	ucbtest
1997-02-16 17:38:11 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Bruce Evans
c5dd403925 Fixed fiddling with the control word. Use the stack space reserved for
that purpose instead of space below the stack.
1996-12-14 16:43:53 +00:00
Bruce Evans
aa9a769760 Clean up the FPU stack before returning. One stack slot was leaked on
every call.  The damage was sometimes limited by other routines using
and freeing stack slots that should have been empty to being with.
1996-12-14 16:24:42 +00:00
Bruce Evans
f05bebb3ad Clean up the FP stack before returning. The i387 exp() leaked an FP
register on its first call.  Subsequent calls reused the register so
the leak didn't accumulate.  Fixes PR 1275.
1996-06-01 18:00:07 +00:00
Bruce Evans
40b83e34a7 Don't trash %ebp.
Obtained from: NetBSD
1996-02-25 20:29:46 +00:00
Jordan K. Hubbard
e2014c1dcb Latest fix from jtc:
The fyl2xp1 instruction has such a limited range:
   -(1 - (sqrt(2) / 2)) <= x <= sqrt(2) - 1
it's not worth trying to use it.

Also, I'm not sure fyl2xp1's extra precision will
matter once the result is converted from extended
real (80 bits) back to double real (64 bits).

Reviewed by:	jkh
Submitted by:	jtc
1994-08-19 23:52:29 +00:00
Jordan K. Hubbard
ec8cc6082c Do all the includes: <machine/asm.h> -> <machine/asmacros.h>
Reviewed by:
Submitted by:
1994-08-19 11:14:32 +00:00
Jordan K. Hubbard
2a3617d129 Change includes to reference <machine/asmacros.h>.
Submitted by:	jkh
1994-08-19 11:12:52 +00:00
Jordan K. Hubbard
3a8617a83f J.T. Conklin's latest version of the Sun math library.
-- Begin comments from J.T. Conklin:
The most significant improvement is the addition of "float" versions
of the math functions that take float arguments, return floats, and do
all operations in floating point.  This doesn't help (performance)
much on the i386, but they are still nice to have.

The float versions were orginally done by Cygnus' Ian Taylor when
fdlibm was integrated into the libm we support for embedded systems.
I gave Ian a copy of my libm as a starting point since I had already
fixed a lot of bugs & problems in Sun's original code.  After he was
done, I cleaned it up a bit and integrated the changes back into my
libm.
-- End comments

Reviewed by:	jkh
Submitted by:	jtc
1994-08-19 09:40:01 +00:00