]> gcc.gnu.org Git - gcc.git/commitdiff
arm.c (ARM_ADDRESS_COST, [...]): Convert macros to inline functions...
authorZack Weinberg <zack@gcc.gnu.org>
Fri, 12 Dec 2003 02:23:03 +0000 (02:23 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Fri, 12 Dec 2003 02:23:03 +0000 (02:23 +0000)
* 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

gcc/ChangeLog
gcc/config/arm/arm.c

index 8fae82c9a46ae8331d630d6732a8ec6f5d881f3a..08e75f5c90a3c228ae4fe483dd604b988655c258 100644 (file)
@@ -1,3 +1,10 @@
+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>
 
        * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Define
 
        PR c/13134
        * c-decl.c (duplicate_decls): Copy visibility flag when appropriate.
-       
+
 2003-12-09  Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
 
        * config/m32r/m32r.h: Add support for m32r2 processor.  Including
 2003-12-08  Stuart Hastings  <stuart@apple.com>
 
        * config/i386/i386.md: Typo in split of fp-valued if_then_else.
-       
+
 2003-12-08  James E Wilson  <wilson@specifixinc.com>
 
        PR target/13132
 2003-12-08  Arnaud Charlet  <charlet@act-europe.fr>
 
        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>
            Graham Reed <greed@pobox.com>
 
 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.
 
 2003-12-06  Richard Sandiford  <rsandifo@redhat.com>
        * config/rs6000/rs6000.md: Correct macro test of TARGET_MACHO.
 
 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
        * sh.c (sh_build_builtin_va_list): Use (*lang_hooks.types.make_type).
 
 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-04  Stuart Hastings  <stuart@apple.com>
 
-        * rs6000.c (output_call, macho_branch_islands,
-        add_compiler_branch_island, no_previous_def, get_previous_label)
-        Revisions of xx_stub functions for branch islands,
-        add -fPIC support for Darwin.
-        * rs6000-protos.h (output_call) Prototype.
-        * rs6000.md Use output_call.
-        * invoke.texi Explain Darwin semantics of -longcall.
-        * testsuite/gcc.dg/darwin-abi-1.c Revise testcase for -longcall/jbsr.
+       * rs6000.c (output_call, macho_branch_islands,
+       add_compiler_branch_island, no_previous_def, get_previous_label)
+       Revisions of xx_stub functions for branch islands,
+       add -fPIC support for Darwin.
+       * rs6000-protos.h (output_call) Prototype.
+       * rs6000.md Use output_call.
+       * invoke.texi Explain Darwin semantics of -longcall.
+       * testsuite/gcc.dg/darwin-abi-1.c Revise testcase for -longcall/jbsr.
 
 2003-12-04  Richard Henderson  <rth@redhat.com>
 
 2003-12-03  Eric Christopher  <echristo@redhat.com>
 
        * c-parse.in (c_in_iteration_stmt, c_in_case_stmt): Move
-        from here...
-        * c-tree.h: to here.
+       from here...
+       * c-tree.h: to here.
 
 2003-12-03  Jan Hubicka  <jh@suse.cz>
 
index cadbe65fe44bba6f4e274fa59a37fe6e37ead99d..3d991443c5df2ce8b5019f1b7843df3817128522 100644 (file)
@@ -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
    of address here in the order (most pref first):
    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
 arm_address_cost (rtx x)
 {
-#define ARM_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));
+  return TARGET_ARM ? arm_arm_address_cost (x) : arm_thumb_address_cost (x);
 }
 
 static int
This page took 0.09236 seconds and 5 git commands to generate.