From nobody Fri Oct 24 09:43:22 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 151940230856484.59473835541837; Fri, 23 Feb 2018 08:11:48 -0800 (PST) Received: from localhost ([::1]:45473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epFwp-0000zE-JV for importer@patchew.org; Fri, 23 Feb 2018 11:11:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epFUp-00009i-9m for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:42:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epFUn-0005yi-JQ for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:42:51 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:37917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1epFUn-0005x9-9i for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:42:49 -0500 Received: by mail-wm0-x242.google.com with SMTP id z9so5345612wmb.3 for ; Fri, 23 Feb 2018 07:42:49 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o11sm2696294wra.28.2018.02.23.07.42.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 07:42:40 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id EF89F3E0CC8; Fri, 23 Feb 2018 15:36:37 +0000 (GMT) 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 :mime-version:content-transfer-encoding; bh=quLuZZvfYOQqtY9r3MIBGGQuf0SjAevUKMOaZRnElbE=; b=IJgiDfewp2Oi0hpbjOKF/Jw/IDeFfJynpMhMiEG2lHOJiKCZFfozrrSrUvFc0qc3Lq BoVyOLU2GdowtP1wCXavTA18QbeZPgd4SiOwEse9v3boVeGLw869ueR8W0MuUDBxpOxd HvwJRC28hsmvcU3yq0TX/qu29TS1HQmDPMrd8= 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:mime-version:content-transfer-encoding; bh=quLuZZvfYOQqtY9r3MIBGGQuf0SjAevUKMOaZRnElbE=; b=A7wWIB9wCNr/ROTYYPqCwuJyAhVab8a7BRWXiZHGUeT3v2wrIwQjhsQu4PJTZWppx9 U/8bDd5J4CbvJ6f/IWPQ6GacNY7y09QPNqtvI9KobJp0QbVYVOzCnhypTQ9po55gPlqO l463nu4ER0Sx+N5Lrmp+KDwpyWIGTUHzC9ffG69pKkI8EWdLQr+nO9qUZKQwfXSKe38V bn5NOIaOVwO4G5M70CM/2hjV7Lqm1heXyoWBdLnxYEJrHCk+otLn+1SjCA4O4qEBuw1z HXZ97jccSMle/wG77ssCMzKvxQG3G1uv2fs/vu5DCy1CY8o+AvOxRa0KSLq82Crh33JO PdBQ== X-Gm-Message-State: APf1xPAyraONPq/WTwmQ5MQa7Tzh+ZeOMfMX701h/nJyVVlz5rl3RAQy LidOCXx/AjvsOtCb+XU5Ex0cQg== X-Google-Smtp-Source: AG47ELvwksLf8D6frHArlqSPT/HxIUUKaLfMrhGsiCukV1E4Yn6giCdE0HMHRurvyewnnRvjJuw7/A== X-Received: by 10.28.241.2 with SMTP id p2mr1947370wmh.105.1519400568173; Fri, 23 Feb 2018 07:42:48 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-arm@nongnu.org Date: Fri, 23 Feb 2018 15:36:24 +0000 Message-Id: <20180223153636.29809-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180223153636.29809-1-alex.bennee@linaro.org> References: <20180223153636.29809-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH v3 19/31] arm/translate-a64: add FP16 FCMxx (zero) to simd_two_reg_misc_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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, qemu-devel@nongnu.org, Peter Maydell 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 I re-use the existing handle_2misc_fcmp_zero handler and tweak it slightly to deal with the half-precision case. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- v3 - use size directly wuth read/write_vec_element - drop unneeded break - WIP: mess with calculating maxpasses --- target/arm/translate-a64.c | 80 +++++++++++++++++++++++++++++++++---------= ---- 1 file changed, 57 insertions(+), 23 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index e3318837c9..c251121c2b 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -7821,14 +7821,14 @@ static void handle_2misc_fcmp_zero(DisasContext *s,= int opcode, bool is_scalar, bool is_u, bool is_q, int size, int rn, int rd) { - bool is_double =3D (size =3D=3D 3); + bool is_double =3D (size =3D=3D MO_64); TCGv_ptr fpst; =20 if (!fp_access_check(s)) { return; } =20 - fpst =3D get_fpstatus_ptr(false); + fpst =3D get_fpstatus_ptr(size =3D=3D MO_16); =20 if (is_double) { TCGv_i64 tcg_op =3D tcg_temp_new_i64(); @@ -7880,34 +7880,57 @@ static void handle_2misc_fcmp_zero(DisasContext *s,= int opcode, bool swap =3D false; int pass, maxpasses; =20 - switch (opcode) { - case 0x2e: /* FCMLT (zero) */ - swap =3D true; - /* fall through */ - case 0x2c: /* FCMGT (zero) */ - genfn =3D gen_helper_neon_cgt_f32; - break; - case 0x2d: /* FCMEQ (zero) */ - genfn =3D gen_helper_neon_ceq_f32; - break; - case 0x6d: /* FCMLE (zero) */ - swap =3D true; - /* fall through */ - case 0x6c: /* FCMGE (zero) */ - genfn =3D gen_helper_neon_cge_f32; - break; - default: - g_assert_not_reached(); + if (size =3D=3D MO_16) { + switch (opcode) { + case 0x2e: /* FCMLT (zero) */ + swap =3D true; + /* fall through */ + case 0x2c: /* FCMGT (zero) */ + genfn =3D gen_helper_advsimd_cgt_f16; + break; + case 0x2d: /* FCMEQ (zero) */ + genfn =3D gen_helper_advsimd_ceq_f16; + break; + case 0x6d: /* FCMLE (zero) */ + swap =3D true; + /* fall through */ + case 0x6c: /* FCMGE (zero) */ + genfn =3D gen_helper_advsimd_cge_f16; + break; + default: + g_assert_not_reached(); + } + } else { + switch (opcode) { + case 0x2e: /* FCMLT (zero) */ + swap =3D true; + /* fall through */ + case 0x2c: /* FCMGT (zero) */ + genfn =3D gen_helper_neon_cgt_f32; + break; + case 0x2d: /* FCMEQ (zero) */ + genfn =3D gen_helper_neon_ceq_f32; + break; + case 0x6d: /* FCMLE (zero) */ + swap =3D true; + /* fall through */ + case 0x6c: /* FCMGE (zero) */ + genfn =3D gen_helper_neon_cge_f32; + break; + default: + g_assert_not_reached(); + } } =20 if (is_scalar) { maxpasses =3D 1; } else { - maxpasses =3D is_q ? 4 : 2; + int vector_size =3D 8 << is_q; + maxpasses =3D vector_size >> size; } =20 for (pass =3D 0; pass < maxpasses; pass++) { - read_vec_element_i32(s, tcg_op, rn, pass, MO_32); + read_vec_element_i32(s, tcg_op, rn, pass, size); if (swap) { genfn(tcg_res, tcg_zero, tcg_op, fpst); } else { @@ -7916,7 +7939,7 @@ static void handle_2misc_fcmp_zero(DisasContext *s, i= nt opcode, if (is_scalar) { write_fp_sreg(s, rd, tcg_res); } else { - write_vec_element_i32(s, tcg_res, rd, pass, MO_32); + write_vec_element_i32(s, tcg_res, rd, pass, size); } } tcg_temp_free_i32(tcg_res); @@ -11209,7 +11232,18 @@ static void disas_simd_two_reg_misc_fp16(DisasCont= ext *s, uint32_t insn) fpop =3D deposit32(opcode, 5, 1, a); fpop =3D deposit32(fpop, 6, 1, u); =20 + rd =3D extract32(insn, 0, 5); + rn =3D extract32(insn, 5, 5); + switch (fpop) { + break; + case 0x2c: /* FCMGT (zero) */ + case 0x2d: /* FCMEQ (zero) */ + case 0x2e: /* FCMLT (zero) */ + case 0x6c: /* FCMGE (zero) */ + case 0x6d: /* FCMLE (zero) */ + handle_2misc_fcmp_zero(s, fpop, is_scalar, 0, is_q, MO_16, rn, rd); + return; case 0x18: /* FRINTN */ need_rmode =3D true; only_in_vector =3D true; --=20 2.15.1