From patchwork Fri Dec 11 17:07:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 40940 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 9DD0EB70BA for ; Sat, 12 Dec 2009 12:37:29 +1100 (EST) Received: from localhost ([127.0.0.1]:59718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJGvG-0008FM-LG for incoming@patchwork.ozlabs.org; Fri, 11 Dec 2009 20:37:26 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NJGhw-0007qd-Q4 for qemu-devel@nongnu.org; Fri, 11 Dec 2009 20:23:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NJGhr-0007ns-Jw for qemu-devel@nongnu.org; Fri, 11 Dec 2009 20:23:36 -0500 Received: from [199.232.76.173] (port=54753 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJGhp-0007mR-Ld for qemu-devel@nongnu.org; Fri, 11 Dec 2009 20:23:33 -0500 Received: from are.twiddle.net ([75.149.56.221]:43437) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NJGhn-000362-Rh for qemu-devel@nongnu.org; Fri, 11 Dec 2009 20:23:32 -0500 Received: by are.twiddle.net (Postfix, from userid 5000) id 85CD8C8C; Fri, 11 Dec 2009 17:23:30 -0800 (PST) Message-Id: <3dbad27d28a1778bdb9442458bb3efa414c6a9bf.1260580414.git.rth@twiddle.net> In-Reply-To: References: From: Richard Henderson Date: Fri, 11 Dec 2009 09:07:29 -0800 To: qemu-devel@nongnu.org MIME-Version: 1.0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 05/13] alpha: Fix fbcond branch offset. 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 The instructions use a disp21 like all other branch insns, not the disp16 that was being passed. Signed-off-by: Richard Henderson --- target-alpha/translate.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/target-alpha/translate.c b/target-alpha/translate.c index 5e139e6..cabf75a 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -314,8 +314,7 @@ static inline void gen_bcond(DisasContext *ctx, TCGCond cond, int ra, gen_set_label(l2); } -static inline void gen_fbcond(DisasContext *ctx, int opc, int ra, - int32_t disp16) +static inline void gen_fbcond(DisasContext *ctx, int opc, int ra, int32_t disp) { int l1, l2; TCGv tmp; @@ -356,7 +355,7 @@ static inline void gen_fbcond(DisasContext *ctx, int opc, int ra, tcg_gen_movi_i64(cpu_pc, ctx->pc); tcg_gen_br(l2); gen_set_label(l1); - tcg_gen_movi_i64(cpu_pc, ctx->pc + (int64_t)(disp16 << 2)); + tcg_gen_movi_i64(cpu_pc, ctx->pc + (int64_t)(disp << 2)); gen_set_label(l2); } @@ -2335,7 +2334,7 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn) case 0x31: /* FBEQ */ case 0x32: /* FBLT */ case 0x33: /* FBLE */ - gen_fbcond(ctx, opc, ra, disp16); + gen_fbcond(ctx, opc, ra, disp21); ret = 1; break; case 0x34: @@ -2348,7 +2347,7 @@ static inline int translate_one(DisasContext *ctx, uint32_t insn) case 0x35: /* FBNE */ case 0x36: /* FBGE */ case 0x37: /* FBGT */ - gen_fbcond(ctx, opc, ra, disp16); + gen_fbcond(ctx, opc, ra, disp21); ret = 1; break; case 0x38: