public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/2466] New: Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4
@ 2006-03-16 18:40 sjmunroe at us dot ibm dot com
  2006-03-16 18:47 ` [Bug math/2466] " sjmunroe at us dot ibm dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sjmunroe at us dot ibm dot com @ 2006-03-16 18:40 UTC (permalink / raw)
  To: glibc-bugs

The implementations of the (IBM double double format) long double
(./ldbld-128ibm/) for llrintl and llroundl, round incorrectly
when the integer portion is contained in th ehigh double, but the fractional
postion is contained in the low double. There are also problems where the input
value approaches __LONG_LONG_MAX__.

Also the IEEE 1003.1 spec states "These functions shall round their argument to
the nearest integer value, rounding according to the current rounding
direction."  So I added tests to libm-test.inc to cover llrint in four rounding
modes (FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD, FE_DOWNWARD) in addition to the
default rounding.

-- 
           Summary: Errors in long double (ldbl-128ibm) llrounding functions
                    in glibc-2.4
           Product: glibc
           Version: 2.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj at suse dot de
        ReportedBy: sjmunroe at us dot ibm dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: powerpc-gnu-linux
  GCC host triplet: powerpc-gnu-linux
GCC target triplet: powerpc-gnu-linux


http://sourceware.org/bugzilla/show_bug.cgi?id=2466

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/2466] Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4
  2006-03-16 18:40 [Bug math/2466] New: Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4 sjmunroe at us dot ibm dot com
@ 2006-03-16 18:47 ` sjmunroe at us dot ibm dot com
  2006-03-16 18:52 ` sjmunroe at us dot ibm dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sjmunroe at us dot ibm dot com @ 2006-03-16 18:47 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From sjmunroe at us dot ibm dot com  2006-03-16 18:47 -------
Created an attachment (id=923)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=923&action=view)
new failures in test-ldouble powerpc32


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2466

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/2466] Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4
  2006-03-16 18:40 [Bug math/2466] New: Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4 sjmunroe at us dot ibm dot com
  2006-03-16 18:47 ` [Bug math/2466] " sjmunroe at us dot ibm dot com
@ 2006-03-16 18:52 ` sjmunroe at us dot ibm dot com
  2006-03-16 18:55 ` sjmunroe at us dot ibm dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sjmunroe at us dot ibm dot com @ 2006-03-16 18:52 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From sjmunroe at us dot ibm dot com  2006-03-16 18:52 -------
Created an attachment (id=924)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=924&action=view)
new llrintl/llroundl failures in powerp64


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2466

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/2466] Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4
  2006-03-16 18:40 [Bug math/2466] New: Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4 sjmunroe at us dot ibm dot com
  2006-03-16 18:47 ` [Bug math/2466] " sjmunroe at us dot ibm dot com
  2006-03-16 18:52 ` sjmunroe at us dot ibm dot com
@ 2006-03-16 18:55 ` sjmunroe at us dot ibm dot com
  2006-03-16 23:17 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sjmunroe at us dot ibm dot com @ 2006-03-16 18:55 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From sjmunroe at us dot ibm dot com  2006-03-16 18:55 -------
Created an attachment (id=925)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=925&action=view)
Proposed patch with libm-test.inc update and llrintl llroundl fixees

2006-03-15  Steven Munroe  <sjmunroe@us.ibm.com>
	    Alan Modra	<amodra@bigpond.net.au>

	[BZ #2466]
	* math/libm-test.inc [TEST_LDOUBLE] (llrint_test, llround_test):
	Add new test values.
	(llrint_test_tonearest, llrint_test_towardzero, llrint_test_downward,
	llrint_test_upward): Add new rounding mode tests.

	* sysdeps/ieee754/ldbl-128ibm/s_llrintl.c (__llrintl): Handle
	rounding that spans doubles in IBM long double format.
	* sysdeps/ieee754/ldbl-128ibm/s_llroundl.c (__llroundl): Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_llrintl.S: Removed.
	* sysdeps/powerpc/powerpc64/fpu/s_llroundl.S: Removed.
	* sysdeps/powerpc/powerpc64/fpu/s_lrintl.S: Removed.
	* sysdeps/powerpc/powerpc64/fpu/s_lroundl.S: Removed.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2466

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/2466] Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4
  2006-03-16 18:40 [Bug math/2466] New: Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4 sjmunroe at us dot ibm dot com
                   ` (2 preceding siblings ...)
  2006-03-16 18:55 ` sjmunroe at us dot ibm dot com
@ 2006-03-16 23:17 ` cvs-commit at gcc dot gnu dot org
  2006-04-23 17:47 ` drepper at redhat dot com
  2006-05-11 13:56 ` sjmunroe at us dot ibm dot com
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2006-03-16 23:17 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2006-03-16 23:17 -------
Subject: Bug 2466

CVSROOT:	/cvs/glibc
Module name:	libc
Changes by:	roland@sources.redhat.com	2006-03-16 23:16:56

Modified files:
	math           : libm-test.inc 

Log message:
	2006-03-16  Roland McGrath  <roland@redhat.com>
	
	[BZ #2466]
	* math/libm-test.inc (llrint_test, llround_test): Fix last change to
	protect large-precision cases with [LDBL_MANT_DIG > 100].
	(llrint_test_tonearest, llrint_test_towardzero): Likewise.
	(llrint_test_downward, llrint_test_upward): Likewise.
	2006-03-15  Steven Munroe  <sjmunroe@us.ibm.com> Alan Modra  <amodra@bigpond.net.au>
	
	[BZ #2466]
	* math/libm-test.inc (llrint_test, llround_test) [TEST_LDOUBLE]:
	Add new test values.
	(llrint_test_tonearest, llrint_test_towardzero, llrint_test_downward,
	llrint_test_upward): New functions.
	(main): Call them.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/math/libm-test.inc.diff?cvsroot=glibc&r1=1.70&r2=1.71



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2466

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/2466] Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4
  2006-03-16 18:40 [Bug math/2466] New: Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4 sjmunroe at us dot ibm dot com
                   ` (3 preceding siblings ...)
  2006-03-16 23:17 ` cvs-commit at gcc dot gnu dot org
@ 2006-04-23 17:47 ` drepper at redhat dot com
  2006-05-11 13:56 ` sjmunroe at us dot ibm dot com
  5 siblings, 0 replies; 7+ messages in thread
From: drepper at redhat dot com @ 2006-04-23 17:47 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2006-04-23 17:47 -------
And once again, changing the rounding mode is not acceptable.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |drepper at redhat dot com
             Status|NEW                         |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=2466

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug math/2466] Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4
  2006-03-16 18:40 [Bug math/2466] New: Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4 sjmunroe at us dot ibm dot com
                   ` (4 preceding siblings ...)
  2006-04-23 17:47 ` drepper at redhat dot com
@ 2006-05-11 13:56 ` sjmunroe at us dot ibm dot com
  5 siblings, 0 replies; 7+ messages in thread
From: sjmunroe at us dot ibm dot com @ 2006-05-11 13:56 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From sjmunroe at us dot ibm dot com  2006-05-11 13:55 -------
hmmm, the alternative is to simulate the operation with integer ops. But this is
generic code...

I'll look to using the double rounding equivelent, instead of changing the
rounding mode inline, to get the desired effect. Slightly less efficient but
more  general.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2466

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-05-11 13:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-16 18:40 [Bug math/2466] New: Errors in long double (ldbl-128ibm) llrounding functions in glibc-2.4 sjmunroe at us dot ibm dot com
2006-03-16 18:47 ` [Bug math/2466] " sjmunroe at us dot ibm dot com
2006-03-16 18:52 ` sjmunroe at us dot ibm dot com
2006-03-16 18:55 ` sjmunroe at us dot ibm dot com
2006-03-16 23:17 ` cvs-commit at gcc dot gnu dot org
2006-04-23 17:47 ` drepper at redhat dot com
2006-05-11 13:56 ` sjmunroe at us dot ibm dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).