public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rsa at us dot ibm dot com" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sources.redhat.com Subject: [Bug math/4997] lround(nexafter(0.5,-1)) has incorrect value Date: Thu, 08 Nov 2007 18:53:00 -0000 [thread overview] Message-ID: <20071108185335.30422.qmail@sourceware.org> (raw) In-Reply-To: <20070906173748.4997.fxcoudert@gcc.gnu.org> ------- Additional Comments From rsa at us dot ibm dot com 2007-11-08 18:53 ------- The following asm stub resolves the issue by returning 'zero' if 0.5 > x > -0.5. fsub fp10,fp0,fp0 /* Compute 0.0. */ fabs fp2, fp1 /* Get the absolute value of x. */ fcmpu cr3, fp1, fp10 /* orig x is negative? x < 0.0 */ fcmpu cr6, fp2, fp0 /* if |x| < 0.5 */ ble- cr6,.Lretzero fadd fp3,fp2,fp0 /* |x|+=0.5 bias to prepare to round. */ bge cr3,.Lconvert /* orig x was positive so don't negate ans. */ fnabs fp2,fp3 /* -(|x|+=0.5) */ .Lconvert: fctiwz fp4,fp2 /* Convert to Integer DW lround toward 0. */ stfd fp4,8(r1) nop nop nop lwz r3,12(r1) /* Load return as integer. */ .Lout: addi r1,r1,16 blr .Lretzero: /* 0.5 > x > -0.5 */ li r3,0 /* return 0. */ b .Lout I need to identify all the places where the erroneous rounding is happening, apply this fix and also apply a check where x > 2^52 for llround. This may also be an issue for round(). Patch forthcoming. -- http://sourceware.org/bugzilla/show_bug.cgi?id=4997 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
next prev parent reply other threads:[~2007-11-08 18:53 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-09-06 17:38 [Bug math/4997] New: " fxcoudert at gcc dot gnu dot org 2007-09-14 12:36 ` [Bug math/4997] " fxcoudert at gcc dot gnu dot org 2007-09-14 13:54 ` fxcoudert at gcc dot gnu dot org 2007-10-22 22:52 ` rsa at us dot ibm dot com 2007-11-01 22:14 ` rsa at us dot ibm dot com 2007-11-08 18:53 ` rsa at us dot ibm dot com [this message] 2007-11-08 18:55 ` fxcoudert at gcc dot gnu dot org 2007-11-09 13:45 ` rsa at us dot ibm dot com 2007-11-09 19:41 ` rsa at us dot ibm dot com 2007-11-09 22:30 ` rsa at us dot ibm dot com 2007-11-20 21:46 ` rsa at us dot ibm dot com 2007-11-20 21:50 ` rsa at us dot ibm dot com 2007-11-29 16:01 ` rsa at us dot ibm dot com 2007-11-29 21:00 ` rsa at us dot ibm dot com 2008-04-10 5:51 ` drepper at redhat dot com 2008-04-11 15:56 ` rsa at us dot ibm dot com 2008-04-11 19:34 ` drepper at redhat dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20071108185335.30422.qmail@sourceware.org \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sources.redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).