aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2015-04-30 17:01:34 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2015-04-30 17:01:34 +0000
commit19261b995bae88efa98e73cf9cf002aa1a4163ff (patch)
tree629fbbea5d97ea49db1550b3e85ff8255ce3da35
parent6365da9ed071eaa11f25a5a872d5357e66da1db3 (diff)
downloadgcc-19261b995bae88efa98e73cf9cf002aa1a4163ff.zip
gcc-19261b995bae88efa98e73cf9cf002aa1a4163ff.tar.gz
gcc-19261b995bae88efa98e73cf9cf002aa1a4163ff.tar.bz2
[AArch64] Properly cost FABD pattern
* config/aarch64/aarch64.c (aarch64_rtx_costs): Handle pattern for fabd in ABS case. From-SVN: r222638
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/aarch64/aarch64.c14
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a4569bb..3710788 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2015-04-30 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+ * config/aarch64/aarch64.c (aarch64_rtx_costs): Handle pattern for
+ fabd in ABS case.
+
+2015-04-30 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
* config/aarch64/aarch64.md
(*eor_one_cmpl_<SHIFT:optab><mode>3_alt): New pattern.
(*eor_one_cmpl_<SHIFT:optab>sidi3_alt_ze): Likewise.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 7579f5b..f1aec67 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;
}