aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/aarch64
diff options
context:
space:
mode:
authorJames Greenhalgh <james.greenhalgh@arm.com>2014-05-16 09:12:14 +0000
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>2014-05-16 09:12:14 +0000
commit4105fe38857a36b4e604d98a7bbc888225bf187f (patch)
tree8d344696e1459777ac94badc88062c0fc5c793bf /gcc/config/aarch64
parent7cc2145f544f4ef8cbb0b74a789712ad88d5e638 (diff)
downloadgcc-4105fe38857a36b4e604d98a7bbc888225bf187f.zip
gcc-4105fe38857a36b4e604d98a7bbc888225bf187f.tar.gz
gcc-4105fe38857a36b4e604d98a7bbc888225bf187f.tar.bz2
[AArch64 costs 13/18] Improve costs for div/mod
gcc/ * config/aarch64/aarch64.c (aarch64_rtx_costs): Improve costs for DIV/MOD. Co-Authored-By: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> From-SVN: r210505
Diffstat (limited to 'gcc/config/aarch64')
-rw-r--r--gcc/config/aarch64/aarch64.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 37c791d..6c2682a 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -5476,7 +5476,6 @@ cost_minus:
case MOD:
case UMOD:
- *cost = COSTS_N_INSNS (2);
if (speed)
{
if (GET_MODE_CLASS (GET_MODE (x)) == MODE_INT)
@@ -5493,15 +5492,15 @@ cost_minus:
case DIV:
case UDIV:
- *cost = COSTS_N_INSNS (1);
+ case SQRT:
if (speed)
{
- if (GET_MODE_CLASS (GET_MODE (x)) == MODE_INT)
- *cost += extra_cost->mult[GET_MODE (x) == DImode].idiv;
- else if (GET_MODE (x) == DFmode)
- *cost += extra_cost->fp[1].div;
- else if (GET_MODE (x) == SFmode)
- *cost += extra_cost->fp[0].div;
+ if (GET_MODE_CLASS (mode) == MODE_INT)
+ /* There is no integer SQRT, so only DIV and UDIV can get
+ here. */
+ *cost += extra_cost->mult[mode == DImode].idiv;
+ else
+ *cost += extra_cost->fp[mode == DFmode].div;
}
return false; /* All arguments need to be in registers. */