From patchwork Thu Feb 8 17:31:47 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: 127706 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1726109ljc; Thu, 8 Feb 2018 10:00:30 -0800 (PST) X-Google-Smtp-Source: AH8x224g8eArr29FQEHC+ngwBhmguZYprrqieuMnzbyFwl51lgc7j7K4LCQzz55v+M5NHMqIErig X-Received: by 10.37.64.194 with SMTP id n185mr28183yba.390.1518112830801; Thu, 08 Feb 2018 10:00:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518112830; cv=none; d=google.com; s=arc-20160816; b=qlpS3zZ24IgMvlyvEor1A7yQIwnt7HLG1YFcVaZhjxMz4LPkJdT4As2oIN5ln+LQfE OobmKwIRavZ1k2fr+80Bw5ujDl4mK0czCQqHUgcJFHqGDyb2ne297oMCbVLxKWPzx8hs ESp4ysGsCAmgEBoHfNlu5A21EhvH0c2kvwW8wscUbk3JWWBFXg8+ASlIUNngoyd0MIVY A8qu7GGQn+Rswz29/6tumpfzl9eFjfIkQEueoFz+rZa7MgpST0TXqljI61VmyhfTDwW8 QEiqMhQ4+3S6hd/QwSZivft6sSJKPBZrjbm6zrCgCyq2Uj8dJfu5Ro7Or9HhyoYFUcHF PpKQ== 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=lQlk313lEATGSOT2+WhMICU81WFdJyyDHn5jbHGR/vs=; b=tV7xZucUL5PrVR9Z8iBbErLOo+5bP5ksYrT7CyfjETHxj8HNFcjfnMCgwBdt0Lfm09 wu0eWdJcDe8oiqeryg4kahipps8up8Ou0lzkbYkc7yxzQVR7kRMHk7UzKXRPuLhHchcl Eeih0jizwOdj+j7b5KfJcvUdrClopUaGrRt0XcWkoaQnLYdloJ3Vhk9Gg5OpSIsMrYYG l1cw9bMG4qE75VslMYYxPEdQ2xEWu9NXJ2PhVluiDDRzxyq753EzN8ASel0DMPvV1cIe x4UL0htTmQoUJviUehQFacth6fiEfvcRTZZujJCqdZVPA8G9fLgUVH5KsWISAfLen1wY Lglg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HJrcxOaY; 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 t125si84090ywa.385.2018.02.08.10.00.30 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 08 Feb 2018 10:00:30 -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=HJrcxOaY; 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]:57731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejqUo-0001dy-6x for patch@linaro.org; Thu, 08 Feb 2018 13:00:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejqBY-00033G-L4 for qemu-devel@nongnu.org; Thu, 08 Feb 2018 12:40:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejqBW-0000Vd-7W for qemu-devel@nongnu.org; Thu, 08 Feb 2018 12:40:36 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:39185) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejqBV-0000Ui-UE for qemu-devel@nongnu.org; Thu, 08 Feb 2018 12:40:34 -0500 Received: by mail-wm0-x243.google.com with SMTP id b21so11520027wme.4 for ; Thu, 08 Feb 2018 09:40:33 -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=lQlk313lEATGSOT2+WhMICU81WFdJyyDHn5jbHGR/vs=; b=HJrcxOaYp3JpsgiG/rp/VAmcXMzkpIFgo5JY9D+elvKbZQHubdtPN2RcDbee23RBQt BABJ1Rz5N05AYu9cQktez1U7xxa94i5GYVkYS4d6jIULxbKwlx5nMsv9IvvMGQdu2iEI YKQFZjNT8UWhrztU9pSqp/jcS8FFyGrPRjF0k= 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=lQlk313lEATGSOT2+WhMICU81WFdJyyDHn5jbHGR/vs=; b=ev30mryphKmhNRBeVQX2dbTyHP5tpqxUeZVMN4uFGjC4KRNcMiGQL+g867F6jnzbIF Uv6hniF+TKfRByzJmwQ9uAI21EiebBFBwWVwdd4zPQ2s6PMEqYYPyY3OWAM+Y57jmbI1 pHs0aXgRV++qawk2YHeg9s23VoNRqyGsGuE44/ed3GHXD5uDvf9Zajj1lVY4LmA2YNp4 1se8VqNl4YOmXGTz7HAPyMHH31ojSCDTiak6zf5/6FlbgSQ1FyxuoG0oJ7alDeMjmWXz ADiTOyX4HTHY2OWWAp1HEQSZeN1dg4L+CXmR08xXx1R+dtsUy/WfHP0UqzzeemAfZxyr Hsmg== X-Gm-Message-State: APf1xPA71UXSk6evsywRvMQgIJvrYxbKwDVj3b675NSMiR/2gD83apLm qmXCUi/QKLLeQqCqAw9uf0CTFA== X-Received: by 10.28.120.19 with SMTP id t19mr45220wmc.53.1518111632830; Thu, 08 Feb 2018 09:40:32 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h200sm441650wme.11.2018.02.08.09.40.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 09:40:29 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 621FA3E0E17; 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:47 +0000 Message-Id: <20180208173157.24705-23-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:c09::243 Subject: [Qemu-devel] [PATCH v2 22/32] arm/translate-a64: add FP16 FNEG/FABS 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: 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" As these operations doesn't use the fpstatus pointer we can be smarter about allocating it. The negh can also be done with a bitwise xor rather than calling a helper. Signed-off-by: Alex Bennée --- target/arm/translate-a64.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.15.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 5baf0261ff..da3c7bfa85 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -10801,6 +10801,7 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) TCGv_i32 tcg_rmode = NULL; TCGv_ptr tcg_fpstatus = NULL; bool need_rmode = false; + bool need_fpst = true; int rmode; if (!arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { @@ -10917,6 +10918,10 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) need_rmode = true; rmode = FPROUNDING_ZERO; break; + case 0x2f: /* FABS */ + case 0x6f: /* FNEG */ + need_fpst = false; + break; default: fprintf(stderr, "%s: insn %#04x fpop %#2x\n", __func__, insn, fpop); g_assert_not_reached(); @@ -10970,6 +10975,9 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x7b: /* FCVTZU */ gen_helper_advsimd_f16touinth(tcg_res, tcg_op, tcg_fpstatus); break; + case 0x6f: /* FNEG */ + tcg_gen_xori_i32(tcg_res, tcg_op, 0x8000); + break; default: g_assert_not_reached(); } @@ -11013,6 +11021,12 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x59: /* FRINTX */ gen_helper_advsimd_rinth_exact(tcg_res, tcg_op, tcg_fpstatus); break; + case 0x2f: /* FABS */ + gen_helper_advsimd_absh(tcg_res, tcg_op); + break; + case 0x6f: /* FNEG */ + tcg_gen_xori_i32(tcg_res, tcg_op, 0x8000); + break; default: g_assert_not_reached(); }