From patchwork Wed Feb 13 15:54:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 10810273 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 93344922 for ; Wed, 13 Feb 2019 16:08:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F12C29154 for ; Wed, 13 Feb 2019 16:08:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73E14290D2; Wed, 13 Feb 2019 16:08:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BCC22CFD6 for ; Wed, 13 Feb 2019 16:08:51 +0000 (UTC) Received: from localhost ([127.0.0.1]:59268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtx5f-0003dF-4R for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Feb 2019 11:08:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtwtB-0001lS-Ba for qemu-devel@nongnu.org; Wed, 13 Feb 2019 10:55:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtwt9-0002Yi-CU for qemu-devel@nongnu.org; Wed, 13 Feb 2019 10:55:57 -0500 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:43193) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtwt7-000214-Tg for qemu-devel@nongnu.org; Wed, 13 Feb 2019 10:55:55 -0500 Received: by mail-pf1-x443.google.com with SMTP id q17so1312865pfh.10 for ; Wed, 13 Feb 2019 07:55:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=subject:date:message-id:in-reply-to:references:cc:from:to; bh=7OEpEoCrDgblhCwQ9MN3mlSDqeTGypkU6eobIakpdj4=; b=bnKsabSArpwRvdJ6jX+4aKYZRxeOad7F46Py5MQhTjBZYDgnEVa0e3aEKYlDvWvS5w jw5UopxJKg9O2LthHXYgXK3HWTMB+ZvJ/ksHpDsQMXt7h8TjrGgDdgMrv7H5/HrlD8Qb GUzWdT9f/+gyfzGohBdsIGVDr9goL0YaCYHsk6wfz33B8BeHskoKv9ARhNrdV6IzDVtJ GysThrjmj8HvhGOd+x0iZHJGYjBlZslVnFNxS7g7P4fgbeeuo3hseKiWSIYURmb7cwon XWTxbNYMJPJDdPGRIRXMIy6au/FkKvVU2Mo9NzYt5PX8HRJA9WTILhu9crK35QbpN3bS R9ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :cc:from:to; bh=7OEpEoCrDgblhCwQ9MN3mlSDqeTGypkU6eobIakpdj4=; b=ALLViHBxpTszNXw32EUy9EXjnQbBSuwQl8nwMvEfdD5cQil7xWH2nz+aahvVGKtJbt YhrEqLD7MtoYSVDbvPa4ndkMkIMTVBW7Kzrxnft4ojNiF1vt6fbycF4kjW5oWpOiZXPK +K0RmAahpx5PGXd8g139M2S9n7xjpMfTtmWdXmBU5Nv+4lkk1ibrWes311MzpI7BC6lL IZFgOWfJeavs8X6tZfueN3zujRUgnkr5r8Tb6CVVGKLsJ/M8lXnTRTiuUjVnkNM4WQJp 8UTP0KT+0mdbrj6xlsM8Xon4VNIeFS+87vwXnfREiJsjjTsXbLqcsoNFeFSPsrNfHrok AA+Q== X-Gm-Message-State: AHQUAuZoN6DjssqeJFnIJt+F3ierrDAX+6tD7GJdrYQHxLwDUcwi5hUx maR5P04KRdT6ClO5UEdkl0TKL4uQX48= X-Google-Smtp-Source: AHgI3IbGla5NAKGtYTIADRt7q5ohA+WvT2ZQSgs+dNQj/0z0tA56J9ucE4VliNt8BXY9Opv1WOdxMg== X-Received: by 2002:a63:fa51:: with SMTP id g17mr1091691pgk.66.1550073325073; Wed, 13 Feb 2019 07:55:25 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id z127sm27429251pfb.80.2019.02.13.07.55.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 07:55:24 -0800 (PST) Date: Wed, 13 Feb 2019 07:54:09 -0800 Message-Id: <20190213155414.22285-31-palmer@sifive.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20190213155414.22285-1-palmer@sifive.com> References: <20190213155414.22285-1-palmer@sifive.com> From: Palmer Dabbelt To: qemu-riscv@nongnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 Subject: [Qemu-devel] [PATCH v7 30/35] target/riscv: Remove decode_RV32_64G() 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: Bastian Koppelmann , Peer Adelt , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Bastian Koppelmann decodetree handles all instructions now so the fallback is not necessary anymore. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt --- target/riscv/translate.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 65bedc966497..59c297915158 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -646,24 +646,6 @@ bool decode_insn16(DisasContext *ctx, uint16_t insn); #include "decode_insn16.inc.c" #include "insn_trans/trans_rvc.inc.c" -static void decode_RV32_64G(DisasContext *ctx) -{ - uint32_t op; - - /* We do not do misaligned address check here: the address should never be - * misaligned at this point. Instructions that set PC must do the check, - * since epc must be the address of the instruction that caused us to - * perform the misaligned instruction fetch */ - - op = MASK_OP_MAJOR(ctx->opcode); - - switch (op) { - default: - gen_exception_illegal(ctx); - break; - } -} - static void decode_opc(DisasContext *ctx) { /* check for compressed insn */ @@ -680,8 +662,7 @@ static void decode_opc(DisasContext *ctx) } else { ctx->pc_succ_insn = ctx->base.pc_next + 4; if (!decode_insn32(ctx, ctx->opcode)) { - /* fallback to old decoder */ - decode_RV32_64G(ctx); + gen_exception_illegal(ctx); } } }