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]

Preliminary {PRE,POST}_MODIFY support needed to build C4x target



1998-09-19  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>

	* rtl.def (PRE_MODIFY, POST_MODIFY): New.

Index: rtl.def
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/rtl.def,v
retrieving revision 1.12
diff -c -p -r1.12 rtl.def
*** rtl.def	1998/08/14 11:50:46	1.12
--- rtl.def	1998/09/19 07:32:42
*************** DEF_RTL_EXPR(PRE_INC, "pre_inc", "e", 'x
*** 723,728 ****
--- 723,735 ----
  DEF_RTL_EXPR(POST_DEC, "post_dec", "e", 'x')
  DEF_RTL_EXPR(POST_INC, "post_inc", "e", 'x')
  
+ /* These binary operations are used to represent generic address
+    side-effects in memory addresses, except for simple incrementation
+    or decrementation which use the above operations.  They are
+    created automatically by the life_analysis pass in flow.c.  */
+ DEF_RTL_EXPR(PRE_MODIFY, "pre_modify", "ee", 'x')
+ DEF_RTL_EXPR(POST_MODIFY, "post_modify", "ee", 'x')
+ 
  /* Comparison operations.  The ordered comparisons exist in two
     flavors, signed and unsigned.  */
  DEF_RTL_EXPR(NE, "ne", "ee", '<')
Index: rtl.texi
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/rtl.texi,v
retrieving revision 1.12
diff -c -p -r1.12 rtl.texi
*** rtl.texi	1998/09/05 21:57:56	1.12
--- rtl.texi	1998/09/19 07:32:51
*************** and of @var{min} and @var{max} to @var{b
*** 2036,2042 ****
  @cindex RTL predecrement
  @cindex RTL postdecrement
  
! Four special side-effect expression codes appear as memory addresses.
  
  @table @code
  @findex pre_dec
--- 2036,2042 ----
  @cindex RTL predecrement
  @cindex RTL postdecrement
  
! Six special side-effect expression codes appear as memory addresses.
  
  @table @code
  @findex pre_dec
*************** being decremented.
*** 2071,2076 ****
--- 2071,2108 ----
  @findex post_inc
  @item (post_inc:@var{m} @var{x})
  Similar, but specifies incrementing @var{x} instead of decrementing it.
+ 
+ @findex post_modify
+ @item (post_modify:@var{m} @var{x} @var{y})
+ 
+ Represents the side effect of setting @var{x} to @var{y} and
+ represents @var{x} before @var{x} is modified.  @var{x} must be a
+ @code{reg} or @code{mem}, but most machines allow only a @code{reg}.
+ @var{m} must be the machine mode for pointers on the machine in use.
+ The amount @var{x} is decremented by is the length in bytes of the
+ machine mode of the containing memory reference of which this expression
+ serves as the address.
+ 
+ The expression @var{y} must be one of three forms:
+ @table @code
+ @code{(plus:@var{m} @var{x} @var{z})},
+ @code{(minus:@var{m} @var{x} @var{z})}, or
+ @code{(plus:@var{m} @var{x} @var{i})},
+ @end table
+ where @var{z} is an index register and @var{i} is a constant.
+ 
+ Here is an example of its use:@refill
+ 
+ @example
+ (mem:SF (post_modify:SI (reg:SI 42) (plus (reg:SI 42) (reg:SI 48))))
+ @end example
+ 
+ This says to modify pseudo register 42 by adding the contents of pseudo
+ register 48 to it, after the use of what ever 42 points to.
+ 
+ @findex post_modify
+ @item (pre_modify:@var{m} @var{x} @var{expr})
+ Similar except sideffects happen before the use.
  @end table
  
  These embedded side effect expressions must be used with care.  Instruction


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