From nobody Tue Feb 10 05:41:33 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519743923837182.0524054652284; Tue, 27 Feb 2018 07:05:23 -0800 (PST) Received: from localhost ([::1]:37853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqgoh-00011w-2Z for importer@patchew.org; Tue, 27 Feb 2018 10:05:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqgY3-0003WR-Sk for qemu-devel@nongnu.org; Tue, 27 Feb 2018 09:48:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqgXz-00011U-2i for qemu-devel@nongnu.org; Tue, 27 Feb 2018 09:48:07 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:42721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eqgXy-0000xe-P4 for qemu-devel@nongnu.org; Tue, 27 Feb 2018 09:48:02 -0500 Received: by mail-wr0-x242.google.com with SMTP id k9so25158331wre.9 for ; Tue, 27 Feb 2018 06:48:02 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 59sm6607374wro.57.2018.02.27.06.48.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 06:48:00 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 1C72D3E165C; Tue, 27 Feb 2018 14:38:55 +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=YLjs9h74suIqkuOO0V9AaV1597gT9SirGzEVb1pIjLI=; b=a7tiIYFFZTkFVT60qavLlHdd3ZwTtT8qvIB+ozlzH9RSGXJegMuIhP1Dc88lcU2ttq O8rmK9xM1ZQ3JpefIkHnDylgoWaCoaIY13ebz4ZVW0ipwHenw4lSTpF4DoOmXc1xKL2I zIbqw8XAbenHDLjyNA9Yb1jcRNUXpBhKxKLGw= 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=YLjs9h74suIqkuOO0V9AaV1597gT9SirGzEVb1pIjLI=; b=aI1pax1fhv6XOMnqoCv5fz4KtXPczQ8GG9cXl0huxht6RBy7IT3XQiZqcT4TGBK1h2 YF4l+ioJNCl9mq7PXtr/EPC8hs8eLzWTgR+pL9NfHV6W2rzKZRJjYEdgPukWM/rRMmsW 1JbtrMPq8MTFYmNTBM/lxHWndxj2v4PjcMPd9Bfhv5IO3fKSbsQ9r+qyKMDLi9Uyz6vF eMSHInisN+lLGSJDauZvTlhbm6Mf64Q1jJJIF1K3WrCow+MUWYcUhN8BVl18jovBXIgY Yg/4cMtfBWemJCtC0gwiElCwqs9PEtssPDLhvmzuYC0Lcz737ClZD88sZVWk0KREwTSU i0xQ== X-Gm-Message-State: APf1xPA1Kpijd1+S43kihecmJnI4G1na/WscpzdQ7zjCHAzU3EYPQq9K PSwTyqiV5Lq+Qydeq6+iwCPt+A== X-Google-Smtp-Source: AH8x224qf01+ITXJiSbKdiqWiIVrhleB+wDEVJ9+F+iAyxDXq1c/fKF+BHoWthe/xVa0APekjNzWGQ== X-Received: by 10.223.197.200 with SMTP id v8mr12228364wrg.22.1519742881537; Tue, 27 Feb 2018 06:48:01 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-arm@nongnu.org Date: Tue, 27 Feb 2018 14:38:50 +0000 Message-Id: <20180227143852.11175-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180227143852.11175-1-alex.bennee@linaro.org> References: <20180227143852.11175-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 v4 29/31] 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: =?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 only needed to do a little light re-factoring to support the half-precision helpers. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- 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 7c2bc05b92..9d3a6ac49f 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -6416,24 +6416,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(); @@ -6474,27 +6480,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