This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PRE_MODIFY, POST_MODIFY placeholders
- To: egcs-patches at cygnus dot com
- Subject: PRE_MODIFY, POST_MODIFY placeholders
- From: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Date: Tue, 20 Oct 1998 21:38:04 +1300 (NZDT)
Tue Oct 20 21:31:46 1998 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* rtl.def (POST_MODIFY, PRE_MODIFY): New generalized operators for
addressing modes with side effects. These are currently
placeholders for the C4x target.
Index: rtl.def
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/rtl.def,v
retrieving revision 1.12
diff -c -3 -p -r1.12 rtl.def
*** rtl.def 1998/08/14 11:50:46 1.12
--- rtl.def 1998/10/20 09:33:20
*************** DEF_RTL_EXPR(PRE_INC, "pre_inc", "e", 'x
*** 723,728 ****
--- 723,736 ----
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.
+ (Note that these operators are currently placeholders.) */
+ 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.13
diff -c -3 -p -r1.13 rtl.texi
*** rtl.texi 1998/10/14 01:14:42 1.13
--- rtl.texi 1998/10/20 09:33:21
*************** 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. Note that this is not currently implemented.
+
+ 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 side effects happen before the use.
@end table
These embedded side effect expressions must be used with care. Instruction