qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Christophe Lyon <christophe.lyon@st.com>, patches@linaro.org
Subject: [Qemu-devel] [PATCH 2/2] target-arm: Fix 32 bit signed saturating narrow
Date: Wed,  9 Feb 2011 15:42:33 +0000	[thread overview]
Message-ID: <1297266153-5526-3-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1297266153-5526-1-git-send-email-peter.maydell@linaro.org>

The returned value when doing saturating signed 64->32 bit
conversion of a negative number was incorrect due to a missing cast.

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

diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c
index a7cf383..61890dd 100644
--- a/target-arm/neon_helper.c
+++ b/target-arm/neon_helper.c
@@ -1209,7 +1209,7 @@ uint32_t HELPER(neon_narrow_sat_s32)(CPUState *env, uint64_t x)
 {
     if ((int64_t)x != (int32_t)x) {
         SET_QC();
-        return (x >> 63) ^ 0x7fffffff;
+        return ((int64_t)x >> 63) ^ 0x7fffffff;
     }
     return x;
 }
-- 
1.7.1

  parent reply	other threads:[~2011-02-09 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09 15:42 [Qemu-devel] [PATCH 0/2] target-arm: Fix VQMOV(U)N Peter Maydell
2011-02-09 15:42 ` [Qemu-devel] [PATCH 1/2] target-arm: Fix VQMOVUN Neon instruction Peter Maydell
2011-02-09 15:42 ` Peter Maydell [this message]
2011-02-09 18:46 ` [Qemu-devel] [PATCH 0/2] target-arm: Fix VQMOV(U)N 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=1297266153-5526-3-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=christophe.lyon@st.com \
    --cc=patches@linaro.org \
    --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).