This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, committed] PowerPC prefetch constraint


	This patch adds a new constraint 'a' for indexed or indirect
addresses using the recently added predicate and uses the new constraint
in the prefetch pattern.

Bootstrapped and regression tested on powerpc-ibm-aix5.2.0.0

David


	* config/rs6000/rs6000.h (EXTRA_CONSTRAINT): Add 'a' for indexed
	or indirect address operand.
	(EXTRA_ADDRESS_CONSTRAINT): New.
	* config/rs6000/rs6000.md (prefetch): Change constraint "p" to "a".

Index: rs6000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.382
diff -c -p -r1.382 rs6000.h
*** rs6000.h	8 Aug 2005 16:36:26 -0000	1.382
--- rs6000.h	13 Aug 2005 18:40:19 -0000
*************** enum reg_class
*** 1111,1116 ****
--- 1111,1117 ----
     'W' is a vector constant that can be easily generated (no mem refs).
     'Y' is an indexed or word-aligned displacement memory operand.
     'Z' is an indexed or indirect memory operand.
+    'a'  is an indexed or indirect address operand.
     't' is for AND masks that can be performed by two rldic{l,r} insns.  */
  
  #define EXTRA_CONSTRAINT(OP, C)						\
*************** enum reg_class
*** 1127,1132 ****
--- 1128,1134 ----
     : (C) == 'W' ? (easy_vector_constant (OP, GET_MODE (OP)))		\
     : (C) == 'Y' ? (word_offset_memref_operand (OP, GET_MODE (OP)))      \
     : (C) == 'Z' ? (indexed_or_indirect_operand (OP, GET_MODE (OP)))	\
+    : (C) == 'a' ? (indexed_or_indirect_address (OP, GET_MODE (OP)))	\
     : 0)
  
  /* Define which constraints are memory constraints.  Tell reload
*************** enum reg_class
*** 1136,1141 ****
--- 1138,1149 ----
  #define EXTRA_MEMORY_CONSTRAINT(C, STR)				\
    ((C) == 'Q' || (C) == 'Y' || (C) == 'Z')
  
+ /* Define which constraints should be treated like address constraints
+    by the reload pass.  */
+ 
+ #define EXTRA_ADDRESS_CONSTRAINT(C, STR)			\
+   ((C) == 'a')
+ 
  /* Given an rtx X being reloaded into a reg required to be
     in class CLASS, return the class of reg to actually use.
     In general this is just CLASS; but on some machines
Index: rs6000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.394
diff -c -p -r1.394 rs6000.md
*** rs6000.md	10 Aug 2005 19:52:55 -0000	1.394
--- rs6000.md	13 Aug 2005 18:40:19 -0000
***************
*** 14016,14022 ****
  }")
  
  (define_insn "prefetch"
!   [(prefetch (match_operand 0 "indexed_or_indirect_address" "p")
  	     (match_operand:SI 1 "const_int_operand" "n")
  	     (match_operand:SI 2 "const_int_operand" "n"))]
    "TARGET_POWERPC"
--- 14016,14022 ----
  }")
  
  (define_insn "prefetch"
!   [(prefetch (match_operand 0 "indexed_or_indirect_address" "a")
  	     (match_operand:SI 1 "const_int_operand" "n")
  	     (match_operand:SI 2 "const_int_operand" "n"))]
    "TARGET_POWERPC"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]