All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PULL v2 1/8] target/m68k: define floatx80_move()
Date: Fri,  9 Mar 2018 15:57:10 +0100	[thread overview]
Message-ID: <20180309145717.9603-2-laurent@vivier.eu> (raw)
In-Reply-To: <20180309145717.9603-1-laurent@vivier.eu>

This functions is needed by upcoming m68k softfloat functions.

Source code copied for WinUAE (tag 3500)
(The WinUAE file has been copied from QEMU and has
the QEMU licensing notice)

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20180305203910.10391-2-laurent@vivier.eu>
---
 target/m68k/softfloat.c | 27 +++++++++++++++++++++++++++
 target/m68k/softfloat.h |  1 +
 2 files changed, 28 insertions(+)

diff --git a/target/m68k/softfloat.c b/target/m68k/softfloat.c
index 9cb141900c..55eb7a260a 100644
--- a/target/m68k/softfloat.c
+++ b/target/m68k/softfloat.c
@@ -247,3 +247,30 @@ floatx80 floatx80_scale(floatx80 a, floatx80 b, float_status *status)
     return roundAndPackFloatx80(status->floatx80_rounding_precision,
                                 aSign, aExp, aSig, 0, status);
 }
+
+floatx80 floatx80_move(floatx80 a, float_status *status)
+{
+    flag aSign;
+    int32_t aExp;
+    uint64_t aSig;
+
+    aSig = extractFloatx80Frac(a);
+    aExp = extractFloatx80Exp(a);
+    aSign = extractFloatx80Sign(a);
+
+    if (aExp == 0x7FFF) {
+        if ((uint64_t)(aSig << 1)) {
+            return propagateFloatx80NaNOneArg(a, status);
+        }
+        return a;
+    }
+    if (aExp == 0) {
+        if (aSig == 0) {
+            return a;
+        }
+        normalizeRoundAndPackFloatx80(status->floatx80_rounding_precision,
+                                      aSign, aExp, aSig, 0, status);
+    }
+    return roundAndPackFloatx80(status->floatx80_rounding_precision, aSign,
+                                aExp, aSig, 0, status);
+}
diff --git a/target/m68k/softfloat.h b/target/m68k/softfloat.h
index 78fbc0cd0c..18561b870d 100644
--- a/target/m68k/softfloat.h
+++ b/target/m68k/softfloat.h
@@ -26,4 +26,5 @@ floatx80 floatx80_mod(floatx80 a, floatx80 b, float_status *status);
 floatx80 floatx80_getman(floatx80 a, float_status *status);
 floatx80 floatx80_getexp(floatx80 a, float_status *status);
 floatx80 floatx80_scale(floatx80 a, floatx80 b, float_status *status);
+floatx80 floatx80_move(floatx80 a, float_status *status);
 #endif
-- 
2.14.3

  reply	other threads:[~2018-03-09 14:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 14:57 [Qemu-devel] [PULL v2 0/8] M68k for 2.12 patches Laurent Vivier
2018-03-09 14:57 ` Laurent Vivier [this message]
2018-03-09 14:57 ` [Qemu-devel] [PULL v2 2/8] target/m68k: implement flognp1 Laurent Vivier
2018-03-09 14:57 ` [Qemu-devel] [PULL v2 3/8] target/m68k: implement flogn Laurent Vivier
2018-03-09 14:57 ` [Qemu-devel] [PULL v2 4/8] target/m68k: implement flog10 Laurent Vivier
2018-03-09 14:57 ` [Qemu-devel] [PULL v2 5/8] target/m68k: implement flog2 Laurent Vivier
2018-03-09 14:57 ` [Qemu-devel] [PULL v2 6/8] target/m68k: implement fetox Laurent Vivier
2018-03-09 14:57 ` [Qemu-devel] [PULL v2 7/8] target/m68k: implement ftwotox Laurent Vivier
2018-03-09 14:57 ` [Qemu-devel] [PULL v2 8/8] target/m68k: implement ftentox Laurent Vivier
2018-03-12 10:07 ` [Qemu-devel] [PULL v2 0/8] M68k for 2.12 patches Peter Maydell

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=20180309145717.9603-2-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --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 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.