From patchwork Fri Feb 23 15:36:24 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: 129423 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp774939lja; Fri, 23 Feb 2018 08:10:20 -0800 (PST) X-Google-Smtp-Source: AG47ELsf9STrvfLb5lHh+Agf2VqdsRWJiur5XVShINvghRNffm2jBkWN4mzN8VttBzIP7c8pR20K X-Received: by 10.13.233.199 with SMTP id s190mr1382641ywe.14.1519402220105; Fri, 23 Feb 2018 08:10:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519402220; cv=none; d=google.com; s=arc-20160816; b=isgvK5YyXOpDokCHHsFt+uTbmn7UBnibHKTcxfHofHsdltWRkuYR/yuOpcYCkdmzb9 u/uAtTyhf8K+mgEWL4tC5aBKlzrCgw0XbjLBSAwou0+q6mKapKujSMKur9dt+snbIF8C raG/2BQh3FFiGjar/14P8fWo5wyEsNiUt+yND0Ok0NRwcbBYFGf0M3KPa1+tTr52IK9g nypyzQBayzIKVKTMioufxRu6lA4D+9n2QgeyIBHS8aH2f3zJZwVJPmDD+Xz/wckhf/7k 5Z9N2F1zwYfSByV0OEW6LPdl0ypiUe0qKfja5lVE2cDbcZd8KB+A9zIKlSgx3PKN9LVt PhGQ== 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=quLuZZvfYOQqtY9r3MIBGGQuf0SjAevUKMOaZRnElbE=; b=vnOZffL6gAp9qE4bz0gHUaKIyJGssADoBifPnox/GwAAisOseW17u0Lfh9OCDW2aYk v8+RoLlpGtiNdikCi/1D1CU00l99RLmlbXajwMowWxP+NJXz0RDbGNy0g1OG3vL926Dy JMaGtS/RXWWHSna7D1f4xkLiUwxGDknCQjadMvCyKRYCE/1xRZDTtRMQRdBjBxQq2THm UpgTcoOQCflTZzj8iEUNEvmuGA21Ukufjh0ymKNA8qhAWqnvIFtJjWwFk9IZlOCKiNPL I4ZhPcLIqhT5p4FwUK32lbaIkX8zPGvQaOLUOzBS/govsdS1u3x7uVyIYEFzCYwDhsAJ Qv0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IJgiDfew; 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 o9si460354ywm.604.2018.02.23.08.10.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 23 Feb 2018 08:10:20 -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=IJgiDfew; 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]:45458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epFvP-00087g-Cw for patch@linaro.org; Fri, 23 Feb 2018 11:10:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epFUp-00009i-9m for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:42:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epFUn-0005yi-JQ for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:42:51 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:37917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1epFUn-0005x9-9i for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:42:49 -0500 Received: by mail-wm0-x242.google.com with SMTP id z9so5345612wmb.3 for ; Fri, 23 Feb 2018 07:42:49 -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=quLuZZvfYOQqtY9r3MIBGGQuf0SjAevUKMOaZRnElbE=; b=IJgiDfewp2Oi0hpbjOKF/Jw/IDeFfJynpMhMiEG2lHOJiKCZFfozrrSrUvFc0qc3Lq BoVyOLU2GdowtP1wCXavTA18QbeZPgd4SiOwEse9v3boVeGLw869ueR8W0MuUDBxpOxd HvwJRC28hsmvcU3yq0TX/qu29TS1HQmDPMrd8= 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=quLuZZvfYOQqtY9r3MIBGGQuf0SjAevUKMOaZRnElbE=; b=A7wWIB9wCNr/ROTYYPqCwuJyAhVab8a7BRWXiZHGUeT3v2wrIwQjhsQu4PJTZWppx9 U/8bDd5J4CbvJ6f/IWPQ6GacNY7y09QPNqtvI9KobJp0QbVYVOzCnhypTQ9po55gPlqO l463nu4ER0Sx+N5Lrmp+KDwpyWIGTUHzC9ffG69pKkI8EWdLQr+nO9qUZKQwfXSKe38V bn5NOIaOVwO4G5M70CM/2hjV7Lqm1heXyoWBdLnxYEJrHCk+otLn+1SjCA4O4qEBuw1z HXZ97jccSMle/wG77ssCMzKvxQG3G1uv2fs/vu5DCy1CY8o+AvOxRa0KSLq82Crh33JO PdBQ== X-Gm-Message-State: APf1xPAyraONPq/WTwmQ5MQa7Tzh+ZeOMfMX701h/nJyVVlz5rl3RAQy LidOCXx/AjvsOtCb+XU5Ex0cQg== X-Received: by 10.28.241.2 with SMTP id p2mr1947370wmh.105.1519400568173; Fri, 23 Feb 2018 07:42:48 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o11sm2696294wra.28.2018.02.23.07.42.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 07:42:40 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id EF89F3E0CC8; Fri, 23 Feb 2018 15:36:37 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-arm@nongnu.org Date: Fri, 23 Feb 2018 15:36:24 +0000 Message-Id: <20180223153636.29809-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180223153636.29809-1-alex.bennee@linaro.org> References: <20180223153636.29809-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:c09::242 Subject: [Qemu-devel] [PATCH v3 19/31] 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: , 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 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ée --- v3 - use size directly wuth read/write_vec_element - drop unneeded break - WIP: mess with calculating maxpasses --- target/arm/translate-a64.c | 80 +++++++++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 23 deletions(-) -- 2.15.1 Reviewed-by: Richard Henderson diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index e3318837c9..c251121c2b 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 = (size == 3); + bool is_double = (size == MO_64); TCGv_ptr fpst; if (!fp_access_check(s)) { return; } - fpst = get_fpstatus_ptr(false); + fpst = get_fpstatus_ptr(size == MO_16); if (is_double) { TCGv_i64 tcg_op = tcg_temp_new_i64(); @@ -7880,34 +7880,57 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode, bool swap = false; int pass, maxpasses; - switch (opcode) { - case 0x2e: /* FCMLT (zero) */ - swap = true; - /* fall through */ - case 0x2c: /* FCMGT (zero) */ - genfn = gen_helper_neon_cgt_f32; - break; - case 0x2d: /* FCMEQ (zero) */ - genfn = gen_helper_neon_ceq_f32; - break; - case 0x6d: /* FCMLE (zero) */ - swap = true; - /* fall through */ - case 0x6c: /* FCMGE (zero) */ - genfn = gen_helper_neon_cge_f32; - break; - default: - g_assert_not_reached(); + if (size == MO_16) { + switch (opcode) { + case 0x2e: /* FCMLT (zero) */ + swap = true; + /* fall through */ + case 0x2c: /* FCMGT (zero) */ + genfn = gen_helper_advsimd_cgt_f16; + break; + case 0x2d: /* FCMEQ (zero) */ + genfn = gen_helper_advsimd_ceq_f16; + break; + case 0x6d: /* FCMLE (zero) */ + swap = true; + /* fall through */ + case 0x6c: /* FCMGE (zero) */ + genfn = gen_helper_advsimd_cge_f16; + break; + default: + g_assert_not_reached(); + } + } else { + switch (opcode) { + case 0x2e: /* FCMLT (zero) */ + swap = true; + /* fall through */ + case 0x2c: /* FCMGT (zero) */ + genfn = gen_helper_neon_cgt_f32; + break; + case 0x2d: /* FCMEQ (zero) */ + genfn = gen_helper_neon_ceq_f32; + break; + case 0x6d: /* FCMLE (zero) */ + swap = true; + /* fall through */ + case 0x6c: /* FCMGE (zero) */ + genfn = gen_helper_neon_cge_f32; + break; + default: + g_assert_not_reached(); + } } if (is_scalar) { maxpasses = 1; } else { - maxpasses = is_q ? 4 : 2; + int vector_size = 8 << is_q; + maxpasses = vector_size >> size; } for (pass = 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, int 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(DisasContext *s, uint32_t insn) fpop = deposit32(opcode, 5, 1, a); fpop = deposit32(fpop, 6, 1, u); + rd = extract32(insn, 0, 5); + rn = 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 = true; only_in_vector = true;