From nobody Thu Oct 30 15:21:16 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; dkim=fail; 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 1525299512027683.1232306170801; Wed, 2 May 2018 15:18:32 -0700 (PDT) Received: from localhost ([::1]:52796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE051-00020t-AO for importer@patchew.org; Wed, 02 May 2018 18:18:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE02Z-0000ap-DF for qemu-devel@nongnu.org; Wed, 02 May 2018 18:16:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fE02X-0007pA-Gt for qemu-devel@nongnu.org; Wed, 02 May 2018 18:15:59 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:43068) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fE02X-0007oK-BS for qemu-devel@nongnu.org; Wed, 02 May 2018 18:15:57 -0400 Received: by mail-pf0-x244.google.com with SMTP id b26so199724pfi.10 for ; Wed, 02 May 2018 15:15:57 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id 65sm26170145pft.74.2018.05.02.15.15.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 15:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ttF+PGQCCRk+6WGb0b/LmzzNUpVRejL7hhsfT7m+hVs=; b=P97L7+WAfrFaZJHhzeNQe46cRIyFVwkBymc4n1oguuZzDSzh35LSFEsb3ExIO9rOS3 F4GkDWZUqGEYB//Mm24FfRgO5KozZVN7ioITIwtmNajDMiige4++JGH2kydmOhNpsncr G0G01uGBpHI+/o4fAxSDZekAsrj6C4NpSqtOA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ttF+PGQCCRk+6WGb0b/LmzzNUpVRejL7hhsfT7m+hVs=; b=TN03EQe1AVw2uDEfLu4VapDkJQreW0BddzZEd6TGfVpBWblPscwWPiWFq6AfBfGsbJ d4IcNe+C+RZz2fwivVUSPDspZKKaj9yf9nMEm1ImQp8/kRV0ZpasawMyRJi4YSjnXMbR LH8DMXDXeVGTMpw27++9QlS/6k/EiQLZVis94KYkzjDtQDULNkxPJnaGxK8Wspvo5ZVE 2OzMyT2zsCcGnnMuNZ+yE6W42VPH/thvRZx9AJumRyaav79PKbg+BQcys91BMoz1ife8 6QdUFxaKZe01l8YmuK7KGksLCRGxE/3pWg4v16c74JvGNvwCGa0OEucvrYQ9iB31wNzR 7aYA== X-Gm-Message-State: ALQs6tACSFS6mF4xa5gMHeo5TFebcLJMt7W92AR/++81OpAmW4PBl/J5 zD9CH6EFK4zdvY84ml6MQIaTCYxF6C8= X-Google-Smtp-Source: AB8JxZoH8kFC+3p+iPQ43emRrW7UOnpxdImwImXdJne3Sqxx+d3QeeJBKICdwBDt8kRBJWcWvU8xLw== X-Received: by 2002:a65:6027:: with SMTP id p7-v6mr3856905pgu.210.1525299356105; Wed, 02 May 2018 15:15:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 2 May 2018 15:15:39 -0700 Message-Id: <20180502221552.3873-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180502221552.3873-1-richard.henderson@linaro.org> References: <20180502221552.3873-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH v2 01/14] 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Peter Maydell --- v2: Use parens with (x << y) >> z. --- 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 bff4e13bf6..68ca445691 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -7165,13 +7165,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; } @@ -7179,20 +7192,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.14.3