Commit Graph

236 Commits

Author SHA1 Message Date
ru
e1ad6e61cc Properly terminate sentence. 2005-01-28 21:13:34 +00:00
das
783f4bf0c2 - Move the functions presently described in in ieee(3) to their own
manpages.  They are not very related, so separating them makes it
  easier to add meaningful cross-references and extend some of the
  descriptions.
- Move the part of math(3) that discusses IEEE 754 to the ieee(3)
  manpage.
2005-01-27 05:46:17 +00:00
cognet
fa9ea53805 Define FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD, FE_DOWNWARD and _ROUND_MASK to
unbreak the build for arm.
2005-01-24 00:35:02 +00:00
das
d7cc82f1f2 Update comment to reflect the code change in the previous revision.
Noticed by:	ceri
2005-01-23 22:56:08 +00:00
das
df543e85ea Many changes, including the following major ones:
- Rearrange the list of functions into categories.
- Remove the ulps column.  It was appropriate for only some
  of the functions in the list, and correct for even fewer
  of them.
- Add some new paragraphs, and remove some old ones about
  NaNs that may do more harm than good.
- Document precisions other than double-precision.
2005-01-23 22:05:33 +00:00
das
e52e82773b If x == y, return y, not x. C99 (though not IEEE 754) requires that
nextafter(+0.0, -0.0) returns -0.0 and nextafter(-0.0, +0.0) returns +0.0.
2005-01-23 15:46:22 +00:00
das
d55cbb5c10 Add fma() and fmaf(), which implement a fused multiply-add operation. 2005-01-22 09:53:18 +00:00
ru
ed72feddcb Sort sections. 2005-01-20 09:17:07 +00:00
ru
8f12d81a1c Use the \*(If string provided by mdoc(7), to represent infinity. 2005-01-16 16:49:10 +00:00
ru
9bccb183eb Removed redundant .br call. 2005-01-16 16:46:14 +00:00
das
64168d93e5 amd64 assembly versions of sqrt(), lrint(), and llrint() using SSE2. 2005-01-15 03:32:28 +00:00
das
c7466a47ff Most libm routines depend on the rounding mode and/or set exception
flags, so they are not pure.  Remove the __pure2 annotation from them.
I believe that the following routines and their float and long double
counterparts are the only ones here that can be __pure2:

	copysign is* fabs finite fmax fmin fpclassify ilogb nan signbit

When gcc supports FENV_ACCESS, perhaps there will be a new annotation
that allows the other functions to be considered pure when FENV_ACCESS
is off.

Discussed with:	bde
2005-01-15 02:55:10 +00:00
das
3e538fd2f7 Braino. Revert rev 1.50.
Pointy hat to:	das
2005-01-15 00:37:31 +00:00
das
df8ce09fbd Remove numerous references to VAX floating-point and the setting of
errno, replacing them with a discussion of IEEE exceptions where
appropriate.  Cross-reference fenv(3) whenever exceptions are
mentioned.
2005-01-14 23:28:28 +00:00
das
d6994ae2c3 Set math_errhandling to MATH_ERREXCEPT. Now that we have fenv.h, we
basically support this, subject to gcc's lack of FENV_ACCESS support.
In any case, the previous setting of math_errhandling to 0 is not
allowed by POSIX.
2005-01-14 22:03:27 +00:00
das
f5638fda1e Remove some #if 0'd code. 2005-01-14 21:51:46 +00:00
ru
8ef2048534 Tiny markup nits. 2005-01-14 09:12:05 +00:00
das
4ec986eab3 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
stefanf
17c8f614b7 Fixed too many of "the", and enclose multi-word argument in double quotes.
Obtained from:	ru
2005-01-13 20:33:42 +00:00
das
20067523af 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
das
5670c96a33 The isnormal() in rev 1.2 should have been isfinite() so subnormals
round correctly.

Noticed by:	stefanf
2005-01-13 15:43:41 +00:00
das
ed0817dc30 Things that are broken, unneeded, and unused since 1997 belong in the attic. 2005-01-13 15:43:22 +00:00
ru
d9ecb772db Markup nits. 2005-01-13 10:43:01 +00:00
ru
a14720c679 Fixed too many of "the", and enclose multi-word argument in double quotes. 2005-01-13 09:35:47 +00:00
stefanf
1bca40ec75 Implement and document ceill(). 2005-01-13 09:11:41 +00:00
stefanf
8ce754f4eb Bump .Dd for the last commit. 2005-01-13 09:08:16 +00:00
stefanf
86ef5da3d7 Hook up and document floorl(). 2005-01-12 22:16:26 +00:00
stefanf
9704cf1a67 Implement floorl(). 2005-01-12 22:10:46 +00:00
stefanf
2f05f40a83 Whitespace nit. 2005-01-12 22:05:41 +00:00
das
75bc489b6d Add MI implementations of [l]lrint[f]() and [l]lround[f]().
Discussed with:	bde
2005-01-11 23:12:55 +00:00
das
0a78d59d1f Document [l]lrint[f]() and [l]lround[f](). 2005-01-11 23:12:17 +00:00
das
1426450140 Faster lrint() and llrint() implementations for x86. 2005-01-11 23:10:53 +00:00
das
850b1bf882 Mark inline stmxcsr instructions as volatile, since this appears to be
the only way to convince gcc that they read the MXCSR.  The volatile
annotation may be needed elsewhere as well.
2005-01-11 22:10:43 +00:00
ru
5384a04b6a Scheduled mdoc(7) sweep. 2005-01-11 20:50:51 +00:00
ru
47082de5c6 Sanitize the markup, as prompted. 2005-01-11 20:16:03 +00:00
das
0ca0cdb376 GC unused declaration 2004-12-16 20:40:49 +00:00
das
8daeb2e028 Cosmetic changes only:
- style
- remove unused variables
- de-support VAX

Inspired by:	bin/42388
2004-12-16 20:40:37 +00:00
das
62f7d2f10d More updates for math(3):
- Make some minor rearrangements in the introduction.
- Mention the problem with argument reduction on i386.
- Add recently-implemented functions to the table.
- Un-document the error bounds that only apply to the old 4BSD math
  library, and fill in the correct values where I know them.  No
  attempt has been made to document bounds lower than 1 ulp, although
  smaller bounds are usually achievable in round-to-nearest mode.
2004-10-11 20:13:52 +00:00
stefanf
5198725430 Add and document ilogbl(), a long double version of ilogb(). 2004-10-11 18:13:52 +00:00
stefanf
3725fb7eda Use the FP_ILOG macros from <math.h> rather than hardcoded return values.
Also be prepared for FP_ILOGBNAN != INT_MAX.

Reviewed by:	md5
2004-10-09 17:14:28 +00:00
kensmith
911789fdaa Bump the library version numbers for the following libraries:
/lib/{libm,libreadline}
	/usr/lib/{libhistory,libopie,libpcap}

in preparation for doing the same thing to RELENG_5.  HUGE amounts of
help for determining what to bump provided by kris.

Discussed on:	freebsd-current
Approved by:	re (not required for commit but something like this should be)
2004-10-01 15:38:07 +00:00
das
2e0425d5d9 Further refine some #ifs:
- Simplify the logic by using __GNUC_PREREQ__.
  Suggested by stefanf.
- Make math.h compile with old (pre-8.0) versions of icc.
  Submitted by sf [sic].
2004-09-17 05:15:33 +00:00
stefanf
af9e10f920 Add man pages for the cimag(), conj() and creal() functions. 2004-08-07 23:03:36 +00:00
cognet
d416db42ae Only use rfs and wfs if ARM_HARD_FLOAT is defined, and use stubs if it is not,
in order to unbreak arm make world. The right way to do it with soft floats
will be figured out later.
Discussed with:	das
2004-08-05 14:07:24 +00:00
das
e4fbd5d172 Replace s_isnan.c and s_isnanf.c with the more compact s_isnan.c from
libc.  The externally-visible effect of this is to add __isnanl() to
libm, which means that libm.so.2 can once again link against libc.so.4
when LD_BIND_NOW is set.  This was broken by the addition of fdiml(),
which calls __isnanl().
2004-08-05 01:46:11 +00:00
das
73fe96f0a7 Use isnormal() instead of fpclassify() to avoid dependency on libc.so.5. 2004-08-05 01:44:55 +00:00
kan
d037fe2cca Work around known GCC 3.4.x problem and use ANSI prototype for dremf(). 2004-07-28 05:53:18 +00:00
das
7aef999db6 Fix two bugs in the signbit() macro, which was implemented last year:
- It was added to libc instead of libm.  Hopefully no programs rely
  on this mistake.

- It didn't work properly on large long doubles because its argument
  was converted to type double, resulting in undefined behavior.
2004-07-19 08:16:10 +00:00
stefanf
b4a34b5b66 Fix minor namespace pollution: The prototypes for f{dim,max,min}(),
nearbyint(), round() and trunc() shouldn't be visible when compiling with
-D_XOPEN_SOURCE=500.
2004-07-17 15:03:52 +00:00
das
a5d1cface5 Tweak the conditions under which certain gcc builtins are used:
- Unlike the builtin relational operators, builtin floating-point
  constants were not available until gcc 3.3, so account for this.[1]

- Apparently some versions of the Intel C Compiler fallaciously define
  __GNUC__ without actually being compatible with the claimed gcc
  version.  Account for this, too.[2]

[1] Noticed by:		Christian Hiris <4711@chello.at>
[2] Submitted by:	Alexander Leidinger <Alexander@Leidinger.net>
2004-07-16 06:21:56 +00:00