This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: rtx_costs as a target hook
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 22 Feb 2003 04:46:12 +0100
- Subject: Re: rtx_costs as a target hook
> Date: Mon, 27 Jan 2003 20:51:43 -0800
> From: Richard Henderson <rth at redhat dot com>
> There appears to be a disconnect between different implementations.
> In particular, a few take care to be able to evaluate the cost for
> arbitrary rtx, while most only handle valid instructions. I've not
> yet looked to see how this winds up being used in practice, but I
> suspect that most of the implementations are buggy. I didn't change
> any of the implementations one way or another.
I found no way to improve results for mmix-*-*; "obvious
improvements" to *_COSTS failed to improve the results for both
ghostscrupt (hacked) and the mmix simulator (running itself)
from main trunk some time last spring.
> Built cc1 on one of each; bootstraped i686-linux.
Except cris-*-*, it seems. Built and tested on cris-axis-elf.
* config/cris/cris.c (cris_rtx_costs): Blockify dangling else.
Fix functionalization typo.
Index: config/cris/cris.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.c,v
retrieving revision 1.35
diff -p -c -r1.35 cris.c
*** config/cris/cris.c 28 Jan 2003 21:32:24 -0000 1.35
--- config/cris/cris.c 22 Feb 2003 03:35:17 -0000
***************
*** 1,5 ****
/* Definitions for GCC. Part of the machine description for CRIS.
! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Axis Communications. Written by Hans-Peter Nilsson.
This file is part of GCC.
--- 1,5 ----
/* Definitions for GCC. Part of the machine description for CRIS.
! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Axis Communications. Written by Hans-Peter Nilsson.
This file is part of GCC.
*************** cris_rtx_costs (x, code, outer_code, tot
*** 2128,2137 ****
and the PIC register. For a global PIC symbol, we also
need a read of the GOT. */
if (flag_pic)
! if (cris_got_symbol (x))
! *total = 2 + 4 + 6;
! else
! *total = 2 + 6;
else
*total = 6;
return true;
--- 2128,2139 ----
and the PIC register. For a global PIC symbol, we also
need a read of the GOT. */
if (flag_pic)
! {
! if (cris_got_symbol (x))
! *total = 2 + 4 + 6;
! else
! *total = 2 + 6;
! }
else
*total = 6;
return true;
*************** cris_rtx_costs (x, code, outer_code, tot
*** 2169,2175 ****
case UMOD:
case DIV:
if (GET_CODE (XEXP (x, 1)) != CONST_INT
! || exact_log2 (INTVAL (XEXP (X, 1)) < 0))
{
/* Estimate this as 4 + 8 * #of bits. */
*total = COSTS_N_INSNS (260);
--- 2171,2177 ----
case UMOD:
case DIV:
if (GET_CODE (XEXP (x, 1)) != CONST_INT
! || exact_log2 (INTVAL (XEXP (x, 1)) < 0))
{
/* Estimate this as 4 + 8 * #of bits. */
*total = COSTS_N_INSNS (260);
brgds, H-P