From patchwork Fri May 24 23:20:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 798748 Delivered-To: patch@linaro.org Received: by 2002:a5d:6a47:0:b0:354:fb4b:99cd with SMTP id t7csp943652wrw; Fri, 24 May 2024 16:30:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWNpNxgPNuKYgtjLJxo66psRDvtmL3xLSLrd0DubCpSWQXOeQwLx2Z4Hzu5vmc24koSWZFEkQQq2dfc5UsfJRxS X-Google-Smtp-Source: AGHT+IHtfmdrlUZs+tjm0ABqFvy2wOp02EPW/6PovnezR6VTnqDD07X04Oy9NWmFpN7X3Ssnu0+I X-Received: by 2002:a05:620a:379b:b0:792:eac7:7bf4 with SMTP id af79cd13be357-794ab07cb70mr369221185a.26.1716593400808; Fri, 24 May 2024 16:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716593400; cv=none; d=google.com; s=arc-20160816; b=gvLk8XvPBV+x706Fy7dNSDjeDIP+F+u9+ED0dMLH2/LsVIOtqulJVFqEjhzTcNx1jF 8Sba3zwOG+GXKbrb0O8g3xUcibO1hnYLtbr9VFRP1jGKkJIJMN1vHgjLzXODVcHe0fTy MziktIJPc1hSlYnI9zpd4b6rB9L51GsHv6/FC1ZsZDIwzSrbP9fyjeEZOMGMN4wVBOFh tQaHauMM1qP6ghKeCMEdcgqcGltvzun4gbzpBTtTP7R52/w2aUcrm+9vAYfB6ARGhwnq UV1l8PlYJ3nO0NaMkuN5J5OdI4KLsSX4bdX1TLzWuKLwF2+IZUZlRXpkv62qci0vCCYk WXig== 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:cc:to :from:dkim-signature; bh=Qjg0N9d1UiR78WeGkTTMqX2tHTL3eVpJWXsbVAhKPqc=; fh=9Ev+QBUhk6P6vR3LT1wYeDLexozsz44nqjfoyPajZCc=; b=f4hb+neUBpjffk2LDG1tAcp1X3MzW5/EFas1nv90bTYCTOLEgnwHTQr0Rif8f0S/AF o9wgR/mRHPd+mt5HVa6Jfeokgfxc2KtoYsvPUTk1n1u4MKT8Q3IPFnO5HvIJv5UhvLwE IA32H5ic7njmez5WEEMcHOqem//ajZU4hYloTTk3BRACzuofqeX4rkq1qDo8dVvk/Z7N Vwwmj8u/I1WErMCiY7ebI4Cjj53LhFTknPV6SvgBT7iTnF7Y3btrVxdtplpwhebk6u8Q ulz5HEu8VXkiYIKp4YTjCvTF9bCBwSCkgZ61rn3dQvuuDzieaYThMrwvwCus9TwAD5U0 q5Pg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vEdndpfN; 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 af79cd13be357-794abd0970esi300269385a.320.2024.05.24.16.30.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 May 2024 16:30:00 -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=vEdndpfN; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAeEA-0006RD-5f; Fri, 24 May 2024 19:21:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAeE7-0006Of-5B for qemu-devel@nongnu.org; Fri, 24 May 2024 19:21:32 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAeE5-0005hu-63 for qemu-devel@nongnu.org; Fri, 24 May 2024 19:21:30 -0400 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-681907aebebso1037775a12.1 for ; Fri, 24 May 2024 16:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716592888; x=1717197688; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Qjg0N9d1UiR78WeGkTTMqX2tHTL3eVpJWXsbVAhKPqc=; b=vEdndpfNXdSLolIRiwW8rs8U2X0QWDjmrZADLvwF9Enr2yqjJPjZAvsQQdFsHqTzKE TwuT9k8LlXgM3J5CZwmow6muZmRGUObcqpOIjDb6oChFk0jI+KNnAD+vLTwyclxLLlbZ xehqMDjHZu25gabmslehW+Pn2kMtUt2zs3N9QRleCFQHYaO5DnT9Wx1j8mI6cSeHVvjt jKwIWRambVj0kgs/cHzZkunMdArxDV3Oyr/7ZzCSqF642ijIAUjILHPUcYYWbLr1cblK d2713FnamlChCuJDM2L22RZNGVMnaqrB3h29tEB21p2k7M1q5Y+rQowZnwqpMiIf+mW2 klIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716592888; x=1717197688; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qjg0N9d1UiR78WeGkTTMqX2tHTL3eVpJWXsbVAhKPqc=; b=X89hC8Xxy3/5gZ14hgwjEzDHwOuKSzu28/+RDnZz7HboInX0TZ9IxY536SZ2F2h3o4 lwHJ1crq4f4ydZoU6Q0N7r7bapUpxye8KgA8PVcxzh14oZVC1t/5UsdF/tws4o6ZwP1a U+Kt9oEnL+oAUSR5FnBIH5PaLy49Q5a2U1ddbS7vs/Vs6I5bHqNtCQrJgC0PQxNWbSXA JuotHc0elOt7Wws3FaYOG7UB1jz4/Ank7mdLNvy2eKNTJkm+7XD/Y+XLQKoaTtEvGch9 IxpVVG0VGVGDEO8NPxSMchgpwRiWvoujsSdDnbKfM4W04wLKRGyGDDUWfHSNU+orQvWZ OYyQ== X-Gm-Message-State: AOJu0YwmlAS5uiyrzQiB+X5Fg8vO1aHnVNaWJMRXi2RLW+WGogRBh5Xr k5piA4ZfvpdXMP/Hl0B8Cjrkd0NMXiEugJ//jaXlo2lyMTKiQh0Oui97Eylvbd5LVCH9NuFTA+w n X-Received: by 2002:a17:902:db11:b0:1f4:5c4b:dc6b with SMTP id d9443c01a7336-1f45c4be9d5mr24810025ad.47.1716592887707; Fri, 24 May 2024 16:21:27 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c759ceesm19178305ad.10.2024.05.24.16.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 16:21:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 06/67] target/arm: Verify sz=0 for Advanced SIMD scalar pairwise (fp16) Date: Fri, 24 May 2024 16:20:20 -0700 Message-Id: <20240524232121.284515-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240524232121.284515-1-richard.henderson@linaro.org> References: <20240524232121.284515-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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 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-bounces+patch=linaro.org@nongnu.org All of these insns have "if sz == '1' then UNDEFINED" in their pseudocode. Fixes a RISU miscompare for invalid insn 0x5ef0c87a. Fixes: 5c36d89567c ("arm/translate-a64: add all FP16 ops in simd_scalar_pairwise") Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 5455ae3685..0bdddb8517 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8006,7 +8006,7 @@ static void disas_simd_scalar_pairwise(DisasContext *s, uint32_t insn) case 0x2f: /* FMINP */ /* FP op, size[0] is 32 or 64 bit*/ if (!u) { - if (!dc_isar_feature(aa64_fp16, s)) { + if ((size & 1) || !dc_isar_feature(aa64_fp16, s)) { unallocated_encoding(s); return; } else {