This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[DATAFLOW] PowerPC lwa_operand tweak
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 07 Dec 2006 17:59:12 -0500
- Subject: [DATAFLOW] PowerPC lwa_operand tweak
A further tweak of lwa_operand: PRE_MODIFY of indexed addresses
are allowed.
Bootstrapped and regression tested on powerpc64-linux by Peter Bergner.
Committed to dataflow branch.
David
* config/rs6000/predicates.md (lwa_operand): Allow PRE_MODIFY
indexed address.
* config/rs6000/rs6000-protos.h (legitimate_indexed_address_p):
Declare.
* config/rs6000/rs6000.c (legitimate_indexed_address_p): Remove
static.
Index: predicates.md
===================================================================
--- predicates.md (revision 119621)
+++ predicates.md (working copy)
@@ -638,8 +638,8 @@
(match_operand 0 "reg_or_mem_operand")))
;; Return 1 if the operand is a general register or memory operand without
-;; pre_inc or pre_dec, which produces invalid form of PowerPC lwa
-;; instruction.
+;; pre_inc or pre_dec or pre_modify, which produces invalid form of PowerPC
+;; lwa instruction.
(define_predicate "lwa_operand"
(match_code "reg,subreg,mem")
{
@@ -652,7 +652,8 @@
|| (memory_operand (inner, mode)
&& GET_CODE (XEXP (inner, 0)) != PRE_INC
&& GET_CODE (XEXP (inner, 0)) != PRE_DEC
- && GET_CODE (XEXP (inner, 0)) != PRE_MODIFY
+ && (GET_CODE (XEXP (inner, 0)) != PRE_MODIFY
+ || legitimate_indexed_address_p (XEXP (XEXP (inner, 0), 1), 0))
&& (GET_CODE (XEXP (inner, 0)) != PLUS
|| GET_CODE (XEXP (XEXP (inner, 0), 1)) != CONST_INT
|| INTVAL (XEXP (XEXP (inner, 0), 1)) % 4 == 0));
Index: rs6000-protos.h
===================================================================
--- rs6000-protos.h (revision 119620)
+++ rs6000-protos.h (working copy)
@@ -42,6 +42,7 @@
extern void validate_condition_mode (enum rtx_code, enum machine_mode);
extern bool legitimate_constant_pool_address_p (rtx);
extern bool legitimate_indirect_address_p (rtx, int);
+extern bool legitimate_indexed_address_p (rtx, int);
extern rtx rs6000_got_register (rtx);
extern rtx find_addr_reg (rtx);
Index: rs6000.c
===================================================================
--- rs6000.c (revision 119620)
+++ rs6000.c (working copy)
@@ -631,7 +631,6 @@
static int constant_pool_expr_1 (rtx, int *, int *);
static bool constant_pool_expr_p (rtx);
static bool legitimate_small_data_p (enum machine_mode, rtx);
-static bool legitimate_indexed_address_p (rtx, int);
static bool legitimate_lo_sum_address_p (enum machine_mode, rtx, int);
static struct machine_function * rs6000_init_machine_status (void);
static bool rs6000_assemble_integer (rtx, unsigned int, int);
@@ -3004,7 +3003,7 @@
return (offset < 0x10000) && (offset + extra < 0x10000);
}
-static bool
+bool
legitimate_indexed_address_p (rtx x, int strict)
{
rtx op0, op1;