+2013-03-04 David Holsgrove <david.holsgrove@xilinx.com>
+
+ * config/microblaze/microblaze.c (microblaze_valid_pic_const): New
+ (microblaze_legitimate_pic_operand): Likewise
+ * config/microblaze/microblaze.h (LEGITIMATE_PIC_OPERAND_P): calls
+ new function microblaze_legitimate_pic_operand
+ * config/microblaze/microblaze-protos.h
+ (microblaze_legitimate_pic_operand): Declare.
+
2013-03-04 Edgar E. Iglesias <edgar.iglesias@gmail.com>
* config/microblaze/predicates.md (call_insn_simple_operand):
extern void microblaze_declare_object (FILE *, const char *, const char *,
const char *, int);
extern void microblaze_asm_output_ident (const char *);
+extern int microblaze_legitimate_pic_operand (rtx);
#endif /* RTX_CODE */
/* Declare functions in microblaze-c.c. */
return microblaze_classify_address (&addr, x, mode, strict);
}
+int
+microblaze_valid_pic_const (rtx x)
+{
+ switch (GET_CODE (x))
+ {
+ case CONST:
+ case CONST_INT:
+ case CONST_DOUBLE:
+ return true;
+ default:
+ return false;
+ }
+}
+
+int
+microblaze_legitimate_pic_operand (rtx x)
+{
+ struct microblaze_address_info addr;
+
+ if (pic_address_needs_scratch (x))
+ return 0;
+ if (!microblaze_valid_pic_const(x))
+ return 0;
+
+ return 1;
+}
/* Try machine-dependent ways of modifying an illegitimate address
to be legitimate. If we find one, return the new, valid address.
/* Define this, so that when PIC, reload won't try to reload invalid
addresses which require two reload registers. */
-#define LEGITIMATE_PIC_OPERAND_P(X) (!pic_address_needs_scratch (X))
+#define LEGITIMATE_PIC_OPERAND_P(X) microblaze_legitimate_pic_operand (X)
#define CASE_VECTOR_MODE (SImode)