diff mbox

[STORMY16] Hookize GO_IF_MODE_DEPENDENT_ADDRESS

Message ID 02751912.20110218201045@post.ru
State New
Headers show

Commit Message

Anatoly Sokolov Feb. 18, 2011, 5:10 p.m. UTC
Hello.

  This patch removes obsolete GO_IF_MODE_DEPENDENT_ADDRESS macros from 
STORMY16 back end in the GCC and introduces equivalent 
TARGET_MODE_DEPENDENT_ADDRESS_P target hook.

  Regression tested on xstormy16-unknown-elf.

  OK to install?

        * config/stormy16/stormy16.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
        * config/stormy16/stormy16-protos.h
        (xstormy16_mode_dependent_address_p): Remove.
        * config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p):
        Make static. Change return type to bool. Change argument type to
        const_rtx. Remove dead code.
        (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.



Anatoly.

Comments

Nick Clifton Feb. 21, 2011, 12:49 p.m. UTC | #1
Hi Anatoly,

>    OK to install?
>
>          * config/stormy16/stormy16.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
>          * config/stormy16/stormy16-protos.h
>          (xstormy16_mode_dependent_address_p): Remove.
>          * config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p):
>          Make static. Change return type to bool. Change argument type to
>          const_rtx. Remove dead code.
>          (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.

Approved - please apply.

Cheers
   Nick
diff mbox

Patch

Index: gcc/config/stormy16/stormy16.c
===================================================================
--- gcc/config/stormy16/stormy16.c      (revision 170195)
+++ gcc/config/stormy16/stormy16.c      (working copy)
@@ -647,40 +647,27 @@ 
   return false;
 }
 
-/* Return nonzero if memory address X (an RTX) can have different
-   meanings depending on the machine mode of the memory reference it
-   is used for or if the address is valid for some modes but not
-   others.
+/* Worker function for TARGET_MODE_DEPENDENT_ADDRESS_P.
 
-   Autoincrement and autodecrement addresses typically have mode-dependent
-   effects because the amount of the increment or decrement is the size of the
-   operand being addressed.  Some machines have other mode-dependent addresses.
-   Many RISC machines have no mode-dependent addresses.
-
-   You may assume that ADDR is a valid address for the machine.
-
    On this chip, this is true if the address is valid with an offset
    of 0 but not of 6, because in that case it cannot be used as an
    address for DImode or DFmode, or if the address is a post-increment
    or pre-decrement address.  */
 
-int
-xstormy16_mode_dependent_address_p (rtx x)
+static bool
+xstormy16_mode_dependent_address_p (const_rtx x)
 {
   if (LEGITIMATE_ADDRESS_CONST_INT_P (x, 0)
       && ! LEGITIMATE_ADDRESS_CONST_INT_P (x, 6))
-    return 1;
+    return true;
 
   if (GET_CODE (x) == PLUS
       && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (x, 1), 0)
       && ! LEGITIMATE_ADDRESS_INTEGER_P (XEXP (x, 1), 6))
-    return 1;
+    return true;
 
-  if (GET_CODE (x) == PLUS)
-    x = XEXP (x, 0);
-
   /* Auto-increment addresses are now treated generically in recog.c.  */
-  return 0;
+  return false;
 }
 
 int
@@ -2619,6 +2606,8 @@ 
 
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P    xstormy16_legitimate_address_p
+#undef TARGET_MODE_DEPENDENT_ADDRESS_P
+#define TARGET_MODE_DEPENDENT_ADDRESS_P xstormy16_mode_dependent_address_p
 
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE xstormy16_can_eliminate
Index: gcc/config/stormy16/stormy16.h
===================================================================
--- gcc/config/stormy16/stormy16.h      (revision 170195)
+++ gcc/config/stormy16/stormy16.h      (working copy)
@@ -371,14 +371,6 @@ 
 
 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
 
-/* On this chip, this is true if the address is valid with an offset
-   of 0 but not of 6, because in that case it cannot be used as an
-   address for DImode or DFmode, or if the address is a post-increment
-   or pre-decrement address.  */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)                       \
-  if (xstormy16_mode_dependent_address_p (ADDR))                       \
-    goto LABEL
-
 #define LEGITIMATE_CONSTANT_P(X) 1
 
 
Index: gcc/config/stormy16/stormy16-protos.h
===================================================================
--- gcc/config/stormy16/stormy16-protos.h       (revision 170195)
+++ gcc/config/stormy16/stormy16-protos.h       (working copy)
@@ -44,7 +44,6 @@ 
 extern void xstormy16_emit_cbranch (enum rtx_code, rtx, rtx, rtx);
 extern char *xstormy16_output_cbranch_hi (rtx, const char *, int, rtx);
 extern char *xstormy16_output_cbranch_si (rtx, const char *, int, rtx);
-extern int xstormy16_mode_dependent_address_p (rtx);
 
 extern void xstormy16_print_operand (FILE *, rtx, int);
 extern void xstormy16_print_operand_address (FILE *, rtx);