代码拉取完成,页面将自动刷新
同步操作将从 eastb233/src-openeuler_gcc 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From dbf3dc75888623e9d4bb7cc5e9c30caa9b24ffe7 Mon Sep 17 00:00:00 2001
From: Bu Le <bule1@huawei.com>
Date: Thu, 12 Mar 2020 22:39:12 +0000
Subject: [PATCH] aarch64: Add --params to control the number of recip steps
[PR94154]
-mlow-precision-div hard-coded the number of iterations to 2 for double
and 1 for float. This patch adds a --param to control the number.
2020-03-13 Bu Le <bule1@huawei.com>
gcc/
PR target/94154
* config/aarch64/aarch64.opt (-param=aarch64-float-recp-precision=)
(-param=aarch64-double-recp-precision=): New options.
* doc/invoke.texi: Document them.
* config/aarch64/aarch64.c (aarch64_emit_approx_div): Use them
instead of hard-coding the choice of 1 for float and 2 for double.
---
gcc/ChangeLog | 9 +++++++++
gcc/config/aarch64/aarch64.c | 8 +++++---
gcc/config/aarch64/aarch64.opt | 9 +++++++++
gcc/doc/invoke.texi | 11 +++++++++++
4 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index c320d5ba51d..2c81f86dd2a 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -12911,10 +12911,12 @@ aarch64_emit_approx_div (rtx quo, rtx num, rtx den)
/* Iterate over the series twice for SF and thrice for DF. */
int iterations = (GET_MODE_INNER (mode) == DFmode) ? 3 : 2;
- /* Optionally iterate over the series once less for faster performance,
- while sacrificing the accuracy. */
+ /* Optionally iterate over the series less for faster performance,
+ while sacrificing the accuracy. The default is 2 for DF and 1 for SF. */
if (flag_mlow_precision_div)
- iterations--;
+ iterations = (GET_MODE_INNER (mode) == DFmode
+ ? PARAM_VALUE (PARAM_AARCH64_DOUBLE_RECP_PRECISION)
+ : PARAM_VALUE (PARAM_AARCH64_FLOAT_RECP_PRECISION));
/* Iterate over the series to calculate the approximate reciprocal. */
rtx xtmp = gen_reg_rtx (mode);
--- a/gcc/params.def 2020-04-15 17:24:31.984000000 +0800
+++ b/gcc/params.def 2020-04-15 16:59:21.752000000 +0800
@@ -1420,6 +1414,17 @@ DEFPARAM(PARAM_SSA_NAME_DEF_CHAIN_LIMIT,
"a value.",
512, 0, 0)
+DEFPARAM(PARAM_AARCH64_FLOAT_RECP_PRECISION,
+ "aarch64-float-recp-precision",
+ "The number of Newton iterations for calculating the reciprocal "
+ "for float type. ",
+ 1, 1, 5)
+
+DEFPARAM(PARAM_AARCH64_DOUBLE_RECP_PRECISION,
+ "aarch64-double-recp-precision",
+ "The number of Newton iterations for calculating the reciprocal "
+ "for double type.",
+ 2, 1, 5)
/*
Local variables:
--
2.18.2
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。