From patchwork Mon May 30 16:06:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 577288 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:330b:0:0:0:0 with SMTP id f11csp455706mag; Mon, 30 May 2022 10:56:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5LxWztTDYspYbqYHsk8oH/PRuiQiDH6Tyc3UNIwkIyE1FnLZ6qLBpEPTHoeI461Y3mNN+ X-Received: by 2002:a05:620a:b4e:b0:6a5:9b54:2d91 with SMTP id x14-20020a05620a0b4e00b006a59b542d91mr18581433qkg.586.1653933377847; Mon, 30 May 2022 10:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653933377; cv=none; d=google.com; s=arc-20160816; b=DZ8znZsnp7PNxlSqsWY91LpA0bWX9g+wBxxcBBxIfrbY0CYDMcK2z3KyTa9RCjYGV0 CrXGJFK0hCaho41z6aw2ALrBXZGdKA0cG6QWzUnJ5NL2BKM9v9YMKeL7TIjSzS4GTM9w rcaO9y7aourUHQY7FGAc5i1rkT0tKHN7/c5jkR2RlLBB9pS+uNS29ERxzlX2nkk/XN3w 917+2Kl1dAOr3qaqpGT5pg/43OSmj4QW4c0t7pw+Az8AAynirdADf2MMR7rh63H66jk7 XHPSPLon1aVRHzrfF8ggrHMIHbEDmd6UESjW+dHuLKs5+QxOmuwr8jATtxnOTyCxHZj1 xp7g== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=8H0O7WP3fZTtNdQhbGwYgO4FNCF8NZfiJ1G4q6YMIBY=; b=IOMR+Jugl9dll52BrnRwCI69rC7i3J0q0d4IbVvxPI/FkBJn2TKrKn7xMIqts97IKm CO47+YX+3MmrT08xsThCiN8iCs4rFcNuB0ACaG+x8Akwggs2tP8FMMzetcorCXd5mR06 b7KZ6M6RDSueZa9k4k61sxZRKeqLh3uvhWQveww7Y4DAOCYb12RaKjJ45mehNribzkWb wTDaJ74NQrR2wbYJuTqAaGbKs9UswzIuswFeA74EENbnG9Bt5ikrmNPqzcWdZE9bpwg4 B93ITAj/9PAB7S7wNBZu/k6loF7h9X6jEKt1bl0DZF/imsbBovesgps6rnD7EI/PtQ8G kprA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ejgy9Odk; 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=pass (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 c7-20020a05620a134700b0069eca9611eesi6950605qkl.596.2022.05.30.10.56.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 May 2022 10:56:17 -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=pass header.i=@linaro.org header.s=google header.b=Ejgy9Odk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvjcn-0006Ky-Et for patch@linaro.org; Mon, 30 May 2022 13:56:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhwQ-0003tf-Ql for qemu-devel@nongnu.org; Mon, 30 May 2022 12:08:27 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:46665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvhwL-0007Hl-91 for qemu-devel@nongnu.org; Mon, 30 May 2022 12:08:22 -0400 Received: by mail-wr1-x42a.google.com with SMTP id d26so9674574wrb.13 for ; Mon, 30 May 2022 09:08:20 -0700 (PDT) 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=8H0O7WP3fZTtNdQhbGwYgO4FNCF8NZfiJ1G4q6YMIBY=; b=Ejgy9Odk7RQgM+lYdey81GLfLI6jByNCStGlV0JycTj+aBFEmfwziTnP7DmSft2T3m VBQ81/7/ezeCs4C7k4YNjrwtCNuK4QNerI5WBlz335E6ULpbyR9Uk35fyfdX2OrNX2Vl cnfcnXfskNOYfNHlgjYsIto9tMQd9Q5euAY6aX0TSx19d/qTvhFze8JvQucjPGAHF5JE DXy71C0fmgk2U68MBz7Z7DYpgFPJVLLQuzmUa6yUJLLAE3KWgG/zJcXkVh4CvCVoD20z 8c2TSNLVagQiQzKXW/RXENeIa2QYdcyKnL0S1qV3IairgNb4JZ7Jaa8nbVnC8UGtZS8l U9EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8H0O7WP3fZTtNdQhbGwYgO4FNCF8NZfiJ1G4q6YMIBY=; b=P3Blvjs105SuAs86/PajHoGU3qXraLAi9hUxwWuXXB2Oka2q9so3vdcuNdeqGW2S3i B2fUCyEzNJoW5Nn9DwwEu5eQZvNa7dmCfyorkVPOak0h6tY9bz67J3GtxnH1rULMJIzY PI7nSO/glLTUOjdPzlwJgrJl4imui5OaO4lorlmGp+KgtYNjpPdgeLvrZMsEx/oQ7gnk 8lsKeLNHKlYZVAio9kbU1bO+wMEIHC7aM4UOy0k4vQreWy9X0DqvbKQyp236vXp2zicN pKPq2nwTT8n9FJfq3GAxSwRMaE8vexo20HTEXitO+1m1g63cU5dhJpyMfmRgtBkAPqPQ 0n5g== X-Gm-Message-State: AOAM533aj2g5x5sJEJ0MbOR/WJzvIIVMwB1li4z6jd3qi6aJJOIybksk D68aoYqI8GKHe2E1wMgevqCOkQNP4Z9H/A== X-Received: by 2002:a5d:6847:0:b0:20f:c0b6:d783 with SMTP id o7-20020a5d6847000000b0020fc0b6d783mr40465321wrw.101.1653926900397; Mon, 30 May 2022 09:08:20 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bi12-20020a05600c3d8c00b003974b95d897sm10232152wmb.37.2022.05.30.09.08.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 09:08:20 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 075/117] target/arm: Reject add/sub w/ shifted byte early Date: Mon, 30 May 2022 17:06:26 +0100 Message-Id: <20220530160708.726466-76-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530160708.726466-1-peter.maydell@linaro.org> References: <20220530160708.726466-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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" From: Richard Henderson Remove the unparsed extractions in trans_ADD_zzi, trans_SUBR_zzi, and do_zzi_sat which are intended to reject an 8-bit shift of an 8-bit constant for 8-bit element. Signed-off-by: Richard Henderson Message-id: 20220527181907.189259-73-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/sve.decode | 35 ++++++++++++++++++++++++++++------- target/arm/translate-sve.c | 9 --------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/target/arm/sve.decode b/target/arm/sve.decode index c02da0a0829..8cff63cf257 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -793,13 +793,34 @@ FDUP 00100101 esz:2 111 00 1110 imm:8 rd:5 } # SVE integer add/subtract immediate (unpredicated) -ADD_zzi 00100101 .. 100 000 11 . ........ ..... @rdn_sh_i8u -SUB_zzi 00100101 .. 100 001 11 . ........ ..... @rdn_sh_i8u -SUBR_zzi 00100101 .. 100 011 11 . ........ ..... @rdn_sh_i8u -SQADD_zzi 00100101 .. 100 100 11 . ........ ..... @rdn_sh_i8u -UQADD_zzi 00100101 .. 100 101 11 . ........ ..... @rdn_sh_i8u -SQSUB_zzi 00100101 .. 100 110 11 . ........ ..... @rdn_sh_i8u -UQSUB_zzi 00100101 .. 100 111 11 . ........ ..... @rdn_sh_i8u +{ + INVALID 00100101 00 100 000 11 1 -------- ----- + ADD_zzi 00100101 .. 100 000 11 . ........ ..... @rdn_sh_i8u +} +{ + INVALID 00100101 00 100 001 11 1 -------- ----- + SUB_zzi 00100101 .. 100 001 11 . ........ ..... @rdn_sh_i8u +} +{ + INVALID 00100101 00 100 011 11 1 -------- ----- + SUBR_zzi 00100101 .. 100 011 11 . ........ ..... @rdn_sh_i8u +} +{ + INVALID 00100101 00 100 100 11 1 -------- ----- + SQADD_zzi 00100101 .. 100 100 11 . ........ ..... @rdn_sh_i8u +} +{ + INVALID 00100101 00 100 101 11 1 -------- ----- + UQADD_zzi 00100101 .. 100 101 11 . ........ ..... @rdn_sh_i8u +} +{ + INVALID 00100101 00 100 110 11 1 -------- ----- + SQSUB_zzi 00100101 .. 100 110 11 . ........ ..... @rdn_sh_i8u +} +{ + INVALID 00100101 00 100 111 11 1 -------- ----- + UQSUB_zzi 00100101 .. 100 111 11 . ........ ..... @rdn_sh_i8u +} # SVE integer min/max immediate (unpredicated) SMAX_zzi 00100101 .. 101 000 110 ........ ..... @rdn_i8s diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 14faef05641..bf988cab3eb 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -3262,9 +3262,6 @@ static bool trans_DUP_i(DisasContext *s, arg_DUP_i *a) static bool trans_ADD_zzi(DisasContext *s, arg_rri_esz *a) { - if (a->esz == 0 && extract32(s->insn, 13, 1)) { - return false; - } return gen_gvec_fn_arg_zzi(s, tcg_gen_gvec_addi, a); } @@ -3305,9 +3302,6 @@ static bool trans_SUBR_zzi(DisasContext *s, arg_rri_esz *a) .scalar_first = true } }; - if (a->esz == 0 && extract32(s->insn, 13, 1)) { - return false; - } if (sve_access_check(s)) { unsigned vsz = vec_full_reg_size(s); tcg_gen_gvec_2s(vec_full_reg_offset(s, a->rd), @@ -3321,9 +3315,6 @@ TRANS_FEAT(MUL_zzi, aa64_sve, gen_gvec_fn_arg_zzi, tcg_gen_gvec_muli, a) static bool do_zzi_sat(DisasContext *s, arg_rri_esz *a, bool u, bool d) { - if (a->esz == 0 && extract32(s->insn, 13, 1)) { - return false; - } if (sve_access_check(s)) { do_sat_addsub_vec(s, a->esz, a->rd, a->rn, tcg_constant_i64(a->imm), u, d);