From patchwork Tue Feb 27 14:38:50 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: 129823 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp384179edc; Tue, 27 Feb 2018 07:06:09 -0800 (PST) X-Google-Smtp-Source: AG47ELuRtVBNK6/A7sSD4+BS+I7vtGvtJpmaLkdum7+4GGoFR+IB9CxmaZ0cNSOldOC3FIqLHzR2 X-Received: by 10.129.71.9 with SMTP id u9mr4717552ywa.212.1519743969732; Tue, 27 Feb 2018 07:06:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519743969; cv=none; d=google.com; s=arc-20160816; b=eF9oQ8xbvjN0dQSoChKISisDPZhQ7/ewhhjhV5+g/RIp9NoaTNS6Xs3+jo3DDmo/RA yAf/RfHAo/gdYjSAqEhdkuT19T9dLYOINtVVbneUtqAhO8m7IiC60AHJHprmuw8dHtDq Wrfuid3oHlU4WM2ZgCESS/GtlCCS3Y392QHoW866etgI7mJJ6xuZ1Wj5EQNdPwcVrxNl FTA1ix3XC0MCcdQftijo8We4CFZpbQUVt8Qpn2UVDbAXa8VewXjR9xTfS5PoFFE+oaYj RZgCIgyx381/JOlj6wPr1sjGmAZ9PLm8ukdjbSRmiIBD2dYNTXwr+9LirWobtHdbIjF9 85tA== 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=YLjs9h74suIqkuOO0V9AaV1597gT9SirGzEVb1pIjLI=; b=PfwxgXXbyE45wo8/z0A5KJGvaMSYAJ7Hy1we2bNAYSQrbFZ1evkxdh6i+Jd3XTNK/u xTq662ERLZp2JiSGoboyOzkKDTdiuq8o8U822+Xf32F0oxbjJoz3rQnd4A8Gne5DTDro wYaS3mjFx/MBntVnTYFLSoc0rT+cp35uz997pc5c6XxjA8zqrHDMpYT6Va07LmWlq1uI S3VpDN9SiuHDK3CVGve7jguiHMShG9eh+SZJGhImzXNQJXr27YPdhJt3oVt35qmMnQHY nt1jasly+QBgQlsUZlq3+ImVYRycgfJ1zhBDZ7kyXqqaoXLfa6N3QweewFgrrMNo609z G+vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=a7tiIYFF; 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 u184-v6si1988987ybg.33.2018.02.27.07.06.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 27 Feb 2018 07:06:09 -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=a7tiIYFF; 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]:37853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqgpV-00011w-2u for patch@linaro.org; Tue, 27 Feb 2018 10:06:09 -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) 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-Received: by 10.223.197.200 with SMTP id v8mr12228364wrg.22.1519742881537; Tue, 27 Feb 2018 06:48:01 -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) From: =?utf-8?q?Alex_Benn=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 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_Benn=C3=A9e?= , richard.henderson@linaro.org, qemu-devel@nongnu.org, Peter Maydell 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 Reviewed-by: Richard Henderson --- target/arm/translate-a64.c | 80 +++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 26 deletions(-) -- 2.15.1 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 = 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(); @@ -6474,27 +6480,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);