From patchwork Tue Feb 27 14:38:40 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: 129820 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp379305edc; Tue, 27 Feb 2018 07:02:36 -0800 (PST) X-Google-Smtp-Source: AG47ELsupp/iH/PWlRzyUJwqoKf214RmgLMTn1a3gIoJAE4K7rS4FPUTIiufILla1fAX3mwspJ60 X-Received: by 2002:a25:c0d5:: with SMTP id c204-v6mr9579560ybf.133.1519743756456; Tue, 27 Feb 2018 07:02:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519743756; cv=none; d=google.com; s=arc-20160816; b=cxOsVXUkGc4AsDUaNFEuOTkmoLox8Z0Sn5DmwvUWxQYv35cN5m3wsclBNMh95WS4Db OxKx9/7+B/POfKQFC9izabFqwLFxJBzmQfvvMh34tb1beyohlIhRccxi3hkzevP4D+GA 3qdrn57pzbFxnQugeHsHWrDIByJcjsiHKBpckpZVbcfCSxftbU3IGAvDVSqVasZIoW0I Lm04UHwI5ja/aTLxtUdmoPBjAsMXpzSgbkHai5u8WJIS2ERQQAvr1OUr8CGjXEcktxQK fkgTPVes0UcUYtK20bq2jJzz2hI7b2cJKVGY3uXlUBYUtOXYLjPYwmiF5cvZ7qC98tvP C6qQ== 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=wtsGLpj5HYnjdS0RuBsM84gfH0NjXM9FmLJOGGTxHHM=; b=id9W2iQz/2eQnN8FoYC5py1bEX4MG4XhBXTNZ/QuFAgyHOUDGxEabGVo3KMZgBGV4y xyFDGguK9dOCMvTCON0vENdnD75Mq5fi/YzneeKEEspLvcvwoNafJtWvWh1JKzieobOf eyalYNCsX2itRHN8mZ//YUvQBOHOJtUFiDU1KiUw5KG1de4zuczuu3nPPHMaGI+4YpMU Tbs3c/vOfKyCP8XLbWuxUSgyLUfPpEgqQW2BgmV8E9dvCS8TDivTTZaZHx9AbW3HtmHu KrfkeeTpUjuOlNfOShG28V52hUUGS3BQuzfAYmE3Vg0nyz1j0s3Ejfxk9U51ljmaF6tu nw4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UN+21Uju; 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 d28-v6si1205309ybe.129.2018.02.27.07.02.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 27 Feb 2018 07:02:36 -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=UN+21Uju; 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]:37833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqgm3-0006hq-Ru for patch@linaro.org; Tue, 27 Feb 2018 10:02:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqgY6-0003Z1-76 for qemu-devel@nongnu.org; Tue, 27 Feb 2018 09:48:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqgY3-0001MZ-2t for qemu-devel@nongnu.org; Tue, 27 Feb 2018 09:48:10 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:33907) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eqgY2-0001Gv-Jn for qemu-devel@nongnu.org; Tue, 27 Feb 2018 09:48:06 -0500 Received: by mail-wr0-x244.google.com with SMTP id m5so25156792wrg.1 for ; Tue, 27 Feb 2018 06:48:06 -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=wtsGLpj5HYnjdS0RuBsM84gfH0NjXM9FmLJOGGTxHHM=; b=UN+21UjuhuCcSTmii2pUiOCt+C8AZ3En6Qo8dXRDtuz9MCwimHPHxveycaQl2ne4FU Juof6HEpb+La1d6hv4eG8wRT9rWxo9IYiESurYl97/es3fQUCnFgKAjfk/Eu8QF+DB3K RjWWFNi+RQp+DjgzzfjTtdAirvVlLzl5SzfeU= 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=wtsGLpj5HYnjdS0RuBsM84gfH0NjXM9FmLJOGGTxHHM=; b=J06e/HtnTg8xrzjQEXoqDCNjDEMsXuQIq9XeWg4omKtg5TUsaIvLmcrmrzEEkc0izA He0aOvJ2T0YyUcXX7x1GHB5otsYm+++BaMSKpNao9mNjT49x4ggI20yhnCJfyF6tjLSm pnJbRmb46Lj1BpXOjjIAfKsP28iL0VhyoObKIbUDpPJszY2ENqDFzXXLcgqYKCWWT7oR hqfD25Wt/Ye0s5YW3kuMKlSVLaf8X8uO1Ux4Om6Xoyse294zyX8GWsWYyKF3TYvQ+9CF WogFO+MRbQTOOoY9SBE+rOuIq/PoUvLARDQmj/GqSeIMzWBEDGvzgg40ySbgQGk9ul1Y pHWg== X-Gm-Message-State: APf1xPBbjaFtfUzmIIyo///lVCiUxFqPYCqDj74perxSWcKQaDDwfjEY h09Nq4toRbpvd/RGwRbuBAJttxW1GB8= X-Received: by 10.223.161.144 with SMTP id u16mr13419932wru.137.1519742885350; Tue, 27 Feb 2018 06:48:05 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l11sm8843624wrg.71.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 57FFB3E15D4; Tue, 27 Feb 2018 14:38:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-arm@nongnu.org Date: Tue, 27 Feb 2018 14:38:40 +0000 Message-Id: <20180227143852.11175-20-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::244 Subject: [Qemu-devel] [PATCH v4 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 Reviewed-by: Richard Henderson --- 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 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 046079b1b3..9c02f1e23c 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;