From nobody Thu Dec 18 22:23:35 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 1519905048348421.9245358849154; Thu, 1 Mar 2018 03:50:48 -0800 (PST) Received: from localhost ([::1]:55849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erMjM-0006G8-4B for importer@patchew.org; Thu, 01 Mar 2018 06:50:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erMK2-0003r5-8o for qemu-devel@nongnu.org; Thu, 01 Mar 2018 06:24:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erMK1-0008CT-3n for qemu-devel@nongnu.org; Thu, 01 Mar 2018 06:24:26 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:46714) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erMK0-0008BS-S6 for qemu-devel@nongnu.org; Thu, 01 Mar 2018 06:24:25 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1erMJz-0000eB-Nw for qemu-devel@nongnu.org; Thu, 01 Mar 2018 11:24:23 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 1 Mar 2018 11:23:48 +0000 Message-Id: <20180301112403.12487-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180301112403.12487-1-peter.maydell@linaro.org> References: <20180301112403.12487-1-peter.maydell@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: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 27/42] 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 From: Alex Benn=C3=A9e 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 Message-id: 20180227143852.11175-20-alex.bennee@linaro.org Signed-off-by: Peter Maydell --- 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 046079b1b3..9c02f1e23c 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.16.2