The NetBSD Project

CVS log for src/tests/lib/libm/t_remquo.c

[BACK] Up to [cvs.NetBSD.org] / src / tests / lib / libm

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.2.2.2: download - view: text, markup, annotated - select for diffs
Wed Oct 2 12:46:13 2024 UTC (3 months, 2 weeks ago) by martin
Branches: netbsd-10
CVS tags: netbsd-10-1-RELEASE
Diff to: previous 1.2.2.1: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.2.1: +126 -0 lines
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.

Revision 1.2.2.1
Fri Sep 20 22:24:51 2024 UTC (3 months, 4 weeks ago) by martin
Branches: netbsd-10
FILE REMOVED
Changes since revision 1.2: +0 -126 lines
file t_remquo.c was added on branch netbsd-10 on 2024-10-02 12:46:13 +0000

Revision 1.2: download - view: text, markup, annotated - select for diffs
Fri Sep 20 22:24:51 2024 UTC (3 months, 4 weeks ago) by rin
Branches: MAIN
CVS tags: HEAD
Branch point for: netbsd-10
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +29 -17 lines
t_remquo: Work around missing remquo(3) for vax

Part of PR port-vax/57881

Revision 1.1: download - view: text, markup, annotated - select for diffs
Thu Sep 19 19:43:13 2024 UTC (3 months, 4 weeks ago) by gdt
Branches: MAIN
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.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>