Commit 3dfc96ea by Richard Sandiford Committed by Richard Sandiford

spu.c: Include rtl-iter.h

gcc/
	* config/spu/spu.c: Include rtl-iter.h
	(ea_symbol_ref): Replace with...
	(ea_symbol_ref_p): ...this new function.
	(spu_legitimate_address_p): Update call accordingly.
	(spu_legitimate_constant_p): Likewise.  Use FOR_EACH_SUBRTX.

From-SVN: r216752
parent 3e605b20
2014-10-27 Richard Sandiford <richard.sandiford@arm.com>
* config/spu/spu.c: Include rtl-iter.h
(ea_symbol_ref): Replace with...
(ea_symbol_ref_p): ...this new function.
(spu_legitimate_address_p): Update call accordingly.
(spu_legitimate_constant_p): Likewise. Use FOR_EACH_SUBRTX.
2014-10-27 Phil Muldoon <pmuldoon@redhat.com> 2014-10-27 Phil Muldoon <pmuldoon@redhat.com>
Tom Tromey <tromey@redhat.com> Tom Tromey <tromey@redhat.com>
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
#include "dumpfile.h" #include "dumpfile.h"
#include "cfgloop.h" #include "cfgloop.h"
#include "builtins.h" #include "builtins.h"
#include "rtl-iter.h"
/* Builtin types, data and prototypes. */ /* Builtin types, data and prototypes. */
...@@ -3474,10 +3475,9 @@ exp2_immediate_p (rtx op, enum machine_mode mode, int low, int high) ...@@ -3474,10 +3475,9 @@ exp2_immediate_p (rtx op, enum machine_mode mode, int low, int high)
/* Return true if X is a SYMBOL_REF to an __ea qualified variable. */ /* Return true if X is a SYMBOL_REF to an __ea qualified variable. */
static int static bool
ea_symbol_ref (rtx *px, void *data ATTRIBUTE_UNUSED) ea_symbol_ref_p (const_rtx x)
{ {
rtx x = *px;
tree decl; tree decl;
if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS) if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
...@@ -3504,12 +3504,14 @@ ea_symbol_ref (rtx *px, void *data ATTRIBUTE_UNUSED) ...@@ -3504,12 +3504,14 @@ ea_symbol_ref (rtx *px, void *data ATTRIBUTE_UNUSED)
bool bool
spu_legitimate_constant_p (enum machine_mode mode, rtx x) spu_legitimate_constant_p (enum machine_mode mode, rtx x)
{ {
subrtx_iterator::array_type array;
if (GET_CODE (x) == HIGH) if (GET_CODE (x) == HIGH)
x = XEXP (x, 0); x = XEXP (x, 0);
/* Reject any __ea qualified reference. These can't appear in /* Reject any __ea qualified reference. These can't appear in
instructions but must be forced to the constant pool. */ instructions but must be forced to the constant pool. */
if (for_each_rtx (&x, ea_symbol_ref, 0)) FOR_EACH_SUBRTX (iter, array, x, ALL)
if (ea_symbol_ref_p (*iter))
return 0; return 0;
/* V4SI with all identical symbols is valid. */ /* V4SI with all identical symbols is valid. */
...@@ -3556,7 +3558,7 @@ spu_legitimate_address_p (enum machine_mode mode, ...@@ -3556,7 +3558,7 @@ spu_legitimate_address_p (enum machine_mode mode,
case CONST: case CONST:
/* Keep __ea references until reload so that spu_expand_mov can see them /* Keep __ea references until reload so that spu_expand_mov can see them
in MEMs. */ in MEMs. */
if (ea_symbol_ref (&x, 0)) if (ea_symbol_ref_p (x))
return !reload_in_progress && !reload_completed; return !reload_in_progress && !reload_completed;
return !TARGET_LARGE_MEM; return !TARGET_LARGE_MEM;
......
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