Commit Graph

756 Commits

Author SHA1 Message Date
maya
69be559832 Mention there's a type generic variant in tgmath.h
(XXX and in math.h, if you're netbsd)
2017-09-26 15:12:57 +00:00
christos
c2e78b1bda add nexttoward for mips64 and aarch64 2017-08-21 17:10:34 +00:00
he
7659ce9cff Actually... s_nexttowardf.c appears to be usable on soft-float as well;
it was for arm earlier and briefly for all mips, so just move it into
COMMON_SRCS.
2017-08-17 13:58:39 +00:00
he
9de3bc60de Move the inclusion of s_nexttowardf.c into a common test for
MKSOFTFLOAT=="no".  This brings us nexttowardf() for sparc, at least.
2017-08-17 09:06:21 +00:00
nisimura
25f03d5f57 add s_rintl.c for aarch64. ok by ryo@. 2017-08-16 13:34:59 +00:00
he
61fdebe2ec On second thought, don't introduce nexttowardl() since we don't have that
yet elsewhere.
2017-08-16 11:22:52 +00:00
he
b2720bf72a In the non-softfloat m68k part, add s_nexttoward.c and s_nexttowardf.c,
so that we get nexttoward() and nexttowardf() implemented here as well.
2017-08-16 09:18:24 +00:00
he
4ca6be884d On systems without __HAVE_LONG_DOUBLE, also alias nexttoward() and
nexttowardl() to nextafter().
2017-08-16 09:15:48 +00:00
mlelstv
7d91d16de6 rintl is required for archs that support long double. 2017-08-15 10:40:28 +00:00
he
900a3d47b2 Move s_nearbyint.c out of the cpu ifdefs and into COMMON_SRCS,
which is used everywhere except on vax.  This is to simplify and
to ensure the function is included in the build, allowing us to
re-add the nearbyint() test.
2017-08-11 20:24:56 +00:00
he
0cac3e13d5 The sparc port needs s_nearbyint.c as well. 2017-07-27 10:03:10 +00:00
he
4ae65f06c5 Non-softfloat m68k needs s_rintl.c. 2017-07-27 07:01:58 +00:00
he
07051e2f14 Add s_nearbyint.c to alpha, ia64, riscv, mips, powerpc, and sh3 ports. 2017-07-26 09:53:09 +00:00
he
e07b573bf9 Add some blank lines to separate the different CPU archs,
for a minimal readability improvement.
2017-07-26 09:42:12 +00:00
wiz
01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
maya
5b9f416541 Correct misleading indentation. NFC
From GCC8
2017-06-22 12:43:43 +00:00
maya
5b9767ae88 Belatedly bump minor.
lots of changes since -7 (libm.so.0.11), including:
new functions: llroundl, lroundl, erfl, erfcl
partial switch to freebsd catrig
2017-05-13 13:17:11 +00:00
maya
6c9a28baeb Drop superfluous ; in __warn_references 2017-05-13 02:58:03 +00:00
maya
468489bfea Correct misleading indentation. NFC
This isn't a functional difference because huge + x > one is
always true for a small x, and is probably a magical incantation
to raise inexact if x != 0

Found by GCC 8.0
2017-05-09 02:04:38 +00:00
martin
0dcaa3783b Complete the namespace dance 2017-05-08 09:25:03 +00:00
martin
9bce32444d Add missing namespace.h include 2017-05-08 08:21:56 +00:00
christos
922c79a2e7 Add the imprecise catrigl functions back. 2017-05-07 22:01:54 +00:00
christos
ea6fb1417c mention why we don't support this (yet) 2017-05-07 21:59:06 +00:00
martin
dc8051aeb0 Limit some rintl usage to #ifdef __HAVE_LONG_DOUBLE.
XXX should probably declare some aliases in the #else case
2017-05-07 11:29:21 +00:00
christos
464b32545a Replace our rounding functions with the ones from FreeBSD 2017-05-06 18:03:24 +00:00
christos
f7c6682327 add missing namespace.h 2017-05-06 18:02:52 +00:00
chs
c853a494e6 expose the BSD/linux fenv extensions in libm on ia64 too. 2017-03-23 18:27:29 +00:00
chs
de7c5b7203 sun2 just has to be different, of course.
it doesn't use the libc softfloat and thus doesn't set MKSOFTFLOAT=yes.
enable the fenv functions here explicitly for now.
2017-03-23 18:26:03 +00:00
chs
7e30e94394 provide a common softfloat fenv implemenation and use it for softfloat builds.
restore ABI compatibility with previous releases for ieeefp.h on sh3.
add namespace.h protection for all the fenv interfaces.
use MKSOFTFLOAT on sh3 instead of assuming softfloat.
standardize on comparing MKSOFTFLOAT with "no".
remove the arm-specific softfloat fenv code (which also had several bugs).
fix logic errors in the arm hardfloat feraiseexcept() and feupdateenv().
2017-03-22 23:11:07 +00:00
chs
ed8841c51d lrint() and lrintf() are supposed to use the current rounding mode,
so use vcvtr rather than vcvt.
2017-03-16 16:32:12 +00:00
maya
0e7316adf4 Remove redundant null check before free()
It is guaranteed to be fine also by C99
2017-03-07 11:15:08 +00:00
chs
a3f976c753 the MI lrint() code assumes that rounding is done in at most double precision
but m68k (68881) uses extended precision by default, so put the FPU in
double-precision mode temporarily here.
2017-02-27 06:49:02 +00:00
scole
e3edf3b621 Add fenv for ia64, imported from FreeBSD, compile tested only. 2017-02-23 02:05:30 +00:00
maya
fa47e9d850 ifdef out some dead code. improves code readability.
all later users of y first assign another value.

using ifdefs to make potential future code syncs easier, as is done
elsewhere.

suggested by coverity, CID 1300929, 1300930.
2017-02-09 22:11:09 +00:00
maya
d5de09b1da Appease static analyzers by making all code paths which assign
values into p,q sane. Get rid of redundant assignment. Indent
for legibility. NFC.

This doesn't create a functional difference, as all callers
test number >= 0x40000000 anyway.

To see this, note the following:
- consistently, hx is the high bits of x, lx is the low bits,
  x is the float.
- & 0x7fffffff zeroes the sign bit, as does fabs.

A case where it isn't easy to see that there's no functional
change is y1, which does:

ix = hx & 0x7fffffff (zero signbit of high bits of x)
y = fabs(x) (this has a zeroed signbit but otherwise same as x)
ix >= 0x40000000
  pone(y); qone(y)

qone(x) (also pone) do:
  ix = hx & 0x7fffffff

ix in qone and in the calling function are the same number,
and the comparison applies for both, and ix < 0x40000000 isn't
possible.

(Also, no explosions seem to happen when I feed it random numbers)
2017-02-09 21:23:11 +00:00
abhinav
60763e809a Add comma between two Nm entries in the NAME section. 2017-02-01 16:06:19 +00:00
abhinav
d2174aa7ea Add modff and modfl in the NAME section. 2017-02-01 15:57:47 +00:00
abhinav
11aef024b5 Fix a sentence.
Correct function name in the DESCRIPTION section.
2017-02-01 15:49:02 +00:00
abhinav
5f9e091f8e Also, fix spelling of described. 2017-02-01 14:51:29 +00:00
abhinav
6cef231ea2 Fix sentence. 2017-02-01 14:46:51 +00:00
abhinav
b59ab9a645 Remove comma after last Nm entry. 2017-02-01 14:42:28 +00:00
abhinav
53327cbb3e Remove comma after the last Nm entry. 2017-02-01 14:37:20 +00:00
maya
c7ed247615 add a wishlist for a major bump. isinff and compatibility cabs. 2017-01-20 22:10:38 +00:00
maya
038de09f8a compare to zero, instead of using signbit, and be more specific in comment.
-0.0 > 0 is also false. no functional change.

while this is mostly a change to be consistent in style (the rest of the
comparisons aren't done with signbit), it is also a micro-optimization.

with our default compile flags, calls to copysign are libm calls (and a
whole function call!!). this generates more efficient code.
2017-01-01 19:32:14 +00:00
maya
c0f2822a3c similar to csqrt, spare ourselves a fabsf call. we already check sign
later on, use this to our advantage.

No functional change.
2016-12-31 22:54:56 +00:00
maya
43e54dd9fc csqrt has a branch cut on the negative real axis, and this requires
delicacy in order to maintain continuity around it.

we have an initial case to deal with a fairly common case: getting
a real number. Avoid dealing with the branch cut in this case by
checking if the real part is negative.

later, -0.0 < 0 is not met, so instead, test for a negative number
using signbit, so negative zero is also treated as a negative number.

Fixes last part of PR lib/51427: libm issues triggered by py-numpy

ok riastradh
2016-12-31 20:01:15 +00:00
maya
03a73f9282 Spare ourselves a fabs call. We already check the sign later.
w = r + y*I is the same as w = r because this is the y == 0 case.

no functional change.
2016-12-31 15:33:03 +00:00
christos
5398e0956f more stuff needs -mfpu=vfp 2016-12-08 18:42:01 +00:00
christos
122a9a6480 deal with namespace issues and missing atanhf for vax. 2016-09-21 14:11:40 +00:00
christos
939877e98c fix VAX! 2016-09-20 18:25:20 +00:00