From patchwork Mon Feb 11 18:19:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Schnelle X-Patchwork-Id: 1040064 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=stackframe.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=duncanthrax.net header.i=@duncanthrax.net header.b="A7+nDej+"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43yvHv1tQvz9s6w for ; Tue, 12 Feb 2019 05:21:31 +1100 (AEDT) Received: from localhost ([127.0.0.1]:54250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtGCv-0004lz-5F for incoming@patchwork.ozlabs.org; Mon, 11 Feb 2019 13:21:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtGCA-0004l0-PW for qemu-devel@nongnu.org; Mon, 11 Feb 2019 13:20:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtGC2-0004Ga-43 for qemu-devel@nongnu.org; Mon, 11 Feb 2019 13:20:38 -0500 Received: from smtp.duncanthrax.net ([2001:470:70c5:1111::170]:43767) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtGC0-00049R-3V for qemu-devel@nongnu.org; Mon, 11 Feb 2019 13:20:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=duncanthrax.net; s=dkim; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=vF24kWHgrTMYfUv9NzUXfMuDsGDBl5RneRkUbQ+0S5g=; b=A7+nDej+XlGvcMllUfWnErnKSF NKt3kvUxc636IFfIEM3PZrZO9hcmNFu5GOqe3FvVc0tEhtf4qiIcy+7bh2PmNyV5qLWli6jsYQnZX PjVTDmvcjJF/ue1g1/4UzHBuZZRvSlFCmwTDzZSBh3JWtzNcON+X1+vKJF4ZguoOa44k=; Received: from hsi-kbw-109-193-150-175.hsi7.kabel-badenwuerttemberg.de ([109.193.150.175] helo=t470p.stackframe.org) by smtp.eurescom.eu with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1gtGBu-0007Z5-Dr; Mon, 11 Feb 2019 19:20:26 +0100 From: Sven Schnelle To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 19:19:07 +0100 Message-Id: <20190211181907.2219-6-svens@stackframe.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211181907.2219-2-svens@stackframe.org> References: <20190211181907.2219-2-svens@stackframe.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:70c5:1111::170 Subject: [Qemu-devel] [PATCH 5/5] target/hppa: fix dcor instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: deller@gmx.de, Sven Schnelle , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It looks like the operands where exchanged. HP bootrom tests the following sequence: 0x00000000f0004064: ldil L%-66666800,r7 0x00000000f0004068: addi 19f,r7,r7 0x00000000f000406c: addi -1,r0,rp 0x00000000f0004070: addi f,r0,r4 0x00000000f0004074: addi 1,r4,r5 0x00000000f0004078: dcor rp,r6 0x00000000f000407c: cmpb,<>,n r6,r7,0xf000411 This returned 0x66666661 instead of the expected 0x9999999f in QEMU. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index d858fabd3a..69c5a558fc 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2797,7 +2797,7 @@ static DisasJumpType trans_dcor(DisasContext *ctx, uint32_t insn, } tcg_gen_andi_reg(tmp, tmp, 0x11111111); tcg_gen_muli_reg(tmp, tmp, 6); - ret = do_unit(ctx, rt, tmp, load_gpr(ctx, r2), cf, false, + ret = do_unit(ctx, rt, load_gpr(ctx, r2), tmp, cf, false, is_i ? tcg_gen_add_reg : tcg_gen_sub_reg); return nullify_end(ctx, ret);