Commit Graph

788 Commits

Author SHA1 Message Date
martin 7f829b0bd2 Pull up following revision(s) (requested by riastradh in ticket #507):
lib/libm/arch/aarch64/fenv.c: revision 1.5
	lib/libm/arch/aarch64/fenv.c: revision 1.6

Fix fesetenv and feupdateenv.
- fesetenv is supposed to set the stored rounding mode (and stored trap
  settings, but they have no effect on any ARMv8 I know).
- feupdateenv is supposed to re-raise the exceptions that were raised
  in the environment when it was called.
XXX atf test
XXX pullup-9

Fix feraiseexcept.
- Don't touch the trap flags (though on all ARMv8 I know they have no
  effect anyway).
- Don't clear any existing raised exception flags; just add to them.
XXX atf test
XXX pullup-9
2019-12-08 13:37:46 +00:00
martin 53237ac71f Pull up following revision(s) (requested by sevan in ticket #174):
lib/libc/sys/chmod.2: revision 1.48
	lib/libc/sys/stat.2: revision 1.59
	lib/libc/sys/unlink.2: revision 1.30
	lib/libc/sys/lseek.2: revision 1.25
	lib/libc/sys/getuid.2: revision 1.18
	lib/libc/sys/chown.2: revision 1.37
	lib/libm/man/exp.3: revision 1.32
	lib/libm/man/log.3: revision 1.7
	lib/libc/sys/open.2: revision 1.60
	lib/libc/stdio/fopen.3: revision 1.36
	lib/libc/stdio/putc.3: revision 1.14
	lib/libc/sys/mount.2: revision 1.51
	share/man/man9/copy.9: revision 1.22
	share/man/man9/uiomove.9: revision 1.20
	lib/libc/sys/setuid.2: revision 1.23
	lib/libc/sys/close.2: revision 1.18
	sbin/init/init.8: revision 1.61
	lib/libc/sys/write.2: revision 1.36
	lib/libc/sys/read.2: revision 1.39
	sbin/init/init.8: revision 1.62
	lib/libc/sys/wait.2: revision 1.40
	usr.bin/tty/tty.1: revision 1.10
	lib/libc/sys/link.2: revision 1.33
	usr.bin/du/du.1: revision 1.24
	lib/libc/stdlib/exit.3: revision 1.17
	usr.bin/su/su.1: revision 1.53
	usr.bin/mail/mail.1: revision 1.66
	lib/libc/sys/fork.2: revision 1.25
	usr.bin/su/su.1: revision 1.54
	usr.bin/mail/mail.1: revision 1.67
	lib/libm/man/sin.3: revision 1.15
	share/man/man9/intro.9: revision 1.26
	share/man/man5/utmp.5: revision 1.17
	lib/libc/compat-43/creat.3: revision 1.17
	lib/libc/time/ctime.3: revision 1.61
	lib/libcompat/4.1/stty.3: revision 1.10
	usr.bin/dc/dc.1: revision 1.3
	lib/libm/man/cos.3: revision 1.17
	lib/libc/sys/chdir.2: revision 1.23
	lib/libc/gen/exec.3: revision 1.30
	lib/libc/gen/exec.3: revision 1.31
	games/bcd/bcd.6: revision 1.18
	games/bcd/bcd.6: revision 1.19
	usr.bin/write/write.1: revision 1.7
	usr.bin/wc/wc.1: revision 1.18
	usr.bin/pr/pr.1: revision 1.24
	usr.bin/who/who.1: revision 1.25
	lib/libc/sys/mkdir.2: revision 1.30
	lib/libc/stdio/getc.3: revision 1.13
	usr.bin/sort/sort.1: revision 1.40
	usr.bin/mesg/mesg.1: revision 1.11
	share/man/man5/passwd.5: revision 1.34
sort was there since v1
https://www.bell-labs.com/usr/dmr/www/man61.pdf

dc was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

du was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

mail was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

mesg was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf

su was in v1
https://www.bell-labs.com/usr/dmr/www/man13.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man14.pdf
Update URL

write was in v1
https://www.bell-labs.com/usr/dmr/www/man14.pdf
grammar

passwd(5) was in v1
https://www.bell-labs.com/usr/dmr/www/man51.pdf

utmp(5) was present in v1
https://www.bell-labs.com/usr/dmr/www/man51.pdf

Earliest version of wtmp I could find was in v3
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man5/wtmp.5

Document history of chdir(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of chmod(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of chown(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf

create was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of exec()
Move statement on execlpe() & execvpe() to HISTORY section.

Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf

fork was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
stat() was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

document history of fstat()
https://www.bell-labs.com/usr/dmr/www/man21.pdf

getuid was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf

stty & gtty were around since v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
https://www.bell-labs.com/usr/dmr/www/man22.pdf

mount & umount were present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

Open was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

read was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

seek was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

setuid was in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

unlink was presen in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

wait was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

write was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf

start documenting history
exp was present in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf

Start documenting history
https://www.bell-labs.com/usr/dmr/www/man31.pdf

Start documenting history
https://www.bell-labs.com/usr/dmr/www/man31.pdf

log appeared in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf

putc & putw were in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf

putchar was in v4
https://minie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man3/putchr.3

Start documenting history
https://www.bell-labs.com/usr/dmr/www/man31.pdf

Document history.
https://www.bell-labs.com/usr/dmr/www/man11.pdf
Between v1 & v6 UNIX, bcd was rewritten in C, but I don't know if which
version,
hence I've skipped mentioning it.
End sentence with a dot.
Remove superfluous Pp.
Remove superfluous Pp.
Remove superfluous Ns.
Remove superfluous Pp.
fetch(9) -> ufetch(9)
fetch(9) -> ufetch(9). Remove superfluous Pp.
fetch(9) -> ufetch(9). Remove reference to unimplemented ppi(9).
2019-09-05 08:19:40 +00:00
mgorny c1c809ed5e Explicitly indicate that nexttowardl() is identical to nextafterl().
Requested by kamil.
2019-05-02 15:08:35 +00:00
wiz 6d61444732 Remove undefined \*H 2019-04-28 07:33:02 +00:00
kamil 0c003f5999 Add a C99 symbol to libm: nexttowardl
It's an alias for an already existing symbol nextafterl.

Patch obtained from <mgorny>

Detected by the LLVM buildbot breakage in tests.
2019-04-27 23:04:31 +00:00
maya 6717e848e2 Remove unused 387 implementations.
These were removed from the build for being wrong, but the implementation
stayed around. This is confusing, we have the attic for old code,
let's delete the unused implementations.
2019-04-26 10:11:14 +00:00
maya 3cdbcb3e1b document cosl with MLINKS and in the man page 2019-04-25 23:17:24 +00:00
mrg 261a15423e also want s_nexttoward.c on riscv. now tests/lib/libm links. 2019-04-17 07:45:23 +00:00
maya 085f60235e we need rintl (long double) to link binaries 2019-04-15 18:44:26 +00:00
maya a0aab386b6 Don't alias the long double version to the double version.
We now have 128bit long double (by the upstream GCC changing things)
2019-04-13 17:18:26 +00:00
maya 92e1c52520 Default our libm to -frounding-math, if built with GCC.
The long-standing GCC default is to not respect rounding mode.
it looks like GCC 7 optimizes rint to a builtin, causing our few
rounding mode tests to fail.

Fixes PR port-amd64/54000: FP tests failing on amd64 since gcc7 import
2019-02-22 18:17:22 +00:00
mrg fd676684f8 - avoid uninitialised memory usage 2019-02-04 04:37:50 +00:00
mrg 2c04daffef add some fallthru comments. 2019-02-04 03:30:20 +00:00
martin 6b62e867ad Add modfl alias. 2018-11-09 10:19:47 +00:00
riastradh 7374a22668 When hardware subnormal support is available, disable flush-to-zero.
Similarly, when hardware NaN propagation is available, disable
default-NaN substitution.

This enables IEEE 754 semantics on any hardware that supports it by
default.  Programs that want flush-to-zero or default-NaN substitution
can enable them explicitly.

ok ryo@
2018-11-07 06:47:38 +00:00
riastradh 6059a086c9 Disable x87 implementations of sin, cos, tan.
The x87 hardware uses a bad approximation to pi for argument
reduction, and consequently yields bad answers for inputs near pi or
pi/2.

Tweak one tanf test whose doubly rounded output is a little too far
from the correct answer on the doubly rounded input.
2018-11-07 04:00:12 +00:00
kamil 0d6563db8b Disable sanitizers for libm and librt
The sanitizers are designed to use pristine OS versions of these libraries,
install interceptors for public symbols in them and link with them in every
sanitized executable.

Having unmodified base libraries (c, m, rt, pthread) also makes the system
usable with programs linking with them and without sanitization, as there
are no fatal issues during the resolving of missing symbols.

The remaining libraries like libutil, libintl etc are prebuilt with
sanitization and all their users in the MKSANITIZER=yes distribution are
required to use the same sanitizer.

libc and libpthread are already marked with the NOSANITIZER flag.
2018-06-13 08:19:36 +00:00
martin 4e1ffbe979 Add missing alias for ldexpl on ! __HAVE_LONG_DOUBLE architectures.
Pointed out by Hal Murray on port-arm.
2018-03-27 11:59:49 +00:00
eadler 736570df7c Fix signed overflow in atan2
As a component of atan2(y, x), the case of x == 1.0 is farmed out to
atan(y). The current implementation of this comparison is vulnerable
to signed integer underflow (that is, undefined behavior), and it's
performed in a somewhat more complicated way than it need be. Change
it to not be quite so cute, rather directly comparing the high/low
bits of x to the specific IEEE-754 bit pattern that encodes 1.0.

ok martin@ pgoyette@ maya@
obtained from FreeBSD
2018-03-10 09:44:47 +00:00
christos 462103bc5a avoid negative shift 2018-03-06 01:14:41 +00:00
christos 0efaeed61f comment out unused variable. 2018-03-05 23:00:55 +00:00
christos 26ca7efe45 use named initializers 2018-01-25 03:54:21 +00:00
martin 5e52dad13c Fix usage of sysarch(ALPHA_FPGETMASK) 2017-12-30 17:59:24 +00:00
maya ab208a3dad Restore CAVEATS section unmodified.
It apparently refers to VAX and its lack of a negative zero.
2017-09-28 15:03:18 +00:00
maya cf91bfe7da List a few more functions 2017-09-28 11:18:41 +00:00
maya f56039ca90 Remove CAVEATS section
The man page for an individual function is not the right place to discuss
the issues with negative zero
2017-09-28 11:09:05 +00:00
wiz e4dcc564b8 Remove Tn. 2017-09-28 05:51:26 +00:00
maya 943496d3b4 Fix typo 2017-09-27 10:12:47 +00:00
maya 411564dc9a Mention tgmath cproj, creal, cabs
following copysign example use of "real-floating" with "complex-floating"
2017-09-27 09:20:27 +00:00
maya 166de49ccc Mention wanting to remove isnanf too, reword 2017-09-26 18:03:30 +00:00
maya 14e90145c6 Add man page link for hypotl.3 2017-09-26 16:01:58 +00:00
maya 3c4aaf3f6f omit mention of cabs (not relevant to this man page)
mention type-generic hypot
mention hypotl
2017-09-26 15:42:54 +00:00
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