All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: qemu-devel@nongnu.org, Thiemo Seufer <ths@networkno.de>
Subject: [Qemu-devel] MIPS FP rounding
Date: Wed, 19 Sep 2007 16:41:54 -0400	[thread overview]
Message-ID: <20070919204154.GA13366@caradoc.them.org> (raw)

Thiemo, in May you added this:

-    update_fcr31();       \
+    update_fcr31();                                           \
+    if (GET_FP_CAUSE(env->fcr31) & FP_INVALID)                \
+        FST2 = 0x7fbfffff;                                    \
+    else if (GET_FP_CAUSE(env->fcr31) & FP_UNDERFLOW) {       \
+        if ((env->fcr31 & 0x3) == 0)                          \
+            FST2 &= 0x80000000ULL;                            \
+    }                     \

That last bit says that if underflow is detected and the rounding mode
is round-to-nearest, return an signed appropriate signed zero.  Why?
The MIPS ISA docs say a rounded result is returned in this case, and
that's what's in FST2 if that code is removed.

This shows up in the mul-subnormal-single-1.c test from GCC's ieee.exp.

-- 
Daniel Jacobowitz
CodeSourcery

             reply	other threads:[~2007-09-19 20:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 20:41 Daniel Jacobowitz [this message]
2007-09-20 17:28 ` [Qemu-devel] Re: MIPS FP rounding Thiemo Seufer
2007-09-24 13:37   ` Daniel Jacobowitz

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=20070919204154.GA13366@caradoc.them.org \
    --to=drow@false.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ths@networkno.de \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.