Commit Graph

724 Commits

Author SHA1 Message Date
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
christos 0f266a6ca3 Add the complex trig functions from FreeBSD 2016-09-19 22:05:05 +00:00
jakllsch 6b848d5cfa Actually get fma(3) and friends into ARM libm. 2016-09-07 14:41:33 +00:00
christos fac93a1e7a no need for stdio. 2016-08-27 10:03:16 +00:00
christos c898927fa5 sync with FreeBSD 2016-08-27 10:01:08 +00:00
christos 53b6bfd5c1 correct case 23 for -0.0 2016-08-27 10:00:38 +00:00
christos 394a54cbfc skip buggy assembly for libm_g.a 2016-08-27 09:15:44 +00:00
dholland f3ab3c700b strtod, not strod. 2016-08-27 02:56:26 +00:00
christos a3fc1936b1 fix double merge. 2016-08-26 08:33:48 +00:00
christos 048f5b6f16 do the FENV test consistently 2016-08-26 08:31:17 +00:00
christos b1803eb858 fix sun2 build; only IEEE math platform (and coldfire) without fenv 2016-08-26 08:20:31 +00:00
christos 92e958de60 more fenv for sh 2016-08-25 12:15:28 +00:00
christos 5b36f996f3 fix ilogb* 2016-08-24 10:03:32 +00:00
christos 96936a322e add ilogb. 2016-08-24 09:10:57 +00:00
christos 87691b796d ilogb for the vax 2016-08-24 09:08:50 +00:00
christos efaac31f0f fenv.h for alpha 2016-08-23 10:00:15 +00:00
maya 47a6662175 BUGS section is no longer correct
FP_ILOGB0 and FP_ILOGBNAN are both defined in math.h
2016-08-22 07:33:30 +00:00
martin a13d81e5df No fenv for m68k with SOFTFLOAT for now - so at least it builds. 2016-03-30 07:44:06 +00:00
skrll 3593a88925 Update {read,write}fpsr to work everywhere 2016-03-20 14:22:46 +00:00
nros 71f379ad51 Added ldexpl to ldexp manpage since it is missing.
Also added ldexpf manpage link since it is missing.
2016-03-17 18:29:58 +00:00
wiz 310b2e7c40 Fix typo, add whitespace for better formatting, bump date for previous. 2016-03-17 09:44:56 +00:00
nros cf57e34dd1 Add fabsl to the manpage describing the fabs functions. 2016-03-17 00:00:44 +00:00
nros ccbaa1faff Add modfl to the modf manpage, the link to modfl was already there but the
content was missing.
2016-03-15 15:29:19 +00:00
joerg 80b4ccd26e Long double complex multiplication and division helpers are needed on
Sparc64 and AArch64.
2016-02-27 19:06:56 +00:00
christos f9c7ee08d4 PR/50822: David Binderman: Fix copy length. 2016-02-17 19:54:11 +00:00
gson 94608659ce Fix incorrect magic numbers in scaling. From FreeBSD commit 23397, by
way of Rin Okuyama.  Fixes PR lib/50698.
2016-01-24 20:34:30 +00:00
christos 6510a8eabd modernize. 2016-01-16 21:31:38 +00:00
christos 5a327b6e14 fix typo 2016-01-16 21:29:33 +00:00
christos 370ae5dba9 PR/50660: David Binderman: bad calls to printf, in test part 2016-01-16 19:44:05 +00:00
christos caa46aef53 fix lint build 2016-01-11 01:34:39 +00:00
christos 420437aa3e Add sqrtl 2015-12-29 16:57:35 +00:00
christos 64bdb50ef0 add fenv for m68k 2015-12-24 14:12:12 +00:00
christos 63aea4bd5b Add mips fenv.c (From FreeBSD) 2015-12-21 17:02:02 +00:00