Commit d2b6eb76 by Zack Weinberg

arm.c (ARM_ADDRESS_COST, [...]): Convert macros to inline functions...

	* arm.c (ARM_ADDRESS_COST, THUMB_ADDRESS_COST): Convert macros
	to inline functions: arm_arm_address_cost, arm_thumb_address_cost
	respectively.
	(arm_address_cost): Use 'em.

From-SVN: r74560
parent 15975b43
2003-12-11 Zack Weinberg <zack@codesourcery.com>
* arm.c (ARM_ADDRESS_COST, THUMB_ADDRESS_COST): Convert macros
to inline functions: arm_arm_address_cost, arm_thumb_address_cost
respectively.
(arm_address_cost): Use 'em.
2003-12-12 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 2003-12-12 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Define * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Define
...@@ -99,7 +106,7 @@ ...@@ -99,7 +106,7 @@
PR c/13134 PR c/13134
* c-decl.c (duplicate_decls): Copy visibility flag when appropriate. * c-decl.c (duplicate_decls): Copy visibility flag when appropriate.
2003-12-09 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> 2003-12-09 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
* config/m32r/m32r.h: Add support for m32r2 processor. Including * config/m32r/m32r.h: Add support for m32r2 processor. Including
...@@ -132,7 +139,7 @@ ...@@ -132,7 +139,7 @@
2003-12-08 Stuart Hastings <stuart@apple.com> 2003-12-08 Stuart Hastings <stuart@apple.com>
* config/i386/i386.md: Typo in split of fp-valued if_then_else. * config/i386/i386.md: Typo in split of fp-valued if_then_else.
2003-12-08 James E Wilson <wilson@specifixinc.com> 2003-12-08 James E Wilson <wilson@specifixinc.com>
PR target/13132 PR target/13132
...@@ -197,7 +204,7 @@ ...@@ -197,7 +204,7 @@
2003-12-08 Arnaud Charlet <charlet@act-europe.fr> 2003-12-08 Arnaud Charlet <charlet@act-europe.fr>
PR ada/13324, PR ada/12614 PR ada/13324, PR ada/12614
* doc/install.texi: Update requirements for building Ada. * doc/install.texi: Update requirements for building Ada.
2003-12-07 David Edelsohn <edelsohn@gnu.org> 2003-12-07 David Edelsohn <edelsohn@gnu.org>
Graham Reed <greed@pobox.com> Graham Reed <greed@pobox.com>
...@@ -256,7 +263,7 @@ ...@@ -256,7 +263,7 @@
2003-12-06 Andrew Pinski <pinskia@physics.uc.edu> 2003-12-06 Andrew Pinski <pinskia@physics.uc.edu>
* config/rs6000/rs6000.c (macho_branch_islands): Use * config/rs6000/rs6000.c (macho_branch_islands): Use
HOST_WIDE_INT_PRINT_UNSIGNED. HOST_WIDE_INT_PRINT_UNSIGNED.
2003-12-06 Richard Sandiford <rsandifo@redhat.com> 2003-12-06 Richard Sandiford <rsandifo@redhat.com>
...@@ -329,7 +336,7 @@ ...@@ -329,7 +336,7 @@
* config/rs6000/rs6000.md: Correct macro test of TARGET_MACHO. * config/rs6000/rs6000.md: Correct macro test of TARGET_MACHO.
2003-12-05 Stuart Menefy <stuart.menefy@st.com> 2003-12-05 Stuart Menefy <stuart.menefy@st.com>
J"orn Rennecke <joern.rennecke@superh.com> J"orn Rennecke <joern.rennecke@superh.com>
PR target/13302 PR target/13302
* sh.c (sh_build_builtin_va_list): Use (*lang_hooks.types.make_type). * sh.c (sh_build_builtin_va_list): Use (*lang_hooks.types.make_type).
...@@ -376,7 +383,7 @@ ...@@ -376,7 +383,7 @@
2003-12-05 Peter Gerwinski <peter@gerwinski.de> 2003-12-05 Peter Gerwinski <peter@gerwinski.de>
* tree.def (PLACEHOLDER_EXPR): Clarify commentary. * tree.def (PLACEHOLDER_EXPR): Clarify commentary.
2003-12-05 Steven Bosscher <stevenb@suse.de> 2003-12-05 Steven Bosscher <stevenb@suse.de>
...@@ -419,14 +426,14 @@ ...@@ -419,14 +426,14 @@
2003-12-04 Stuart Hastings <stuart@apple.com> 2003-12-04 Stuart Hastings <stuart@apple.com>
* rs6000.c (output_call, macho_branch_islands, * rs6000.c (output_call, macho_branch_islands,
add_compiler_branch_island, no_previous_def, get_previous_label) add_compiler_branch_island, no_previous_def, get_previous_label)
Revisions of xx_stub functions for branch islands, Revisions of xx_stub functions for branch islands,
add -fPIC support for Darwin. add -fPIC support for Darwin.
* rs6000-protos.h (output_call) Prototype. * rs6000-protos.h (output_call) Prototype.
* rs6000.md Use output_call. * rs6000.md Use output_call.
* invoke.texi Explain Darwin semantics of -longcall. * invoke.texi Explain Darwin semantics of -longcall.
* testsuite/gcc.dg/darwin-abi-1.c Revise testcase for -longcall/jbsr. * testsuite/gcc.dg/darwin-abi-1.c Revise testcase for -longcall/jbsr.
2003-12-04 Richard Henderson <rth@redhat.com> 2003-12-04 Richard Henderson <rth@redhat.com>
...@@ -533,8 +540,8 @@ ...@@ -533,8 +540,8 @@
2003-12-03 Eric Christopher <echristo@redhat.com> 2003-12-03 Eric Christopher <echristo@redhat.com>
* c-parse.in (c_in_iteration_stmt, c_in_case_stmt): Move * c-parse.in (c_in_iteration_stmt, c_in_case_stmt): Move
from here... from here...
* c-tree.h: to here. * c-tree.h: to here.
2003-12-03 Jan Hubicka <jh@suse.cz> 2003-12-03 Jan Hubicka <jh@suse.cz>
......
...@@ -3535,32 +3535,52 @@ arm_rtx_costs (rtx x, int code, int outer_code, int *total) ...@@ -3535,32 +3535,52 @@ arm_rtx_costs (rtx x, int code, int outer_code, int *total)
the same for practically all of them. So we weight the different types the same for practically all of them. So we weight the different types
of address here in the order (most pref first): of address here in the order (most pref first):
PRE/POST_INC/DEC, SHIFT or NON-INT sum, INT sum, REG, MEM or LABEL. */ PRE/POST_INC/DEC, SHIFT or NON-INT sum, INT sum, REG, MEM or LABEL. */
static inline int
arm_arm_address_cost (rtx x)
{
enum rtx_code c = GET_CODE (x);
if (c == PRE_INC || c == PRE_DEC || c == POST_INC || c == POST_DEC)
return 0;
if (c == MEM || c == LABEL_REF || c == SYMBOL_REF)
return 10;
if (c == PLUS || c == MINUS)
{
char cl0 = GET_RTX_CLASS (GET_CODE (XEXP (x, 0)));
char cl1 = GET_RTX_CLASS (GET_CODE (XEXP (x, 1)));
if (GET_CODE (XEXP (x, 0)) == CONST_INT)
return 2;
if (cl0 == '2' || cl0 == 'c' || cl1 == '2' || cl1 == 'c')
return 3;
return 4;
}
return 6;
}
static inline int
arm_thumb_address_cost (rtx x)
{
enum rtx_code c = GET_CODE (x);
if (c == REG)
return 1;
if (c == PLUS
&& GET_CODE (XEXP (x, 0)) == REG
&& GET_CODE (XEXP (x, 1)) == CONST_INT)
return 1;
return 2;
}
static int static int
arm_address_cost (rtx x) arm_address_cost (rtx x)
{ {
#define ARM_ADDRESS_COST(X) \ return TARGET_ARM ? arm_arm_address_cost (x) : arm_thumb_address_cost (x);
(10 - ((GET_CODE (X) == MEM || GET_CODE (X) == LABEL_REF \
|| GET_CODE (X) == SYMBOL_REF) \
? 0 \
: ((GET_CODE (X) == PRE_INC || GET_CODE (X) == PRE_DEC \
|| GET_CODE (X) == POST_INC || GET_CODE (X) == POST_DEC) \
? 10 \
: (((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS) \
? 6 + (GET_CODE (XEXP (X, 1)) == CONST_INT ? 2 \
: ((GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == '2' \
|| GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == 'c' \
|| GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == '2' \
|| GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == 'c') \
? 1 : 0)) \
: 4)))))
#define THUMB_ADDRESS_COST(X) \
((GET_CODE (X) == REG \
|| (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \
&& GET_CODE (XEXP (X, 1)) == CONST_INT)) \
? 1 : 2)
return (TARGET_ARM ? ARM_ADDRESS_COST (x) : THUMB_ADDRESS_COST (x));
} }
static int static int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment