public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] Remember to cost operand 0 in FP compare-with-0.0 case
@ 2015-05-01  8:20 Kyrill Tkachov
  2015-05-01  8:45 ` Marcus Shawcroft
  0 siblings, 1 reply; 2+ messages in thread
From: Kyrill Tkachov @ 2015-05-01  8:20 UTC (permalink / raw)
  To: GCC Patches; +Cc: Marcus Shawcroft, Richard Earnshaw, James Greenhalgh

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

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?

Thanks,
Kyrill

2015-05-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/aarch64/aarch64.c (aarch64_rtx_costs, COMPARE case):
     Add cost of op0 in the compare-with-fpzero case.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: aarch64-costs-fcmp-zero.patch --]
[-- Type: text/x-patch; name=aarch64-costs-fcmp-zero.patch, Size: 745 bytes --]

commit fb206cd3597ca541692ca5d1f1f4bc1d8353ebfa
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
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;
             }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][AArch64] Remember to cost operand 0 in FP compare-with-0.0 case
  2015-05-01  8:20 [PATCH][AArch64] Remember to cost operand 0 in FP compare-with-0.0 case Kyrill Tkachov
@ 2015-05-01  8:45 ` Marcus Shawcroft
  0 siblings, 0 replies; 2+ messages in thread
From: Marcus Shawcroft @ 2015-05-01  8:45 UTC (permalink / raw)
  To: Kyrill Tkachov
  Cc: GCC Patches, Marcus Shawcroft, Richard Earnshaw, James Greenhalgh

On 1 May 2015 at 09:20, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:

> 2015-05-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     * config/aarch64/aarch64.c (aarch64_rtx_costs, COMPARE case):
>     Add cost of op0 in the compare-with-fpzero case.

ok /Marcus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-01  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-01  8:20 [PATCH][AArch64] Remember to cost operand 0 in FP compare-with-0.0 case Kyrill Tkachov
2015-05-01  8:45 ` Marcus Shawcroft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).