All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Paul Brook <paul@codesourcery.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	patches@linaro.org
Subject: [Qemu-devel] [PATCH v2 1/6] target-arm: Don't set FP exceptions in recip, recip_sqrt estimate fns
Date: Thu, 19 May 2011 14:46:14 +0100	[thread overview]
Message-ID: <1305812779-23175-2-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1305812779-23175-1-git-send-email-peter.maydell@linaro.org>

The functions which do the core estimation algorithms for the VRSQRTE
and VRECPE instructions should not set floating point exception flags,
so use a local fp status for doing these calculations.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/helper.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/target-arm/helper.c b/target-arm/helper.c
index 62ae72e..5ff6a9b 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -2749,7 +2749,11 @@ float32 HELPER(rsqrts_f32)(float32 a, float32 b, CPUState *env)
  */
 static float64 recip_estimate(float64 a, CPUState *env)
 {
-    float_status *s = &env->vfp.standard_fp_status;
+    /* These calculations mustn't set any fp exception flags,
+     * so we use a local copy of the fp_status.
+     */
+    float_status dummy_status = env->vfp.standard_fp_status;
+    float_status *s = &dummy_status;
     /* q = (int)(a * 512.0) */
     float64 q = float64_mul(float64_512, a, s);
     int64_t q_int = float64_to_int64_round_to_zero(q, s);
@@ -2812,7 +2816,11 @@ float32 HELPER(recpe_f32)(float32 a, CPUState *env)
  */
 static float64 recip_sqrt_estimate(float64 a, CPUState *env)
 {
-    float_status *s = &env->vfp.standard_fp_status;
+    /* These calculations mustn't set any fp exception flags,
+     * so we use a local copy of the fp_status.
+     */
+    float_status dummy_status = env->vfp.standard_fp_status;
+    float_status *s = &dummy_status;
     float64 q;
     int64_t q_int;
 
-- 
1.7.1

  reply	other threads:[~2011-05-19 13:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 13:46 [Qemu-devel] [PATCH v2 0/6] target-arm: Fix bugs in fp exception flag setting Peter Maydell
2011-05-19 13:46 ` Peter Maydell [this message]
2011-05-19 13:46 ` [Qemu-devel] [PATCH v2 2/6] target-arm: Signal InputDenormal for VRECPE, VRSQRTE, VRECPS, VRSQRTS Peter Maydell
2011-05-19 13:46 ` [Qemu-devel] [PATCH v2 3/6] target-arm: Signal InvalidOp for Neon GE and GT compares of QNaN Peter Maydell
2011-05-19 13:46 ` [Qemu-devel] [PATCH v2 4/6] softfloat: Add new flag for when denormal result is flushed to zero Peter Maydell
2011-05-19 13:46 ` [Qemu-devel] [PATCH v2 5/6] target-arm: Signal Underflow when denormal flushed to zero on output Peter Maydell
2011-05-19 13:46 ` [Qemu-devel] [PATCH v2 6/6] target-arm: Use correct float status for Neon int-float conversions Peter Maydell
2011-05-25 20:49   ` Stefan Weil
2011-05-25 21:31     ` Peter Maydell
2011-05-23 21:33 ` [Qemu-devel] [PATCH v2 0/6] target-arm: Fix bugs in fp exception flag setting Aurelien Jarno

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=1305812779-23175-2-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=patches@linaro.org \
    --cc=paul@codesourcery.com \
    --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.