From patchwork Tue Jan 8 22:31:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 155016 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp37416jaa; Tue, 8 Jan 2019 14:40:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN5V1o50QANr/ChAejWTxpI6jh0pk4gdma2B9T+FvUNuh5X2xoeTZbbxMs+xRyHtXSFUAvI7 X-Received: by 2002:a1c:87cc:: with SMTP id j195mr3090793wmd.2.1546987244819; Tue, 08 Jan 2019 14:40:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546987244; cv=none; d=google.com; s=arc-20160816; b=Rwzrhrd+ad6AvLPC5M1Rb8SrvaEf4tpbDQVK/cN6nLlCXQKmKVQYhTXfBQR/NUbtPp 1W8k8+Wsq0ex10xcmdYxnW50qdwiajpO68DqrkpfaE5qoj2bY1oVWKj9oK2emdO48Hk6 WqRYSbF93Gg9eVZ6NB0UfKidAypWvGFvvNPA9fO/lK3F2kzfjDVR1r/46SwR1a90gu0y 6tTQYfBHaZRW+9XDy5saeDaLruWxxGhnExsxX7Wm4TQnlUH7w1CX9yM1w1hYR9vump7T QDthCd196kUr7Ls216XB78MeLAGGthsnoXjsyAc6DMASsS8kG0S9CCkPoP4DR+DvZyIF vv5A== 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=vn+yRU/rmAqgBGT/k9IA0vQaUDDZLiUOVZPLPr+Ejm8=; b=g49vQG8R5xFsYDoqTAvLS0xpR5BJsvVWOqXbQDJfY/nGbacyeAbpjEqYmshUtHFhZB q4CmUbiyrVnhUHS2gl6JxO8eryfzfgiZapZ+9Zn9RHXLPv2PlM5VuvbufewoNJQ1VKJB 8CiUWSNDNwpkwCkSVCOsO/NTvr+3+y2EPsVklBR8IxFFNW2BGJ7Wi+aU3+Qt8tGEV1Wa xIZcDKmJQIs9Mxw1tNYC0JTQPLxYCGCyMg8hFc5boHjzLP1kIP8eiFQG4gOe/qIerf3j zTG9ow2F/egRORuaaGNuOvQCf2S/lw+P2RJdprMSViklBTnW0/lR5wIvFAukCieRWEi/ Ev4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hwsJB3lJ; 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 d69si7556482wmd.74.2019.01.08.14.40.44 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 Jan 2019 14:40:44 -0800 (PST) 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=hwsJB3lJ; 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 ([127.0.0.1]:41590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gh039-0006qg-MB for patch@linaro.org; Tue, 08 Jan 2019 17:40:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggzue-0008AY-9L for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:31:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggzud-0004Px-Gh for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:31:56 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:35300) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggzud-0004P4-Av for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:31:55 -0500 Received: by mail-pl1-x644.google.com with SMTP id p8so2576248plo.2 for ; Tue, 08 Jan 2019 14:31:55 -0800 (PST) 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=vn+yRU/rmAqgBGT/k9IA0vQaUDDZLiUOVZPLPr+Ejm8=; b=hwsJB3lJhqwc1/sRd63VVnxZH9+mLrABx3VrpfI6VTvMBL7FF9DpGd+yyvT54VK5LA zEiKCKR/JjAMKLml6Fwo3ixwFuz7Vm7lhl5V0V0R7PpSpUEq7FZXhaGr0h0XuTV6lcHA Lh/CKcPFQNSSOq+MlRoVENco67HItvXB4nC54= 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=vn+yRU/rmAqgBGT/k9IA0vQaUDDZLiUOVZPLPr+Ejm8=; b=LFfxcSaLrigbWlDrUxI00GwI2FjMme+/viNzUo33TZu8+6WaepS5thyE26oAqZLvr7 J22rPsAn32mRWte7G+aXXIUjk0GCC31oEbq226E50sQUbFPfe8n81WVa0Uqgw9XU0Xzq i7TGMpI+zxVUPxFqnb4LJz7Hc3Qya9qr0QVP3YCz3CkC69QWDwEGAf0O5ZWFflpRM1u6 U1P0IbOOdY/ct3q2MYNzoVPr+yOQF1RCMPFOh3/uHfm13blSeelWf5CEw2U3z7M3FNEi A9dNl8dg41Ti160pL0wmSCIOp3OvVkbJL1bsx0WlnOUP+7qc8j/8cllkeon6FTBmOsIa Ghhw== X-Gm-Message-State: AJcUukchdYQRSHLJfLjH9vnM0dwTngiKiVse+0JpSxYszw0Ydx+bnBVy LRl0iCB6u8kjRdRj7yg0T8cdmbvMdZU= X-Received: by 2002:a17:902:b090:: with SMTP id p16mr3603596plr.190.1546986713869; Tue, 08 Jan 2019 14:31:53 -0800 (PST) Received: from cloudburst.lan (2001-44b8-2176-c800-8cc6-2630-7d99-5ef1.static.ipv6.internode.on.net. [2001:44b8:2176:c800:8cc6:2630:7d99:5ef1]) by smtp.gmail.com with ESMTPSA id w128sm100686177pfw.79.2019.01.08.14.31.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 14:31:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 9 Jan 2019 08:31:05 +1000 Message-Id: <20190108223129.5570-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190108223129.5570-1-richard.henderson@linaro.org> References: <20190108223129.5570-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::644 Subject: [Qemu-devel] [PATCH v3 07/31] target/arm: Rearrange decode in disas_data_proc_1src 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Now properly signals unallocated for REV64 with SF=0. Allows for the opcode2 field to be decoded shortly. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) -- 2.17.2 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index b72aea3e97..dac61a3c3a 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -4563,38 +4563,51 @@ static void handle_rev16(DisasContext *s, unsigned int sf, */ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) { - unsigned int sf, opcode, rn, rd; + unsigned int sf, opcode, opcode2, rn, rd; - if (extract32(insn, 29, 1) || extract32(insn, 16, 5)) { + if (extract32(insn, 29, 1)) { unallocated_encoding(s); return; } sf = extract32(insn, 31, 1); opcode = extract32(insn, 10, 6); + opcode2 = extract32(insn, 16, 5); rn = extract32(insn, 5, 5); rd = extract32(insn, 0, 5); - switch (opcode) { - case 0: /* RBIT */ +#define MAP(SF, O2, O1) ((SF) | (O1 << 1) | (O2 << 7)) + + switch (MAP(sf, opcode2, opcode)) { + case MAP(0, 0x00, 0x00): /* RBIT */ + case MAP(1, 0x00, 0x00): handle_rbit(s, sf, rn, rd); break; - case 1: /* REV16 */ + case MAP(0, 0x00, 0x01): /* REV16 */ + case MAP(1, 0x00, 0x01): handle_rev16(s, sf, rn, rd); break; - case 2: /* REV32 */ + case MAP(0, 0x00, 0x02): /* REV/REV32 */ + case MAP(1, 0x00, 0x02): handle_rev32(s, sf, rn, rd); break; - case 3: /* REV64 */ + case MAP(1, 0x00, 0x03): /* REV64 */ handle_rev64(s, sf, rn, rd); break; - case 4: /* CLZ */ + case MAP(0, 0x00, 0x04): /* CLZ */ + case MAP(1, 0x00, 0x04): handle_clz(s, sf, rn, rd); break; - case 5: /* CLS */ + case MAP(0, 0x00, 0x05): /* CLS */ + case MAP(1, 0x00, 0x05): handle_cls(s, sf, rn, rd); break; + default: + unallocated_encoding(s); + break; } + +#undef MAP } static void handle_div(DisasContext *s, bool is_signed, unsigned int sf,