From patchwork Fri Feb 1 16:06:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 157261 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp625413jaa; Fri, 1 Feb 2019 08:13:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IbcOMtSzU6cS9WywE680wNkNZgXeibwd1rv4XaaKOiakBb7dZl17ba423M9OUjSqhXZvtSt X-Received: by 2002:a25:1c5:: with SMTP id 188mr6750820ybb.496.1549037585817; Fri, 01 Feb 2019 08:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549037585; cv=none; d=google.com; s=arc-20160816; b=NAnxxSnC9fqwx+RGKF1Fem48VfCiZoyXdazseZW1huv8EU9czxjROoDkEkzz1HuPnX ttKGkeraluUGkxJYIdAlPDz/DtrXldvtXar2g/a3svDLMxziA34pMj9vm84oiY0wXvT/ XOV2NZEbClzKfbAD1uuTgJPeM0AbZl+MUOAzhwQPfjrPZyj2aTVGvQxVPUywhCGP5q3V 0Iri9EpqgAK1hzq/xscMYSE8y0OTublbHU5z7Crs8VJZZ2utxtt4mPd+2VPmaczApemO pUWQy6NU+xeyjvU8pCOwJFI1tBp9N/EfXMQ7Mq417kzEI2U7zPDHOJTGXbMu1jtPl63v u7MQ== 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=BuUcoEKEWFa2gs0tJtZIl2sLfc48bCl+guXN5IwAbi4=; b=T6zaCUKTUZbC4VjqmKrzyA/XybkBzk0mrjQNL4iRJ0qe/gQmQj4LIRPA1s4LZ5ZqF1 icHYFEwjjTqpRavOJxz41Gdv3PiV5jSqfUHZfSXGN6MJQEfgW6322N2wl+aXZFyz15XY 45RHFXYoEHctxdSCZohJp18KLBzYMBIayxHcOFP3Qkc/Wdz7+w3JzVPOX0kvn+Dupj+i vY6SDDOiApK9kx3PuPOKv5aRZ1QYf3lO8ne4BU7k4gxMm94AblBA0TumDVKq8ff+PO6J W4mMAVBWmp+/Gt2EhXIg2y2lHFDA+z0q9n9xOTY6xJ06Kkp6WDF5rzgYy0SQn+De2gfx O+bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fOEjfUIG; 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 y194si489204yby.78.2019.02.01.08.13.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 01 Feb 2019 08:13:05 -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=fOEjfUIG; 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]:57318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbRB-00045s-7Y for patch@linaro.org; Fri, 01 Feb 2019 11:13:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbM8-0008Bo-VC for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpbM7-0003fT-0v for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:52 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:43401) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpbM4-0003Vv-Vz for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:50 -0500 Received: by mail-wr1-x42d.google.com with SMTP id b4so751515wrq.10 for ; Fri, 01 Feb 2019 08:07:34 -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=BuUcoEKEWFa2gs0tJtZIl2sLfc48bCl+guXN5IwAbi4=; b=fOEjfUIG4U6QtbrWccMGjZ018n9raT5tCGYvDFyeDPXDyPDeHqmHAKl1U2I9ArXZpa 9TwL6mkbAL+zVkw2LErIuBw9Sl0psYLcHmqEZ8C/bJCnd2KqBfxCIXiheBD1I2vv4J5N MvesEo0UBqiiyUgUnYg5ny/dXPYlApBQRbTw0= 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=BuUcoEKEWFa2gs0tJtZIl2sLfc48bCl+guXN5IwAbi4=; b=bu/FQ2y4vL/uBjP4gF6JA2D7CHEvnt3pykKjiGYl+sA6EnVvLd9jG2rjFEJEKWuObh mMGHP2WIrvy8wyFz2rHIIaZRt3SyMtnoASbujlHr1okQeLFqXKBaCKV6NJZ+NLWgx+RH dw8UA/qQRWm8pKDtNeV55a1BP8yIq1b2qxC3akEzWDqduWTG/5I01tzckXloDY03gw1a c+eN1L9+NvY7vzGjsN1GelhXUyhUR1jWhJ+s63YkT5y4CQCDDbchscRMnCTmsm0vzKbp 7NqUD4zB8vbYaq2gM1/Zmkj92tRBSt1hoWyibv/tNLcDcXVEE0yzSZTzBVdCbNcnZdCP AP1Q== X-Gm-Message-State: AHQUAuZ3qe9urHOVRQbqp+a84bA1Pr89MX3M/NY2dLLSH1UyG44AoBlG 9f7LXJFgD9W87K6trrcAy3wMlDy9MuSsxA== X-Received: by 2002:adf:db01:: with SMTP id s1mr2961979wri.214.1549037253382; Fri, 01 Feb 2019 08:07:33 -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.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 08:07:32 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 1 Feb 2019 16:06:35 +0000 Message-Id: <20190201160653.13829-30-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 29/47] target/arm/translate-a64: Don't underdecode add/sub extended register 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 "add/subtract (extended register)" encoding group, the "opt" field in bits [23:22] must be zero. Correctly UNDEF the unallocated encodings where this field is not zero. Reported-by: Laurent Desnogues Signed-off-by: Peter Maydell Reviewed-by: Laurent Desnogues Message-id: 20190125182626.9221-6-peter.maydell@linaro.org --- target/arm/translate-a64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 2cade64ed25..94907f0ae97 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -4201,6 +4201,7 @@ static void disas_add_sub_ext_reg(DisasContext *s, uint32_t insn) int imm3 = extract32(insn, 10, 3); int option = extract32(insn, 13, 3); int rm = extract32(insn, 16, 5); + int opt = extract32(insn, 22, 2); bool setflags = extract32(insn, 29, 1); bool sub_op = extract32(insn, 30, 1); bool sf = extract32(insn, 31, 1); @@ -4209,7 +4210,7 @@ static void disas_add_sub_ext_reg(DisasContext *s, uint32_t insn) TCGv_i64 tcg_rd; TCGv_i64 tcg_result; - if (imm3 > 4) { + if (imm3 > 4 || opt != 0) { unallocated_encoding(s); return; }