From patchwork Wed Sep 4 19:30:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 173019 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp404286ilq; Wed, 4 Sep 2019 13:28:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFyvsx+lquoyFTyHPE5f8C8ONUgRQfighA7oenjJ4LbAx1CaHPXPVsjLCD2amYj1u3sWD2 X-Received: by 2002:a50:fd95:: with SMTP id o21mr176361edt.6.1567628925766; Wed, 04 Sep 2019 13:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567628925; cv=none; d=google.com; s=arc-20160816; b=zdp8tUrKmWBp/m7vUfveqt043+CMSUveDgwPduN5SntvSUsXfyIyjZ0MFWM1LVmQG/ o0P6/PhNlI372RMAWhS2A+DtPZXwCaqqj45/EGVg6C/6xidQxKDcMxYR2VqDJq8spYGo CvQw3UpMcz+l8jR+Py9M4bPkzQQK5+VEat3/q/0HtDCQQGI9PJamKqDb+5EsqBcijqPC UkyhkInztOQ2/SbABR23CjFU7uS+sIkZHNIjEbGpZOadJh9ADfXT9I/0SQIuRZWhGKg/ YztgwcOTtOnkUL23RcBk2273cWcX87x1Sn2d10bz+8BwNC2MXVWvjra3R1xXUg7vo+AX A9DQ== 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=VzsNEJ79vBBXHa6di56eotbjbD089opoeS7FPmrAgFs=; b=DiIdS+yuRr4gNRh8NUNuh/o11WwQHbdaSGxkLu8ESWslSDzc702qjj/Fs1rXjK9pJt YiSUgf6X2I4OjTcsUdaOQcVNx5RGz3z98DaTIrRZZYqs0q6Hmt4pHKcmZ1suxmAIAlOh KhgObhtFWTVmvChQ86To+vIq425JRcB4gegaMqkf6n3SaVpeahkgIdgmy2zcStN43TqJ GH535hBndzQNz9pi1bqzMEcRDMm00ESOmOC2eYlucJuawkfUVejjDxqA9+yzqOv5Z7Ql qJCzvqpufJoO+9AJnLil/J3OJkLeQxUs4D2QwVfuGbcHcEJtWHq1PDoJOuegESLasziO 7bbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hYOf+kyO; 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 k23si5787211ede.274.2019.09.04.13.28.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2019 13:28:45 -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=hYOf+kyO; 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]:38754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5btT-0004jT-IB for patch@linaro.org; Wed, 04 Sep 2019 16:28:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40893) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5b0a-0005Hf-RU for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5b0Y-0002sx-Ti for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:32:00 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:34379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5b0Y-0002s8-M7 for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:31:58 -0400 Received: by mail-pf1-x441.google.com with SMTP id r12so1752236pfh.1 for ; Wed, 04 Sep 2019 12:31:58 -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=VzsNEJ79vBBXHa6di56eotbjbD089opoeS7FPmrAgFs=; b=hYOf+kyOC9AZ+E0vgO5tCaEmGZjWMRbuJk28WTnMTHv6EuLVa+7DBJc/eksBzZo3ei dfExrjpYNfdJRIuoi+MKnL2DXyOsStqRfz3w1yWlS2W+I/4h2uAtEtzo3RP3zhjJrGH9 tjaLNGjFGa8dBAVjJA7RWZZ6zNVMn3r80s/0kk//6JQMKkD4MVpYese8MTXahI9d9Osj pmXmn+dWSymsAAgUGwNvqFVZtnGGkwwD6/XATdAsSCKijQZHauCbH8kS18D67WEyUqP2 oH/NYHq1etyDOUttNqtOHaYJwQJbclcgrT+0dyhkXQoWHzyO2E0fyIX+ot7TW7vSgCA+ 5A5A== 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=VzsNEJ79vBBXHa6di56eotbjbD089opoeS7FPmrAgFs=; b=dJRrZAbBICfdO38G17a7kXcBrlGS1hvIIr+au48Tq8TSObIvz1ZnV3OwNoXx1gwhP8 tUgBy9UZt6T56JlhvnXPpEKpogXqSStEEuccTlN7KmOzXReuKcuYWx9sVjW91aA8HB3c XPiHIy8LHkxPJzd//BP9l4gGPQE5O9cFp/Vur7G7Gnmt/7yWbGuwtWaZhJtEtzv4Oy6e LLqOGkt5rGaq9pqTF/pyM1DiXA5bXBAzGfDsoR0dEc+b10jVSajkBu9SFcsBfISYyagx XzJrdTAtEGR0Y6oZAnBOk2Gpce/u5anFdYXpsj2cJxWG4LuLmkUgXYZxkjsZnP4RwC6z plTw== X-Gm-Message-State: APjAAAWhXWYv256b6oByvtzjFPiV+b/V/JzmCEbStnpGkopPjQWMXibt XWSMIcfo4YvbhngV7QyvNhaQYFepn20= X-Received: by 2002:a63:755e:: with SMTP id f30mr36601200pgn.246.1567625517269; Wed, 04 Sep 2019 12:31:57 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id f6sm18999174pga.50.2019.09.04.12.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 12:31:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 4 Sep 2019 12:30:34 -0700 Message-Id: <20190904193059.26202-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190904193059.26202-1-richard.henderson@linaro.org> References: <20190904193059.26202-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::441 Subject: [Qemu-devel] [PATCH v4 44/69] 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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 69 ++++++++++-------------------------------- 1 file changed, 16 insertions(+), 53 deletions(-) -- 2.17.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index f68e09ff1f..7f2a46100e 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10364,7 +10364,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. @@ -10374,7 +10374,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 @@ -10439,11 +10438,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; } @@ -10458,55 +10452,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; } }