From patchwork Mon Dec 14 01:48:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 41059 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E4C28B6F08 for ; Mon, 14 Dec 2009 13:39:59 +1100 (EST) Received: from localhost ([127.0.0.1]:49194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NK0qq-0004kt-Vj for incoming@patchwork.ozlabs.org; Sun, 13 Dec 2009 21:39:57 -0500 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 Received: by are.twiddle.net (Postfix, from userid 5000) id C2136D6C; Sun, 13 Dec 2009 18:34:45 -0800 (PST) Message-Id: <5428d17fff3b0886e17451fba1edb884b1a23f03.1260755765.git.rth@twiddle.net> In-Reply-To: References: From: Richard Henderson Date: Sun, 13 Dec 2009 17:48:55 -0800 To: qemu-devel@nongnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 4/5] target-alpha: Fix cvtlq. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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)