From patchwork Mon Aug 19 21:37:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171710 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3561781ily; Mon, 19 Aug 2019 15:18:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNRw/zyIWdhZawcRQlPFYy1NFIh9yg2N5ZxpOkiVj6+3Yu4eQw32wt3L8jaeQndNbxpdi9 X-Received: by 2002:ac8:1807:: with SMTP id q7mr23201363qtj.180.1566253083064; Mon, 19 Aug 2019 15:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566253083; cv=none; d=google.com; s=arc-20160816; b=T8qHGurUm/n9fB8APXIKH06OKbnyOyafVTahOujTBl8k7Nr05a/GKhP3N+ybpXu5Cc E521Lnd1h7MldQD4cPQfbTo/V7eKpWQ/3Tv1XOFX/V3GouffqXNLdksOWTuHAtPcanxc OmuQcZLKFXgOws16uFBDHd8aG9OEfIRKXX+d2DdXpSsG7nNM2JTrb2dFcp0LJubnQHbN JI0BRyKvfFpId55WNPMP3nO180s4s2h9NakZdpPjce/x6OEmouEwNPxWd85Z5zotMmZc wTChUTPXfm15GskKmfScZqpk5e9Ms6CR6mQ90BOyBJXZIHjI9KMVBle3hsEmZhHfAp7O RrXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=c57Ge3veQfkyW7vksKvqnmVUD20AJ8LyQ3MkWHHu68w=; b=PWmddN1kpox4XFm/8LKnTZ/i174C0XOopwURM6mXwzHcgOQCBzPIBeFERy8l+JYyp4 5OHpKG6LbZVWPT1D3Gu3u3gGyH9Tn1u3FG2/kZwCBfZ1OjwH02AHqEQ6bsUsCaAZ12dI X8R+c3WH4ZEIkxkxudBAQ74hguqGo0Itw4aAbGKajtv6sKYfO3CxG3zod/PTxmKSgEue CSIfl0ioht68yUbmXk5y/vKbx/jNxT9KAK4LlDA2Us6CgcS06XKGBFulybwtkrvGyO/v Zw970CL/jAuqBZ07ImzPg2LjvX4U3DpzzYGxhLQhgHzPAOrp9XAgEgWb13k8Mr8jfMg3 OFEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DCwIxhDj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j30si6928274qtc.382.2019.08.19.15.18.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 15:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DCwIxhDj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpyU-000472-5B for patch@linaro.org; Mon, 19 Aug 2019 18:18:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59592) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzpMf-0002S8-Bt for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:38:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzpMd-0006ci-8y for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:38:57 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:41490) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzpMb-0006ZH-8T for qemu-devel@nongnu.org; Mon, 19 Aug 2019 17:38:54 -0400 Received: by mail-pl1-x641.google.com with SMTP id m9so1578429pls.8 for ; Mon, 19 Aug 2019 14:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c57Ge3veQfkyW7vksKvqnmVUD20AJ8LyQ3MkWHHu68w=; b=DCwIxhDjQ+vIrTflFcWht7h6SrT3HijQEDrF5uGuRMnbgQOyuOcrOKlpTCutUHMmuJ HAh2+h4AHBPd19EdTEL1xc7uY4xoEEu8177qgEDabglk7DaGwaD7UiSHzlC0064M9WbC JYfeK/IwyV6eKqmM0K35aSn1SG7EOSYg7aXa3Nw3AEC1M9vh8URAk9Iq5RPK88/I2VqS 8x0wCL+rHUgMQbsIjgglapkD2a/N5HVUEXNawSNd65/Mf2GhIY3pv5aivlg/QydC0guF ZRV754R0xllZtGSptpPtFh6gyBAim+exDg4tfLExGwmQZrdE9f5Pc0CC0uZ6FTE82m6u ozrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c57Ge3veQfkyW7vksKvqnmVUD20AJ8LyQ3MkWHHu68w=; b=UU4ok+YOFT33nfmrugHF+mPFFv8P1VolHA1gKbinhMeBR1pN2/wj7tPLp3GVd8e/i3 zsMHCaGtt8kvtEzqDRFvGFtqUYSTG2xcOxpU1Kr7uddY5hD0mfD90/9eQhKQMHagfRez ULuF9UyMHJMCM1J7jDkpiNUdh2unhlcBAX71qm7W2v/ZhKkevgIRTmGanyazs7h3ZTfE GdtHNEKzOyag46schsfAJUYx6hfmaY6mozUyQA4E24q+bBZsGC3iRDvS8m8N5hhAkwCS j6zK80m4TGvf6BMW8P8P48/GQSwlvxukTYjxmHqjm7cKqdpmjibhHX7rFDxCtJoqimPZ 63FA== X-Gm-Message-State: APjAAAXzplIZ3PU1rX/9ADCkN/hKZuLDJLnr+sNPDf2QIRI0T7TA27bC FKniH0R9dx7TSVtUczzn0Cy287BFNk8= X-Received: by 2002:a17:902:e48d:: with SMTP id cj13mr2127884plb.177.1566250729553; Mon, 19 Aug 2019 14:38:49 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id d2sm13446951pjs.21.2019.08.19.14.38.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 14:38:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Aug 2019 14:37:30 -0700 Message-Id: <20190819213755.26175-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190819213755.26175-1-richard.henderson@linaro.org> References: <20190819213755.26175-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::641 Subject: [Qemu-devel] [PATCH v2 43/68] target/arm: Simplify disas_arm_insn X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Fold away all of the cases that now just goto illegal_op, because all of their internal bits are now in decodetree. Signed-off-by: Richard Henderson --- target/arm/translate.c | 69 ++++++++++-------------------------------- 1 file changed, 16 insertions(+), 53 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 25c74206c2..49bab7d863 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10245,7 +10245,7 @@ static bool trans_PLI(DisasContext *s, arg_PLD *a) static void disas_arm_insn(DisasContext *s, unsigned int insn) { - unsigned int cond, op1; + unsigned int cond = insn >> 28; /* M variants do not implement ARM mode; this must raise the INVSTATE * UsageFault exception. @@ -10255,7 +10255,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) default_exception_el(s)); return; } - cond = insn >> 28; if (cond == 0xf) { /* In ARMv3 and v4 the NV condition is UNPREDICTABLE; we @@ -10320,11 +10319,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) goto illegal_op; } return; - } else if ((insn & 0x0fe00000) == 0x0c400000) { - /* Coprocessor double register transfer. */ - ARCH(5TE); - } else if ((insn & 0x0f000010) == 0x0e000010) { - /* Additional coprocessor register transfer. */ } goto illegal_op; } @@ -10339,55 +10333,24 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) } /* fall back to legacy decoder */ - if ((insn & 0x0f900000) == 0x03000000) { - /* All done in decodetree. Illegal ops reach here. */ - goto illegal_op; - } else if ((insn & 0x0f900000) == 0x01000000 - && (insn & 0x00000090) != 0x00000090) { - /* miscellaneous instructions */ - /* All done in decodetree. Illegal ops reach here. */ - goto illegal_op; - } else if (((insn & 0x0e000000) == 0 && - (insn & 0x00000090) != 0x90) || - ((insn & 0x0e000000) == (1 << 25))) { - /* Data-processing (reg, reg-shift-reg, imm). */ - /* All done in decodetree. Reach here for illegal ops. */ - goto illegal_op; - } else { - /* other instructions */ - op1 = (insn >> 24) & 0xf; - switch(op1) { - case 0x0: - case 0x1: - case 0x4: - case 0x5: - case 0x6: - case 0x7: - case 0x08: - case 0x09: - case 0xa: - case 0xb: - case 0xf: - /* All done in decodetree. Reach here for illegal ops. */ - goto illegal_op; - case 0xc: - case 0xd: - case 0xe: - if (((insn >> 8) & 0xe) == 10) { - /* VFP. */ - if (disas_vfp_insn(s, insn)) { - goto illegal_op; - } - } else if (disas_coproc_insn(s, insn)) { - /* Coprocessor. */ + switch ((insn >> 24) & 0xf) { + case 0xc: + case 0xd: + case 0xe: + if (((insn >> 8) & 0xe) == 10) { + /* VFP. */ + if (disas_vfp_insn(s, insn)) { goto illegal_op; } - break; - default: - illegal_op: - unallocated_encoding(s); - break; + } else if (disas_coproc_insn(s, insn)) { + /* Coprocessor. */ + goto illegal_op; } + break; + default: + illegal_op: + unallocated_encoding(s); + break; } }