From nobody Mon Feb 9 23:03:45 2026 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 1518114104435873.6341381771397; Thu, 8 Feb 2018 10:21:44 -0800 (PST) Received: from localhost ([::1]:59874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejqpI-0005Hb-3O for importer@patchew.org; Thu, 08 Feb 2018 13:21:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejqBU-0002yc-SH for qemu-devel@nongnu.org; Thu, 08 Feb 2018 12:40:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejqBT-0000Sm-ET for qemu-devel@nongnu.org; Thu, 08 Feb 2018 12:40:32 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:40806) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejqBT-0000Rl-34 for qemu-devel@nongnu.org; Thu, 08 Feb 2018 12:40:31 -0500 Received: by mail-wr0-x242.google.com with SMTP id o76so2470895wrb.7 for ; Thu, 08 Feb 2018 09:40:30 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d63sm461769wmd.9.2018.02.08.09.40.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 09:40:25 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id F0DE23E0FCB; Thu, 8 Feb 2018 17:31:59 +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=0yDgimKm+CMDSWw8AX2+mTG+YAEGaWfAwu4YC6X2mjo=; b=jEq8+5ol3fhgkBJP8GfN4lXozR3CmnMlf6vqYGni2xHoFtWwITHD+H6nZVMHB2uPfP lsI6Gx1qDf3LH9lQwVYEadsbPtWNl9v8h7m/uYraWXCSLI8GaI9QVt2aGcSLIb6L7QD+ zoBUSEqsfvb4dH0gYfVwXDbrDnfjrIEie+694= 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=0yDgimKm+CMDSWw8AX2+mTG+YAEGaWfAwu4YC6X2mjo=; b=ZwouQIF4eVLf41pbcETDrZDNHtzEF/zDxePNOcOVXVu+RKsIDdcjPgSnzDlmXgDDpD shd+3F2aU2rfjy1p0D52MlOFQQPYP1ymckIZO0psHXeg+2U++pAquWXKfkt/kKszMPMI kC9vtCHGUrt5mmahjMgINMDVR/7ZI6dAOXkHk1JeIifrrWICSNPFbSWvtkU5ZBZquBSd feAAyDb387rXIPh/OkLIF23Dm4HxkDVOXD4LeIoULfWJME39lG3FnPU2q+sWqygMRuaN LF2BkRQ/AkgfKTMxyWiyedz72JQYivH5bPqDW8ddfd07HZuef8xyChM88UzDvpaRvlpc eXNQ== X-Gm-Message-State: APf1xPBgZPfBDUnUQGrzS5YLNivtlsP5om0usEGEsUcXHvEJ4C5yDrcQ to32b/C/OV9GB3KHXCRGF2XPAKnbhKA= X-Google-Smtp-Source: AH8x225QlN68nl+iSTfHa7gMTULpja1ADlWEwEFG3UvBJ95j+yYMkRQMGlr4Z93InbSGhYrMUvhSHg== X-Received: by 10.223.172.135 with SMTP id o7mr1483287wrc.175.1518111630021; Thu, 08 Feb 2018 09:40:30 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-arm@nongnu.org Date: Thu, 8 Feb 2018 17:31:55 +0000 Message-Id: <20180208173157.24705-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180208173157.24705-1-alex.bennee@linaro.org> References: <20180208173157.24705-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:c0c::242 Subject: [Qemu-devel] [PATCH v2 30/32] arm/translate-a64: add all FP16 ops in simd_scalar_pairwise 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 , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@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 I only needed to do a little light re-factoring to support the half-precision helpers. Signed-off-by: Alex Benn=C3=A9e --- target/arm/translate-a64.c | 80 +++++++++++++++++++++++++++++++-----------= ---- 1 file changed, 54 insertions(+), 26 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index b209f57d55..b094399fb4 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -6371,24 +6371,30 @@ static void disas_simd_scalar_pairwise(DisasContext= *s, uint32_t insn) case 0xf: /* FMAXP */ case 0x2c: /* FMINNMP */ case 0x2f: /* FMINP */ - /* FP op, size[0] is 32 or 64 bit */ + /* FP op, size[0] is 32 or 64 bit*/ if (!u) { - unallocated_encoding(s); - return; + if (!arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { + unallocated_encoding(s); + return; + } else { + size =3D MO_16; + } + } else { + size =3D extract32(size, 0, 1) ? MO_64 : MO_32; } + if (!fp_access_check(s)) { return; } =20 - size =3D extract32(size, 0, 1) ? 3 : 2; - fpst =3D get_fpstatus_ptr(false); + fpst =3D get_fpstatus_ptr(size =3D=3D MO_16); break; default: unallocated_encoding(s); return; } =20 - if (size =3D=3D 3) { + if (size =3D=3D MO_64) { TCGv_i64 tcg_op1 =3D tcg_temp_new_i64(); TCGv_i64 tcg_op2 =3D tcg_temp_new_i64(); TCGv_i64 tcg_res =3D tcg_temp_new_i64(); @@ -6429,27 +6435,49 @@ static void disas_simd_scalar_pairwise(DisasContext= *s, uint32_t insn) TCGv_i32 tcg_op2 =3D tcg_temp_new_i32(); TCGv_i32 tcg_res =3D tcg_temp_new_i32(); =20 - read_vec_element_i32(s, tcg_op1, rn, 0, MO_32); - read_vec_element_i32(s, tcg_op2, rn, 1, MO_32); + read_vec_element_i32(s, tcg_op1, rn, 0, size); + read_vec_element_i32(s, tcg_op2, rn, 1, size); =20 - switch (opcode) { - case 0xc: /* FMAXNMP */ - gen_helper_vfp_maxnums(tcg_res, tcg_op1, tcg_op2, fpst); - break; - case 0xd: /* FADDP */ - gen_helper_vfp_adds(tcg_res, tcg_op1, tcg_op2, fpst); - break; - case 0xf: /* FMAXP */ - gen_helper_vfp_maxs(tcg_res, tcg_op1, tcg_op2, fpst); - break; - case 0x2c: /* FMINNMP */ - gen_helper_vfp_minnums(tcg_res, tcg_op1, tcg_op2, fpst); - break; - case 0x2f: /* FMINP */ - gen_helper_vfp_mins(tcg_res, tcg_op1, tcg_op2, fpst); - break; - default: - g_assert_not_reached(); + if (size =3D=3D MO_16) { + switch (opcode) { + case 0xc: /* FMAXNMP */ + gen_helper_advsimd_maxnumh(tcg_res, tcg_op1, tcg_op2, fpst= ); + break; + case 0xd: /* FADDP */ + gen_helper_advsimd_addh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0xf: /* FMAXP */ + gen_helper_advsimd_maxh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x2c: /* FMINNMP */ + gen_helper_advsimd_minnumh(tcg_res, tcg_op1, tcg_op2, fpst= ); + break; + case 0x2f: /* FMINP */ + gen_helper_advsimd_minh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + default: + g_assert_not_reached(); + } + } else { + switch (opcode) { + case 0xc: /* FMAXNMP */ + gen_helper_vfp_maxnums(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0xd: /* FADDP */ + gen_helper_vfp_adds(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0xf: /* FMAXP */ + gen_helper_vfp_maxs(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x2c: /* FMINNMP */ + gen_helper_vfp_minnums(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x2f: /* FMINP */ + gen_helper_vfp_mins(tcg_res, tcg_op1, tcg_op2, fpst); + break; + default: + g_assert_not_reached(); + } } =20 write_fp_sreg(s, rd, tcg_res); --=20 2.15.1