From patchwork Fri Feb 1 16:06:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 157264 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp628611jaa; Fri, 1 Feb 2019 08:15:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Ynign70h8WgsyT4BDkrLQwgxqDbPUr9h2g08yyCNHEgBT+lTPkNSkDhVfDMIp8jYGCqHq X-Received: by 2002:a81:6c51:: with SMTP id h78mr38303768ywc.116.1549037739488; Fri, 01 Feb 2019 08:15:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549037739; cv=none; d=google.com; s=arc-20160816; b=u8yQGkFHTkY+tUndwzmtWWmyQJh28jf0hv5vL5GR0v4iTiokdCSWYXUe7bV+dysd9M dhB6c/7GJfMle3CiyncOMbnS6B5JGggrNdC7IuTfCQ4ZNuUQECMKmMQQNFsWjiVIbR/E 16kqyL++xTm0ig5ywW0+jSFik8psEZjs8plZq8xUg3MKMPxdBbEU5zxCKfCSo6BGIbrW KrW1ShxtOBECxJoto0t/tUGhHp76sM8vP7uQddYLB09g7BpVhfsRa255sCak6LCj1lpa o8WWOUeI18MZfCHsD/pMPvbdnyxC4Ft/UhrkSkuLXXp2CwkqgZ3WcrSb4ipjJ0oC8Qpw Qm+g== 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=MrOJl/A+jCc6+PPo6g/3qkoO1vm+u0CvNIntoD8P2+8=; b=xEVm9HlZSq5TTHWO1f2rc9vh31VN9hWE3sCo0NkhmzS3Zf5nEktfax2f+eugcjdpJz GIQY02nDtOTBQQ45DawI59WnoUvr0GUpVgPDdZZtyAX90i/VJaoEeqBFtw/28wYjyn7/ fLbC1Fuzfzv/YILoIXeQ0ChOJ0xXUr5AygAviCF6iR3ku/hL4TXfLtXU7wS2N7/QzGui 5lyb9afNdv9bsfRrmQRxUArAGpC0WCyZCc9kG5sc0z6tBmnjzZkhf834SeA0FJ4XhXaI f+GU4FhGOVdGQPI8Dtzg0FMvanw7Sn8sCEkNuqzwFAQbTOhjemJumDtQxqm38KRAIfSf Z3Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HtiAOu4s; 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 u65si4557791ybg.353.2019.02.01.08.15.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 01 Feb 2019 08:15:39 -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=HtiAOu4s; 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]:57372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbTe-0006zc-V7 for patch@linaro.org; Fri, 01 Feb 2019 11:15:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbMB-0008EP-F6 for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpbM9-0003h4-Mw for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:55 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:40197) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpbM9-0003TW-DW for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:53 -0500 Received: by mail-wm1-x335.google.com with SMTP id f188so6726860wmf.5 for ; Fri, 01 Feb 2019 08:07:32 -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=MrOJl/A+jCc6+PPo6g/3qkoO1vm+u0CvNIntoD8P2+8=; b=HtiAOu4sGRRf/Cq2w3GFHcnFDiCh6VwG6WKNGzc9ccmslNPt2h6U2ww+IvvYGrYavw hh40oowh4p8l6eBC6MEU0m6wLQyKK/fz16ftLNflkBzYc2LRD3bbvcEEGmuAakEeX1hz D4fVbOJjT6o0gGLI3/4lIFKxkbfpZWxuuHST0= 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=MrOJl/A+jCc6+PPo6g/3qkoO1vm+u0CvNIntoD8P2+8=; b=OktV5Inr2A9JPu/ABkSX9HotbuLIBUtOJaZV8PfiOjUwZqpNNhOc+9GFUdv9eAbsB0 qnyr09WV6bCVNjiJgx6iyGwEclJDMocyaFjhpihAcghZ3ndDFjlO34tWxvFaYzQHuNQb GH+uXuN+Uox2E7oOaPu2qcJK9Im1Hr3M3uG7Jc7e+e35o83QI47lK/xEEfVQeXNEyrtg c8/b0rJsyQ2h9R6RDKWKpnA1nkL8EgiUtAnIdKxikcTgkEbqxMqsDge9QHMRzHdp6RVj 8Qflzd4eV+s5QEl9/FPCOZKWFwFFjhZevFElCnOU/LXY/e5SBcuprwRCtb9kQNR+6Pb+ cNgA== X-Gm-Message-State: AHQUAuaCjI1f32tlSGyeSHO3hDi0Exnk86kBwCwtDXRvqnpTVpbnTU19 iHi4D7OssRvTzgjWKtMiW9yBsikQ0HVHAQ== X-Received: by 2002:a1c:790c:: with SMTP id l12mr1639693wme.11.1549037250975; Fri, 01 Feb 2019 08:07:30 -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.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 08:07:30 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 1 Feb 2019 16:06:33 +0000 Message-Id: <20190201160653.13829-28-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::335 Subject: [Qemu-devel] [PULL 27/47] target/arm/translate-a64: Don't underdecode SIMD ld/st multiple 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 multiple structures encodings, the non-post-indexed case should have zeroes in [20:16] (which is the Rm field for the post-indexed case). Correctly UNDEF the currently unallocated encodings which have non-zeroes in those bits. Reported-by: Laurent Desnogues Signed-off-by: Peter Maydell Reviewed-by: Laurent Desnogues Message-id: 20190125182626.9221-4-peter.maydell@linaro.org --- target/arm/translate-a64.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 8e081758e03..c1f0cad7691 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -3249,6 +3249,7 @@ static void disas_ldst_multiple_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 opcode = extract32(insn, 12, 4); bool is_store = !extract32(insn, 22, 1); @@ -3268,6 +3269,11 @@ static void disas_ldst_multiple_struct(DisasContext *s, uint32_t insn) return; } + if (!is_postidx && rm != 0) { + unallocated_encoding(s); + return; + } + /* From the shared decode logic */ switch (opcode) { case 0x0: @@ -3367,7 +3373,6 @@ static void disas_ldst_multiple_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 {