qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: david@gibson.dropbear.id.au, mark.cave-ayland@ilande.co.uk
Subject: [Qemu-devel] [PATCH 2/2] fixup! target/ppc: Use non-arithmetic conversions for fp load/store
Date: Sun,  5 Aug 2018 18:27:23 -0700	[thread overview]
Message-ID: <20180806012723.5639-3-richard.henderson@linaro.org> (raw)
In-Reply-To: <20180806012723.5639-1-richard.henderson@linaro.org>

---
 target/ppc/fpu_helper.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index faea64020b..b9bb1b856e 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -61,7 +61,7 @@ uint64_t helper_todouble(uint32_t arg)
         /* Normalized operand, or Inf, or NaN.  */
         ret  = (uint64_t)extract32(arg, 30, 2) << 62;
         ret |= ((extract32(arg, 30, 1) ^ 1) * (uint64_t)7) << 59;
-        ret |= (uint64_t)extract32(arg, 0, 29) << 29;
+        ret |= (uint64_t)extract32(arg, 0, 30) << 29;
     } else {
         /* Zero or Denormalized operand.  */
         ret = (uint64_t)extract32(arg, 31, 1) << 63;
@@ -88,14 +88,14 @@ uint32_t helper_tosingle(uint64_t arg)
     if (likely(exp > 896)) {
         /* No denormalization required (includes Inf, NaN).  */
         ret  = extract64(arg, 62, 2) << 30;
-        ret |= extract64(arg, 29, 29);
+        ret |= extract64(arg, 29, 30);
     } else {
         /* Zero or Denormal result.  If the exponent is in bounds for
          * a single-precision denormal result, extract the proper bits.
          * If the input is not zero, and the exponent is out of bounds,
          * then the result is undefined; this underflows to zero.
          */
-        ret = extract64(arg, 63, 1) << 63;
+        ret = extract64(arg, 63, 1) << 31;
         if (unlikely(exp >= 874)) {
             /* Denormal result.  */
             ret |= ((1ULL << 52) | extract64(arg, 0, 52)) >> (896 + 30 - exp);
-- 
2.17.1

  parent reply	other threads:[~2018-08-06  1:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-06  1:27 [Qemu-devel] [PATCH 0/2] target/ppc: Fixes for my fpu cleanups Richard Henderson
2018-08-06  1:27 ` [Qemu-devel] [PATCH 1/2] fixup! target/ppc: Honor fpscr_ze semantics and tidy fdiv Richard Henderson
2018-08-06  1:27 ` Richard Henderson [this message]
2018-08-06  2:50 ` [Qemu-devel] [PATCH 0/2] target/ppc: Fixes for my fpu cleanups David Gibson
2018-08-06 21:30 ` Mark Cave-Ayland

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=20180806012723.5639-3-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    /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 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 NNTP newsgroup(s).