From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NK0lt-0002oq-EX for qemu-devel@nongnu.org; Sun, 13 Dec 2009 21:34:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NK0ls-0002np-0Q for qemu-devel@nongnu.org; Sun, 13 Dec 2009 21:34:48 -0500 Received: from [199.232.76.173] (port=59843 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NK0lr-0002nM-DH for qemu-devel@nongnu.org; Sun, 13 Dec 2009 21:34:47 -0500 Received: from are.twiddle.net ([75.149.56.221]:33408) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NK0lq-00012n-K6 for qemu-devel@nongnu.org; Sun, 13 Dec 2009 21:34:46 -0500 Message-Id: <5428d17fff3b0886e17451fba1edb884b1a23f03.1260755765.git.rth@twiddle.net> In-Reply-To: References: From: Richard Henderson Date: Sun, 13 Dec 2009 17:48:55 -0800 Subject: [Qemu-devel] [PATCH 4/5] target-alpha: Fix cvtlq. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org We were missing the 0xc0000000 mask, leading to incorrect results. Signed-off-by: Richard Henderson --- target-alpha/op_helper.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c index 8eba5ec..ff120ad 100644 --- a/target-alpha/op_helper.c +++ b/target-alpha/op_helper.c @@ -954,7 +954,9 @@ uint64_t helper_cvtqg (uint64_t a) uint64_t helper_cvtlq (uint64_t a) { - return (int64_t)((int32_t)((a >> 32) | ((a >> 29) & 0x3FFFFFFF))); + int32_t lo = a >> 29; + int32_t hi = a >> 32; + return (lo & 0x3FFFFFFF) | (hi & 0xc0000000); } static inline uint64_t __helper_cvtql(uint64_t a, int s, int v) -- 1.6.5.2