From patchwork Thu Feb 8 17:31:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 127717 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1745672ljc; Thu, 8 Feb 2018 10:22:39 -0800 (PST) X-Google-Smtp-Source: AH8x224W6aN+P/9QUbwdVIgWVFCtvqmRPyem6pAgXLnm/FONxBSKgpzDpH632HmUl5V+aazwkI+Z X-Received: by 10.13.231.132 with SMTP id q126mr103652ywe.350.1518114159864; Thu, 08 Feb 2018 10:22:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518114159; cv=none; d=google.com; s=arc-20160816; b=tCrWaePOCv7Q/lTGs2oL+GRCeKXfxx/pDJ22IfGWAVV6nejBBbPpOFQXcVnvFkqkNa k20I3PBllNvVu1R/tRPa4fC0Yi1clAjY3AGYPUxPjbzffxddvHDD75ekmAMvIdTp1Doa j4Dg693JEVsdYs4CA+mvCZwRZ2+gxawaKdm+0c0Z8DjZ01niWEeVxHe0AHyzkb5650ri Wtf3qUsNU40WmWLhpTrAKiyxNerwzYhFPTvFCYNJYp1WLsrzFGCoRuVM7ttwC4bXpmus RU2ZF9mhDaahsksw2l3qIPF+IDtURa5XtEmaUQytfBWMaHJTZ1CphrcbJ15VeeCmmbLg uOXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=0yDgimKm+CMDSWw8AX2+mTG+YAEGaWfAwu4YC6X2mjo=; b=fqNADe/fMJaHV/8wTDpalQ/Xzcd7HNUHI8OlS9hfY6J+MObXehWRXzYH3gYGjbUDVt qlIv+w9TFmtBlYUJs9l1KvnoOT0h5q1AD+mqW/Yn9hoYTNzUV4Tk/3J0qHYDbLXMvtVW 1wU+F+R+pqLtIbcHt+fJvHDImYf8B8m9Im+5aez9VQyXau/AdEqxAOF6Fr7ipXxNgh22 iFR81ADLbGCSfom1GJuwv9K2vKKvn1tQZ7oL1pA3ObWQ3XjS5cX/fKMflxop+3dHs6Yz bPyAxUIAmTDuq6xLH47CC4F794Oy/8/beDSiT7r8xRMzRTtsNsX5na5zwssM46GrCTND N0Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jEq8+5ol; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g9si93577ybb.324.2018.02.08.10.22.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 08 Feb 2018 10:22:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jEq8+5ol; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejqqE-0005Hb-Uc for patch@linaro.org; Thu, 08 Feb 2018 13:22:39 -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) 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-Received: by 10.223.172.135 with SMTP id o7mr1483287wrc.175.1518111630021; 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) From: =?utf-8?q?Alex_Benn=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 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" I only needed to do a little light re-factoring to support the half-precision helpers. Signed-off-by: Alex Bennée --- target/arm/translate-a64.c | 80 +++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 26 deletions(-) -- 2.15.1 Reviewed-by: Richard Henderson 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 = MO_16; + } + } else { + size = extract32(size, 0, 1) ? MO_64 : MO_32; } + if (!fp_access_check(s)) { return; } - size = extract32(size, 0, 1) ? 3 : 2; - fpst = get_fpstatus_ptr(false); + fpst = get_fpstatus_ptr(size == MO_16); break; default: unallocated_encoding(s); return; } - if (size == 3) { + if (size == MO_64) { TCGv_i64 tcg_op1 = tcg_temp_new_i64(); TCGv_i64 tcg_op2 = tcg_temp_new_i64(); TCGv_i64 tcg_res = tcg_temp_new_i64(); @@ -6429,27 +6435,49 @@ static void disas_simd_scalar_pairwise(DisasContext *s, uint32_t insn) TCGv_i32 tcg_op2 = tcg_temp_new_i32(); TCGv_i32 tcg_res = tcg_temp_new_i32(); - 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); - 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 == 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(); + } } write_fp_sreg(s, rd, tcg_res);