Commit Graph

458 Commits

Author SHA1 Message Date
drochner
2dcdd0a999 two disgusting hacks:
-mk/bsd.lib.mk picks up a .S asm file behind our back (did it do so
 always?). s_modf.S is incorrect; I'm undecided whether it makes sense
 to fix it, so add a stupid rule to enforce the .c file to be used.
-on i386, s_tanh.c gets miscompiled. It works with -O0, so add
 COPTS for exactly that file.
2010-08-10 17:53:08 +00:00
wiz
ab7858d6ea Remove reference to fpresetsticky(3), which doesn't exist.
From Stathis Kamperis.
2010-08-07 18:13:12 +00:00
wiz
16b537c3d2 Fix typo in MLINKS, from Stathis Kamperis. Adapt set lists, and run
them through sort while there.
2010-08-07 18:12:45 +00:00
wiz
33c5cb75ad Remove trailing comma in enumeration, make HTML-ready. 2010-08-04 18:58:28 +00:00
wiz
3b43a9401a Remove trailing comma in enumeration. 2010-08-04 18:58:18 +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
joerg
9741664022 \\* -> \* 2010-05-14 03:10:24 +00:00
jruoho
f08e16091d Note that rest of the functions come from C99. 2010-05-03 05:35:58 +00:00
joerg
79b996cbc6 Don't mix opening and closing macros of different types. 2010-04-29 08:35:03 +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
joerg
ffec7f50c0 Fix escape sequences 2010-04-05 21:33:25 +00:00
mrg
d5a3d97bc4 build s_frexp.c, s_ldexp.c and s_modf.c here for new platforms, since they
don't exist as compat functions in libc.

current list of new platforms: powerpc64.

from dennis.c.ferguson@gmail.com in PR#43042.  idea to not put compat
functions into new platforms from drochner@netbsd.
2010-03-29 06:59:42 +00:00
snj
d4a6f9b098 These functions are going to first appear in 5.1, not 6.0. 2010-03-08 02:35:50 +00:00
snj
b513aa9a56 Fix broken RCSID. 2010-03-08 01:05:20 +00:00
drochner
b1a1fc216d fix return values for atan2(+-0,+-0) in the POSIX case 2010-01-27 20:23:53 +00:00
drochner
f12889bbfb fix return value in case of NaN input
(the code also shortcuts the +-inf case, but this was OK before -- it
only avoids an extra check of the mantissa)
2010-01-27 14:07:41 +00:00
drochner
e712404ece let the previous fix apply to acos rather than atan2,
and get rid of #ifdef vax
2010-01-20 16:49:42 +00:00
tnozaki
1166d8dc53 PR/42630 asin(2.0) and acos(2.0) doesn't return NaN.
reported by NARUSE, Yui -san, Thanks!
2010-01-20 16:31:35 +00:00
christos
de3b931d80 merge conflicting error sections. 2010-01-12 15:51:01 +00:00
christos
a61eab08ce remove weak reference for now. 2010-01-11 23:38:24 +00:00
christos
5f7c431ef4 Add exp2 and exp2m 2010-01-11 16:28:39 +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
joerg
d3ac1c4282 Disable the use of mandoc for now until support for conditional
expression exists.
2009-10-23 23:42:52 +00:00
wiz
00f6672d21 Mention NetBSD in HISTORY as well. 2009-10-04 22:11:22 +00:00
christos
26573d8819 add f{min,max,dim}{,l,f} from FreeBSD 2009-10-04 22:04:30 +00:00
drochner
aa89e1b426 As noticed by Stathis Kamperis, the original implementation does not
always return the correct principal value (with real>=0).
(eg cacosh(ccos(1.0I)) was -1)
Replace by a more ground-up one which should do better.
2009-08-03 19:41:32 +00:00
lukem
d66cb3da2c fix -Wsign-compare issue (on macppc) 2009-02-16 01:19:34 +00:00
lukem
2e51a772b3 fix -Wsign-compare issue 2009-01-19 05:58:27 +00:00
he
fddc3457b2 Change the use of formally undocumented features, which have now been
made to fail.  Specifically, change
.ifdef(SYMBOL) -> .ifdef SYMBOL or .if defined(SYMBOL),
and corresponding for .ifndef.

Also correct one error in lib/libm/Makefile (.ifdef (${MKCOMPLEX} != "no")?!?).
2009-01-18 20:42:11 +00:00
christos
93d0aacf67 Fix a little lint. 2008-09-28 18:54:55 +00:00
gmcgarry
3c9a95916d Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC. 2008-08-29 00:02:21 +00:00
gmcgarry
396359b261 Check MKCOMPLEX variable to build complex support into libm. 2008-07-12 12:23:13 +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
christos
aee69d536e fix bugs that piss off lint. 2008-05-01 15:33:15 +00:00
martin
11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
uwe
138486a3df According to C99:
6.11.5  Storage-class specifiers

       [#1] The placement of a storage-class specifier  other  than
       at   the  beginning  of  the  declaration  specifiers  in  a
       declaration is an obsolescent feature.

and gcc -Wextra warns about this, so s/const static/static const/
2008-04-29 15:10:02 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos
e1bf490a86 pass a little lint. 2008-04-26 23:49:50 +00:00
christos
6e8524778b Remove 3 functions that exist in libc. This does not break binary compatibility
since we always link with libc.
2008-04-26 19:49:38 +00:00
christos
f5e7bbccfe Put back USE_SHLIBDIR and remove the confusing lint comment that made me
comment it out in the first place.
2008-04-26 19:19:06 +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
drochner
33e5dbb818 fix so that it doesn't interact strangely with ARCH_SRCS definitions
in the base Makefile, makes the lib built correctly again for eg amd64
(seen by wiz)
2008-03-08 14:21:41 +00:00
drochner
c7a43da627 Add manpages for the complex math functions, originally from SUSv3,
roff source from the Linux documentation project.
Modifications before import:
-added NetBSD RCS ID
-removed Linux PROLOG and declarations with "long double"
-ran the "deshallify" script as required by The Open Group
Split out complex related things into an own Makefile fragment.
Thanks to hubertf for directions.
2008-02-20 09:55:37 +00:00
mrg
ecc90aa046 make all sun2 use -O0 and move most of the hacks out into just 3 files. 2008-02-09 02:37:21 +00:00
mrg
e6f4791d95 make sun2 build again with liberal use of -O0. 2008-02-05 02:41:15 +00:00
drochner
a82b6826f5 replace the last cast through void* by the SET_FLOAT_WORD macro, inspired
by a similar change in FreeBSD
2007-08-21 20:12:27 +00:00
drochner
58960d86a5 Adopt an (older) fix from FreeBSD: using ceil() on values in (0,0.5]
leads to loss of precision, leading to rounding into the wrong direction
for the case 0.5-epsilon. use floor() instead.
This also fixes a wrong sign of zero returned with non-default rounding
directions.
2007-08-21 20:10:27 +00:00
drochner
9d8b5fa74e Add C99 complex support, for double and float.
Most complex function implementations are from the "c9x-complex" library,
originating from the "cephes" math library, see
http://www.netlib.org/cephes/, from Stephen L. Moshier, incorporated and
redistributed with the NetBSD license by permission of the author.

Error behaviour and other boundary conditions (branch cuts)
need to be looked at.

For namespace sanity, I've done the rename/weak alias procedure to
most of the exported functions which are also used internally.
Didn't do so for sin/cos(f) yet because assembler implementations use
them directly, and renaming functions shared between the main libm
and the machine specific "overlay" might raise binary compatibility
issues.
2007-08-20 16:01:28 +00:00
drochner
b36bcf93ef make the hypot/atan2 functions weak aliases, because they are used
internally by the historical cabs(), and the future c99 cabs/carg
2007-08-10 21:20:35 +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
7fc72a801d remove references to old cabs() 2007-02-26 12:10:56 +00:00
drochner
7161d089aa -get cabs() and cabsf() out of public view - these are historical and
conflict with C99 functions which are builtins in newer gcc
 (actually, the old cabs() is ABI compatible with the new _complex one
  on i386, but this is purely accidental)
 remove public prototypes and manpages, move the code into a compat
 subdirectory as libc does so that binary compatibility is kept
-add a manpage for the isgreater() etc macros, borrowed from FreeBSD
2007-02-22 22:08:17 +00:00
hubertf
55ac93d329 Remove more duplicate #includes, and a few spurious whitespaces at EOL
From Slava Semushin <slava.semushin@gmail.com>
2007-01-17 23:24:22 +00:00
wiz
4b19648772 s/greatful/grateful/, from Zafer. 2006-11-24 21:15:54 +00:00
drochner
d81b3ce220 make an intermediate float variable "volatile" on i386 to work around a gcc
optimization problem: subsequent add/subs were done inside FPU registers,
with "double" precision, without rounding to "float" in between
2006-08-01 20:14:35 +00:00
matt
d882b4c815 Rather than cast everything around (which upsets gcc4), use a union instead. 2006-07-08 00:28:21 +00:00
drochner
51086becae move manpages for frexp/ldexp/modf to libm -- the (most) implementation is
already there
2006-07-03 16:03:56 +00:00
mrg
9f0110033d noieee src is not strict-aliasing compliant. apply -fno-strict-aliasing. 2006-07-01 08:57:14 +00:00
mrg
ec0b42887d build w_cabs.c/w_cabsf.c with -fno-builtin-cabs[f]
XXX: our cabs()/cabsf() are different to others.
2006-05-11 00:37:53 +00:00
wiz
e4293af91f Sort SEE ALSO, bump date for previous. 2006-04-04 20:26:33 +00:00
drochner
75d99205fc we don't have FE_TOWARDZERO (yet), refer to FP_RZ instead 2006-03-31 12:17:41 +00:00
xtraeme
500730a394 Mention trunc(3), reminded by kjk. 2006-03-26 02:02:38 +00:00
kleink
f4003bf348 Add LIBRARY. 2006-03-25 22:18:40 +00:00
uwe
2660f98628 Uncomment crossreference to round(3), we do have one. 2006-03-25 20:03:06 +00:00
uwe
0b2a86e51d Uncomment crossreference to trunc now that we have it. 2006-03-25 20:01:36 +00:00
xtraeme
3e96ddc120 Add __RCSID(), u_intX_t -> uintX_t.
cvs: ----------------------------------------------------------------------
2006-03-25 16:55:53 +00:00
xtraeme
f1336fbda3 Add trunc() and truncf() C99 functions, from FreeBSD. 2006-03-25 16:41:11 +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
4ece2172cf Build the sun versions of frexp(), ldexp() and modf().
While the versions in libc/gen are prettier to look at, having single
precision versions in libm and double precision versions in libc causes
a lot of confusion, and to favor libm gets us coprocessor support.
2006-03-21 18:46:05 +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
christos
cd35252882 Use float constants! 2006-03-19 20:54:15 +00:00
christos
a42e5c8db9 Coverity CID 562: Flip the order of the if statement to prevent unreachable
code.
2006-03-19 20:46:25 +00:00
christos
fef1370818 Coverity CID 572: Comment out dead code. 2006-03-19 20:42:44 +00:00
christos
15da190f2c Coverity CID 573: Comment out unreachable code. 2006-03-19 20:41:24 +00:00
christos
4696019f20 Coverity CID 574: Unreachable code due to incorrect constants. Correct
constants according to the comments in the code, and add more comments.
2006-03-19 20:39:48 +00:00
christos
3511ea5c9b Coverity CID 575: comment out dead code. 2006-03-19 20:15:07 +00:00
wiz
ca5de9d73f Bump date for previous. 2006-03-15 22:09:06 +00:00
kleink
d73d316468 Add nan(3), nanf(3), and nanl(3); welcome libm.so.0.4. 2006-03-15 22:07:08 +00:00
kleink
0d57b38925 Note roundf() in STANDARDS, too. 2006-01-24 16:39:45 +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
wiz
c4b850a8a6 Add man page for l{,l}rint{,f}(3), very loosely based on the FreeBSD one.
Requested by martin@
Reviewed by drochner@
2005-09-16 15:26:47 +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
christos
9aa540a2b5 Add wrappers for the newly added functions. Thanks Klaus! 2005-07-21 16:58:39 +00:00
wiz
d957cc9d17 Punctuation fixes, bump date for log2{,f}. 2005-07-21 12:58:22 +00:00