This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][AArch64] Remember to cost operand 0 in FP compare-with-0.0 case

Hi all,

In rtx costs we should remember to add the cost of operand 0 when handling the compare-with-0.0 case.
This simple patch does that.

Bootstrapped and tested on aarch64-linux.

Ok for stage 1?


2015-05-01  Kyrylo Tkachov  <>

    * config/aarch64/aarch64.c (aarch64_rtx_costs, COMPARE case):
    Add cost of op0 in the compare-with-fpzero case.
commit fb206cd3597ca541692ca5d1f1f4bc1d8353ebfa
Author: Kyrylo Tkachov <>
Date:   Tue Mar 3 10:44:53 2015 +0000

    [AArch64] Remember to cost operand 0 in FP compare-with-0.0 case

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index e19b592..fb9b839 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -5857,6 +5857,7 @@ aarch64_rtx_costs (rtx x, int code, int outer ATTRIBUTE_UNUSED,
           if (CONST_DOUBLE_P (op1) && aarch64_float_const_zero_rtx_p (op1))
+              *cost += rtx_cost (op0, COMPARE, 0, speed);
               /* FCMP supports constant 0.0 for no extra cost. */
               return true;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]