From nobody Wed Dec 17 21:46:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525975044715436.57037792634856; Thu, 10 May 2018 10:57:24 -0700 (PDT) Received: from localhost ([::1]:35028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGpoi-0001Xa-09 for importer@patchew.org; Thu, 10 May 2018 13:57:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGpdJ-0005AG-7t for qemu-devel@nongnu.org; Thu, 10 May 2018 13:45:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGpdI-0000wc-CR for qemu-devel@nongnu.org; Thu, 10 May 2018 13:45:37 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:41608) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fGpdI-0000vB-68 for qemu-devel@nongnu.org; Thu, 10 May 2018 13:45:36 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fGpdG-0003b7-UG for qemu-devel@nongnu.org; Thu, 10 May 2018 18:45:34 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 10 May 2018 18:45:16 +0100 Message-Id: <20180510174519.11264-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180510174519.11264-1-peter.maydell@linaro.org> References: <20180510174519.11264-1-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 18/21] target/arm: Implement vector shifted SCVF/UCVF for fp16 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Richard Henderson While we have some of the scalar paths for *CVF for fp16, we failed to decode the fp16 version of these instructions. Cc: qemu-stable@nongnu.org Signed-off-by: Richard Henderson Message-id: 20180502221552.3873-2-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate-a64.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index fa60cf908f..f4e2afa72c 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -7405,13 +7405,26 @@ static void handle_simd_shift_intfp_conv(DisasConte= xt *s, bool is_scalar, int immh, int immb, int opcode, int rn, int rd) { - bool is_double =3D extract32(immh, 3, 1); - int size =3D is_double ? MO_64 : MO_32; - int elements; + int size, elements, fracbits; int immhb =3D immh << 3 | immb; - int fracbits =3D (is_double ? 128 : 64) - immhb; =20 - if (!extract32(immh, 2, 2)) { + if (immh & 8) { + size =3D MO_64; + if (!is_scalar && !is_q) { + unallocated_encoding(s); + return; + } + } else if (immh & 4) { + size =3D MO_32; + } else if (immh & 2) { + size =3D MO_16; + if (!arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { + unallocated_encoding(s); + return; + } + } else { + /* immh =3D=3D 0 would be a failure of the decode logic */ + g_assert(immh =3D=3D 1); unallocated_encoding(s); return; } @@ -7419,20 +7432,14 @@ static void handle_simd_shift_intfp_conv(DisasConte= xt *s, bool is_scalar, if (is_scalar) { elements =3D 1; } else { - elements =3D is_double ? 2 : is_q ? 4 : 2; - if (is_double && !is_q) { - unallocated_encoding(s); - return; - } + elements =3D (8 << is_q) >> size; } + fracbits =3D (16 << size) - immhb; =20 if (!fp_access_check(s)) { return; } =20 - /* immh =3D=3D 0 would be a failure of the decode logic */ - g_assert(immh); - handle_simd_intfp_conv(s, rd, rn, elements, !is_u, fracbits, size); } =20 --=20 2.17.0