Commit Graph

199 Commits

Author SHA1 Message Date
matt 0d613952ce Fix the strong alias correctly this time. 2013-02-12 02:52:13 +00:00
matt 04ec087c22 Add fma/fmaf/fmal for arm hard float which uses the VFP vmla instruction. 2013-02-11 17:41:13 +00:00
matt 6567e38835 Add VFP versions of lrint/lrintf/lrintl for earmhf* 2013-02-11 12:43:03 +00:00
matt bec7d6b6c4 Fix strong_alias 2013-02-11 04:57:22 +00:00
christos 3884ecde09 provide ldexpl 2013-02-11 02:45:15 +00:00
matt 3a4e9cb991 Add long double version of x86 scalb functions 2013-02-11 01:19:33 +00:00
matt c31c561dde Add support for the ARM hardfloat instructions vsqrt and vabs. 2013-02-03 07:13:07 +00:00
riastradh 3a4a1ac26a Mask off the result of feenableexcept and fedisableexcept on x86.
These shouldn't return bits outside FE_ALL_EXCEPT.
2012-08-04 03:53:55 +00:00
joerg cee5599b68 Add logbl(3). 2011-08-03 14:13:07 +00:00
joerg 5ccaf4b804 Add ilogbl(3). 2011-07-28 22:32:28 +00:00
matt ad1826f0ba Add scalbn{,f,l} for VAX. 2011-07-28 20:53:20 +00:00
joerg 37ef12d394 Add optimised version of scalbnl for x86. 2011-07-26 17:03:23 +00:00
joerg e060a1ff71 Actually used SSE branch. Noticed by enami@ 2011-06-21 21:52:49 +00:00
joerg 17f4d79daf Use correct stack register as noticed by christos 2011-06-18 22:19:52 +00:00
joerg 7d48645456 Kill redundant ; 2011-06-18 21:24:51 +00:00
joerg 658a2a5f07 Switch to SSE code, since our gas supports it now. 2011-06-18 20:49:26 +00:00
joerg 47980a5652 SSE2 registers are only used for float and double arguments, so update
comment to reflect reality. Add some accessor macros for long double
arguments for i386 and x86_64.
2011-06-18 18:16:40 +00:00
nakayama 88e42b609b Add fenv support for sparc. Mostly copied from sparc64 and share with it. 2011-05-20 21:42:48 +00:00
christos 17b8402a39 fenv support for sparc64 from Stathis Kamperis 2011-01-31 00:19:33 +00:00
taca 5dad8344cc Fix compile error. 2010-08-01 06:34:38 +00:00
joerg c271d4f25f Fix merge error: drop machine from an older workaround for machine.sse
under compat32, drop the assertion, initialize oldlen.
2010-07-31 22:14:18 +00:00
joerg 7f1183f226 Add support for fenv.h interface for i386 and amd64.
Submitted by Stathis Kamperis as part of GSoC 2010 and ported from
FreeBSD.
2010-07-31 21:47:52 +00:00
drochner d4def06880 -build ldexp/frexp/modf locally again rather than relying on libc
reaching over, to get things into a sane state,
-do the usual namespace protection game with scalbn(f) because it
 is used internally
(more symbol renamings are necessary)

The weak_alias change for mc68881 is untested.
2010-04-23 19:17:07 +00:00
phx 7377320537 Jump through the PLT in PIC mode to fix the DT_TEXTREL warning on creating
the shared object.
2010-01-06 14:10:57 +00:00
is c4a186ea1c Move to two-clause license. 2009-11-09 15:35:27 +00:00
drochner 39ba286079 as in exp(), treat +/-Inf and NaN arguments specially, should fix
eg expf(-Inf) which was Nan previously
(We could avoid touching the i387 on amd64 in these cases, but we'd
need to bypass the ABI abstraction macros, so leave it the old way
for now.)
2008-06-24 17:27:56 +00:00
drochner bc43bac5ca -fix an obvious mistake in fpcw check
-replace ARG_DOUBLE_ONE_HALF by _MSW/_LSW because this reflects the
 intention and also matches the terms used in C code,
 also make the code where the fpcw overwrites the argument a bit
 self-documenting
 (this abstraction sucks because it forces to write inefficient code)
2008-06-23 10:24:13 +00:00
christos 1d1021c331 add macros for the upper half of the double arguments. 2008-06-23 00:14:46 +00:00
christos 8a9e7b0124 Share the amd64 and i386 exp versions. Fixes a problem with exp(-Inf) != 0. 2008-06-23 00:12:04 +00:00
ad 6e5329fd40 Use a dummy assembly file so we won't try produce lint stuff. 2008-06-06 13:35:06 +00:00
ad 61464a76be Forgot to add this yesterday. 2008-06-04 14:59:39 +00:00
ad 1b74c9b77c - Fold libm387 into libm.
- Leave libm387 as an empty shell.
2008-06-03 18:47:28 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos 98e7e8e9f7 avoid shadow variables, and enable lint. 2008-04-25 22:21:53 +00:00
mhitch f8f1643217 Fix weak alias. 2008-03-20 18:49:39 +00:00
mhitch 83e4fa69d9 Add wrappers for missing coshf(), expf(), logf(), sinhf(), atan2f(), and
hypotf() functions for vax.  Play the namespace and weak alias game for
functions used internally by the complex functions.  Should fix the vax
build of libm.
2008-03-20 16:41:26 +00:00
matt ec31ca5aa4 Mark some internal libm symbols as hidden 2007-04-19 00:37:20 +00:00
matt ae3ada32fe Make the internal __libm_dsqrt_r6 have a fake entry mask of 0 to make
ld.elf_so.
2007-04-18 04:46:13 +00:00
drochner b0f21ee1ea merge libc/arch/{i386,x86_64}/gen/modf.S into one
(not quite a merge actually, just an #ifdef for now)
and build it in the i386 case (amd64 should work, just needs to be tested)
That way, a program linking against libm should get the optimized
version as expected.
2006-03-22 20:45:58 +00:00
drochner 0e514dc492 The second argument is not a float, so the "abi.h" abstraction
doesn't work.
Open-code the argument handling instead.
Should fix the ldexp() bug reported by Brendon Costa in port-amd64.
2006-03-21 11:35:21 +00:00
is 42796049d0 C versions of non-IEEE round() / roundf(). Alas, using the VAX
cvtrdl; cvtld doesn't work for big numbers.
2006-01-17 13:16:08 +00:00
is e08ae477d9 Oops - round() is supposed to return double, not integer. 2006-01-17 10:39:23 +00:00
is 5703e44cdb Implement round(3), so that jot(1) can link again. 2006-01-15 12:39:44 +00:00
drochner 7ad8526195 activate e_atan2f.S which was there forever but not built, noticed
by Joerg Sonnenberger
2005-07-28 17:55:19 +00:00
rpaulo fcfde3ffb8 Bump minor version for log2{,f}. 2005-07-21 22:49:16 +00:00
rpaulo 1185f13617 Add i387 FPU routines for log2(3) and log2f(3).
ok christos@
2005-07-21 20:58:21 +00:00
drochner b774d2ae7d add licenses 2004-10-13 15:18:31 +00:00
drochner c351eda960 amd64: stack sanity, leave the return PC alone 2004-07-16 18:40:24 +00:00
drochner 3e7f9e1481 allocate stack space for temporary storage 2004-07-02 10:17:23 +00:00
drochner 07be12b505 also provide an alpha assembler implemtation of lrint() 2004-07-01 19:08:21 +00:00
drochner af7cf00a5a provide an assembler implementation of lrint() for i386 and amd64 2004-07-01 17:30:48 +00:00
mhitch a6d522d13c Add ceilf(), floorf(), and sqrtf() (as wrappers using ceil(), floor(), and
sqrt() repectively).  The fixes PR#22796.
2004-05-13 20:35:40 +00:00
wiz 848e689872 Typo fix, from skrueger at europe com. 2004-03-22 13:41:09 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00
wennmach be03f9bd59 Avoid the PIC dance. 2003-09-16 18:17:11 +00:00
fvdl 8eb02ce5c0 Make log1p and log1pf work in shared libraries again. 2003-09-14 21:26:14 +00:00
wennmach cf92bf760d Reimplement s_log1p.S and s_log1pf.S to use the fyl2xp1 instruction
where necessary.

The log1p() function is provided to compute an accurate value of
log(1 + x), even for tiny values of x. The i387 FPU provides the
fyl2xp1 instruction for this purpose.

However, since the range of the fyl2xp1 function is limited to
-(1 - (sqrt(2) / 2)) <= x <= sqrt(2) - 1
          (-0.292893 <= x <= 0.414214)
we need to check if the argument is in the valid range.

In order to reduce the cost for testing the range, we only use
fyl2xp1 if the argument is in the range
               -0.25 <= x <= 0.25
which can be checked with just one conditional branch.

Fixes PR lib/22599 by Ray Brownrigg.
2003-09-10 16:45:43 +00:00
agc eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
salo 99410184e7 netbsd.org->NetBSD.org 2003-07-26 19:24:24 +00:00
matt 88dc468feb Fix some assembly botches. 2003-02-21 06:40:47 +00:00
lukem ec5dbc56b8 Explicitly move setting of NOxxx and USE_SHLIBDIR to the top of the
Makefile (before including <bsd.own.mk>)
2002-08-19 14:55:14 +00:00
lukem ebb6fc9eb8 Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc).
(Reduces make output by ~ 20%)
2002-08-19 09:41:27 +00:00
matt 778e246527 Add sinf/cosf. 2002-07-14 19:55:24 +00:00
matt 5ac19a376b Add finitef 2002-06-23 21:55:12 +00:00
fvdl 059c5712b9 Fix mistake in previous. 2002-03-30 10:03:44 +00:00
fvdl edcf4b63ed Fix stack usage for temporary storage. From Stephen Ma in PR xsrc/15404. 2002-03-26 15:17:37 +00:00
christos 47c5991d7a PR/15748: Ray Brownrigg: exp(log(0)) is broken.
Use FreeBSD's version. Handles inf/nan and rounding modes.
2002-02-27 16:32:46 +00:00
matt 0ce5ca145f Change to use a register prefix. 2002-02-24 01:06:18 +00:00
matt d9dae701a5 Don't bsbb to an external symbol. the dynamic linker won't like it. 2002-02-21 07:49:55 +00:00
lukem efcc9a4c9d * Add user-controlled mk.conf variables
- SHLIBDIR	Location to install shared libraries if ${USE_SHLIBDIR}
			is "yes".  Defaults to "/usr/lib".

	- USE_SHLIBDIR	If "yes", install shared libraries in ${SHLIBDIR}
			instead of ${LIBDIR}.  Defaults to "no".
			Sets ${_LIBSODIR} to the appropriate value.
			This may be set by individual Makefiles as well.

	- SHLINKDIR	Location of shared linker.  Defaults to "/usr/libexec".
			If != "/usr/libexec", change the dynamic-linker
			encoded in shared programs

* Set USE_SHLIBDIR for libraries used by /bin and /sbin:
	libc libcrypt libcrypto libedit libipsec libkvm libm libmi387
	libtermcap libutil libz

* If ${_LIBSODIR} != ${LIBDIR}, add symlinks from ${LIBDIR}/${LIB}.so*
  to ${_LIBSODIR}/${LIB}.so* for compatibility.

* Always install /sbin/init statically (for now)


The net effect of these changes depends on how the variables are set:

  1.)	If nothing is set or changed, there is no change from the
	current behaviour:
		- Static /bin, /sbin, and bits of /usr/*
		- Dynamic rest
		- Shared linker is /usr/libexec/ld*so

  2.)	If the following make variables are set:
		LDSTATIC=
		SHLINKDIR=/lib
		SHLIBDIR=/lib
	Then the behaviour becomes:
		- Dynamic tools
		- .so libraries used by /bin and /sbin are installed to /lib,
		  with symlinks from /usr/lib/lib*so to -> /lib/lib*so
		  where appropriate
		- Shared linker is /lib/ld*so

  3.)	As per 2.), but add the following variable:
		USE_SHLIBDIR=yes
	This forces all .so's to be instaleld in /lib (with compat
	symlinks), not just those tagged by their Makefiles to be.
	Again, compat symlinks are installed
2001-12-28 01:32:37 +00:00
tv 001067bbd1 Readability cleanups; MKfoo=no -> NOfoo. 2001-12-12 00:51:00 +00:00
fvdl d191029b13 2 more bitnumber mistakes fixed while removing sahf. 2001-06-25 16:47:05 +00:00
fvdl c5b64cb062 Oops, when I replaced sahf with a btw, I made it test the wrong bit
(2 vs. 10).
2001-06-25 16:44:34 +00:00
fvdl 120d96874f %rbp -> %rsp in 2 cases. 2001-06-19 17:49:36 +00:00
fvdl 8ecba6c681 Modify the i387 code so that it can be shared between the i386 port
and the x86_64 port. XXX some files should be distinct.
2001-06-19 00:26:29 +00:00
kleink 26c512aade Make these idempotent as far as the FPU register stack is concerned. 2000-09-26 07:28:23 +00:00
matt 94827a09a3 Well, duh! Use indexed addressing since that's why it's there. That way
the code is PIC.  (mmm.  linker warning's about non-PIC code).
2000-07-14 22:26:15 +00:00
matt 584a2f53ee Clean up & prepare for ELF. Don't define isnan since it's in libc. Add a
powf (really a wrapper for pow).
2000-07-14 04:50:58 +00:00
is 7c1da7b0c9 Regenerate, after changing internal label used for linkage to the wrapper
scripts.
2000-05-16 19:07:35 +00:00
is 9ba8ffc293 Change libm-68060 internal, but file external labels (used for linkage between
wrapper functions and the Motorola code) to guarantee consistent protection
of the user namespace.
2000-05-16 19:05:37 +00:00
is 287de693da Regenerated files after this change:
Move each wrapper function to its own source file, such that redefining one
function doesn't give link errors when another one is pulled in from the
library.
Problem discovered by Klaus Klein.
2000-05-12 20:11:11 +00:00
is 183dfce153 Move each wrapper function to its own source file, such that redefining one
function doesn't give link errors when another one is pulled in from the
library.
Problem discovered by Klaus Klein.
2000-05-12 20:08:04 +00:00
is 97df1401a1 Move original Motorola files to the "dist" subdirectory, in response
to PR 9626 by Kris Shannon.
2000-04-14 20:24:29 +00:00
kleink 0c766839fc G/c label orphaned since rev. 1.6. 2000-01-31 18:28:49 +00:00
christos e133a9e685 Makefile and shared library for libm387. 1999-12-13 09:36:29 +00:00
thorpej bebf6897b4 Add register prefixes. 1999-11-10 16:45:33 +00:00
thorpej 627a762f23 Regen; add register prefixes. 1999-11-10 16:34:56 +00:00
thorpej c958703527 Add register prefixes. 1999-11-10 16:32:45 +00:00
is 7afc17a12a Use arch/m68k copies of the common functions even for mc68881 hardware. 1999-08-22 18:28:37 +00:00
is 2dc451b448 *gamma* need k_sin*/k_cos* 1999-08-22 08:25:42 +00:00
is 3f2d2fc0e5 Copied from mc68881/s_rint.S,v 1999-08-21 21:26:40 +00:00
is 455f7bb90c Copied from mc68881/s_floor.S,v 1999-08-21 21:26:28 +00:00
is c78325ae61 Copied from mc68881/s_ceil.S,v 1999-08-21 21:26:16 +00:00
is c81875b78b Copied from mc68881/s_finite.S,v 1999-08-21 21:25:40 +00:00
is 11d34cdce5 Copied from mc68881/s_copysign.S,v 1999-08-21 21:24:46 +00:00
is 9e6d62796f wrap lines in Makefile.list 1999-08-21 21:04:17 +00:00
is a33bf8cb4b Clarify instructions 1999-08-21 20:50:21 +00:00
is 9f72d71dcd Same reason as for ldexp.S: most applications don't scale 0.0. 1999-08-21 17:29:37 +00:00
is 8c65b3f672 Motorola floating point library support package based architecture dependent
code for libm - generated files. Currently, easy functions only.
1999-08-19 21:43:52 +00:00
is 00c9560d0c Motorola 68060 floating point library support package based architecture
dependent code for libm. Currently, easy functions only.
1999-08-19 21:41:35 +00:00