From patchwork Fri Feb 1 16:06:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 157296 Delivered-To: patch@linaro.org Received: by 2002:ac9:7558:0:0:0:0:0 with SMTP id r24csp615140oct; Fri, 1 Feb 2019 08:45:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN7upJQ7JiDsErAEQQz37uNxW9c0JxbgQfAqXHmMC+nTPjEQ4iXf3pv7CCuyJKJCg+fNTuKs X-Received: by 2002:a25:73d0:: with SMTP id o199mr36796484ybc.242.1549039503463; Fri, 01 Feb 2019 08:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549039503; cv=none; d=google.com; s=arc-20160816; b=vR2cdFS6A8gpM/BfCQj8k0F0LoZJY3YBqJmnNrOMrYlsC6rGLI0IhEz+5XHzcWq5RV r59eu/ANcPi5pQwaF2LmZ9MWldfyXbjnoyAqKlSZOet469DDW6Dmd1uy1J4rJJUV443+ TmhJUmPMtXhSDVjDAT0RpYiKKJqR4/yXvYEktfWyzJXphdpqoru3Lh1z37+CzCw5ztjX S38k6ZHNs2PHvcvwp42HjxsFrsbVzv3O47FrUVvVDUWwa9hSKFxeNhCftDnOdrNCmq/T 6snJzigFsJ1/X/iQk85Z1N0GM9IHzk3KlPRwNEpSFKGJHqpmNm4XTjsRFDqFFxeUvvyD ZKcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=bk+d+QUXl/9IknQrBZaMCa4GLbMftlOnnn9k98C3MVo=; b=wriBbbWhE0hpDQcxuE8N4iAq9Fa5+j80eM8s3Sv+g9vVH47ugaSq5BQTguvLFk1l0b 1WT/7cVtBQddPcWEHi83+gtjJYzx0X62HTU0eLRN8rCyHFc+ItzCuwVxdrWuAf+xyRIm WWEMTi7quSbCl3twv3yBPamhmbgsdpes9mJ/zmaGYaO1NpCBE0fUhhMuMj8atX1o5Nkz 53JV7F1/6w1GINva91Javu0u2wF3sm50xYa6FbnGTNjVsf30+f1jhhpt8Kxrq84dEwJ+ aazbG/ptS8lNw8VvBMp04zxAYfMUEcQfcUU+0SvQ9c0Ae40XmxYcWtyN0tkHrCGWP77z S5dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Hq7ovbjn; 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 i192si4802023ywg.284.2019.02.01.08.45.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 01 Feb 2019 08:45:03 -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=Hq7ovbjn; 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]:57772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbw6-0005Mi-T6 for patch@linaro.org; Fri, 01 Feb 2019 11:45:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbMH-0008J2-M0 for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:08:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpbMC-0003lz-87 for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:08:01 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:46409) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpbMB-0003To-Uu for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:56 -0500 Received: by mail-wr1-x42d.google.com with SMTP id l9so7609865wrt.13 for ; Fri, 01 Feb 2019 08:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=bk+d+QUXl/9IknQrBZaMCa4GLbMftlOnnn9k98C3MVo=; b=Hq7ovbjndB0E8IEXWucHGHJYHyarRuD4AOfu3Qp/QnDvkRTrrGeUxp3mjp0rbnN8Os DbfZjpodr6k2pM22d6Q47tWB8gEmoqzGVVkU1I4TH0J9Ic/AIRFycA0z4LIPO0Cm+sur qnuIAI9VINMQav8kVIUcYKsj3DDIqIiHhxLX4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bk+d+QUXl/9IknQrBZaMCa4GLbMftlOnnn9k98C3MVo=; b=C/qRZi6+AFFUhDvBUMSuahRSze1T6Fh3cxYrGBk6R0y38cYDgIva3/H23qrx53nmpm xy6cEs/n+uIeSLPUGxn8+SJe6Wa+DkqhDqhNwt5PTuyc58wmhm70WlLAV/z1aqqipI21 zAA6iYzW6StqhcSf5uACnB5teBf8kwkeGi6tLpsCyZG+b0f/No/09lWFCGhz1Erls3AX 8bJG7e0X/ZFZypl+6hOVAdDxU4d2EirDySbFyCI/ksMzVnfe1OcXQPbHo1dqzxOhG8MQ LFaVXUq4HaT/1s0awYEhQXVILp8Pg2SMt3nOWjf6kAyEQT5gXNnn/dNhC0S2SLGMInxG WmwA== X-Gm-Message-State: AHQUAuamlerkaNeZ3v8jkyK5HzG+zjijS9dB8vQHeqZ+TSWSQf8xrm8C 2aZepwKI/VtvZzvtqxW1nMhh/ipeL73U8A== X-Received: by 2002:a5d:52cc:: with SMTP id r12mr2688195wrv.277.1549037252159; Fri, 01 Feb 2019 08:07:32 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n6sm2847250wmk.9.2019.02.01.08.07.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 08:07:31 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 1 Feb 2019 16:06:34 +0000 Message-Id: <20190201160653.13829-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190201160653.13829-1-peter.maydell@linaro.org> References: <20190201160653.13829-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d Subject: [Qemu-devel] [PULL 28/47] target/arm/translate-a64: Don't underdecode SIMD ld/st single 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In the AdvSIMD load/store single structure encodings, the non-post-indexed case should have zeroes in [20:16] (which is the Rm field for the post-indexed case). Bit 31 must also be zero (a check we got right in ldst_multiple but not here). Correctly UNDEF these unallocated encodings. Reported-by: Laurent Desnogues Signed-off-by: Peter Maydell Reviewed-by: Laurent Desnogues Message-id: 20190125182626.9221-5-peter.maydell@linaro.org --- target/arm/translate-a64.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index c1f0cad7691..2cade64ed25 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -3409,6 +3409,7 @@ static void disas_ldst_single_struct(DisasContext *s, uint32_t insn) { int rt = extract32(insn, 0, 5); int rn = extract32(insn, 5, 5); + int rm = extract32(insn, 16, 5); int size = extract32(insn, 10, 2); int S = extract32(insn, 12, 1); int opc = extract32(insn, 13, 3); @@ -3424,6 +3425,15 @@ static void disas_ldst_single_struct(DisasContext *s, uint32_t insn) int ebytes, xs; TCGv_i64 tcg_addr, tcg_rn, tcg_ebytes; + if (extract32(insn, 31, 1)) { + unallocated_encoding(s); + return; + } + if (!is_postidx && rm != 0) { + unallocated_encoding(s); + return; + } + switch (scale) { case 3: if (!is_load || S) { @@ -3501,7 +3511,6 @@ static void disas_ldst_single_struct(DisasContext *s, uint32_t insn) } if (is_postidx) { - int rm = extract32(insn, 16, 5); if (rm == 31) { tcg_gen_mov_i64(tcg_rn, tcg_addr); } else {