Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: [netbsd-10] src
Module Name: src
Committed By: martin
Date: Wed Oct 2 12:46:13 UTC 2024
Modified Files:
src/distrib/sets/lists/debug [netbsd-10]: mi
src/distrib/sets/lists/tests [netbsd-10]: mi
src/lib/libm/src [netbsd-10]: s_remquo.c
src/tests/lib/libm [netbsd-10]: Makefile
Added Files:
src/tests/lib/libm [netbsd-10]: t_remquo.c
Log Message:
Pull up following revision(s) (requested by gdt in ticket #912):
distrib/sets/lists/debug/mi: revision 1.449
lib/libm/src/s_remquo.c: revision 1.3
lib/libm/src/s_remquo.c: revision 1.4
distrib/sets/lists/tests/mi: revision 1.1339
tests/lib/libm/t_remquo.c: revision 1.1
tests/lib/libm/t_remquo.c: revision 1.2
tests/lib/libm/Makefile: revision 1.51
tests: Add test for remquo
This test currently fails, because remquo has bugs. (A bugfix will be
committed soon.) Test vectors derived from results from code by
Charles Karney in GeodesicLib/proj, and manually inspected.
t_remquo: Work around missing remquo(3) for vax
Part of PR port-vax/57881
libm/remquo: Fix bug where wrong quotient was returned
Fix taken from FreeBSD:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=166463
https://cgit.freebsd.org/src/commit/lib/msun/src/s_remquo.c?id=1cbd288942b08217e99bf889e0967895d53af00c
FreeBSD commit message:
Fix a bug in remquo{,f,l}, in which the quotient didn't always have the
correct sign when the remainder was 0.
Fix a separate bug in remquo alone, in which the remainder and
quotient were both off by a bit in certain cases involving subnormal
remainders.
The bugs affected all platforms except amd64 and i386, on which the
routines are implemented in assembly.
(On NetBSD, this bug manifests on amd64.)
libm/remquo: Fix bug where remquo returned wrong sign of quo
ISO C requires that quo be congruent to the quotient mod 2^k and have
a particular sign. The current code can return 0 when it should be
negative.
Because the code chooses k=31 (for the requirement of congruence
modulo 2^k), the only value available (in ILP32 or LP64) that is
negative and congruent to 0 is 0x80000000. In the specific case of
wanting "-0", return 0x80000000.
Resolves t_remquo test failure.
To generate a diff of this commit:
cvs rdiff -u -r1.394.2.9 -r1.394.2.10 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1238.2.11 -r1.1238.2.12 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.1.56.1 src/lib/libm/src/s_remquo.c
cvs rdiff -u -r1.48 -r1.48.2.1 src/tests/lib/libm/Makefile
cvs rdiff -u -r0 -r1.2.2.2 src/tests/lib/libm/t_remquo.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index