From: Kyrylo Tkachov Date: Thu, 30 Apr 2015 17:01:34 +0000 (+0000) Subject: [AArch64] Properly cost FABD pattern X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=19261b995bae88efa98e73cf9cf002aa1a4163ff;p=gcc.git [AArch64] Properly cost FABD pattern * config/aarch64/aarch64.c (aarch64_rtx_costs): Handle pattern for fabd in ABS case. From-SVN: r222638 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4569bbc075..371078896d8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-04-30 Kyrylo Tkachov + + * config/aarch64/aarch64.c (aarch64_rtx_costs): Handle pattern for + fabd in ABS case. + 2015-04-30 Kyrylo Tkachov * config/aarch64/aarch64.md diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 7579f5b2519..f1aec673a9a 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -6387,7 +6387,19 @@ cost_plus: case ABS: if (GET_MODE_CLASS (mode) == MODE_FLOAT) { - /* FABS and FNEG are analogous. */ + op0 = XEXP (x, 0); + + /* FABD, which is analogous to FADD. */ + if (GET_CODE (op0) == MINUS) + { + *cost += rtx_cost (XEXP (op0, 0), MINUS, 0, speed); + + rtx_cost (XEXP (op0, 1), MINUS, 1, speed); + if (speed) + *cost += extra_cost->fp[mode == DFmode].addsub; + + return true; + } + /* Simple FABS is analogous to FNEG. */ if (speed) *cost += extra_cost->fp[mode == DFmode].neg; }