summaryrefslogtreecommitdiff
path: root/gcc/md.texi
diff options
context:
space:
mode:
authorcpopetz <cpopetz@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-03 17:45:26 +0000
committercpopetz <cpopetz@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-03 17:45:26 +0000
commitc5ddd6b5dc28a14f02289ac8e4ce8a5ef7c9426a (patch)
tree51d16ed3ff5a009c7dd29449525fd4e9a6dc37c1 /gcc/md.texi
parent5da035580c776cbe8197d2961c425db357d61fea (diff)
downloadgcc-c5ddd6b5dc28a14f02289ac8e4ce8a5ef7c9426a.tar.gz
* gensupport.c: New file.
* gensupport.h: New file. * Makefile.in (HOST_RTL): Depend on gensupport. (gensupport.o) New rule. * genattr.c: Use gensupport for reading .md files. * genattrtab.c: Ditto. * gencodes.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * genopinit.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * rtl.def (define_insn_and_split): New DEF_RTL_EXPR. * md.texi (Insn Splitting): Document define_insn_and_split. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33633 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/md.texi')
-rw-r--r--gcc/md.texi50
1 files changed, 50 insertions, 0 deletions
diff --git a/gcc/md.texi b/gcc/md.texi
index 0b46d8164ee..083a22811da 100644
--- a/gcc/md.texi
+++ b/gcc/md.texi
@@ -3431,6 +3431,56 @@ insns that don't. Instead, write two separate @code{define_split}
definitions, one for the insns that are valid and one for the insns that
are not valid.
+For the common case where the pattern of a define_split exactly matches the
+pattern of a define_insn, use @code{define_insn_and_split}. It looks like
+this:
+
+@smallexample
+(define_insn_and_split
+ [@var{insn-pattern}]
+ "@var{condition}"
+ "@var{output-template}"
+ "@var{split-condition}"
+ [@var{new-insn-pattern-1}
+ @var{new-insn-pattern-2}
+ @dots{}]
+ "@var{preparation statements}"
+ [@var{insn-attributes}])
+
+@end smallexample
+
+@var{insn-pattern}, @var{condition}, @var{output-template}, and
+@var{insn-attributes} are used as in @code{define_insn}. The
+@var{new-insn-pattern} vector and the @var{preparation-statements} are used as
+in a @code{define_split}. The @var{split-condition} is also used as in
+@code{define_split}, with the additional behavior that if the condition starts
+with @samp{&&}, the condition used for the split will be the constructed as a
+logical "and" of the split condition with the insn condition. For example,
+from i386.md:
+
+@smallexample
+(define_insn_and_split "zero_extendhisi2_and"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (zero_extend:SI (match_operand:HI 1 "register_operand" "0")))
+ (clobber (reg:CC 17))]
+ "TARGET_ZERO_EXTEND_WITH_AND && !optimize_size"
+ "#"
+ "&& reload_completed"
+ [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (const_int 65535)))
+ (clobber (reg:CC 17))])]
+ ""
+ [(set_attr "type" "alu1")])
+
+@end smallexample
+
+In this case, the actual split condition will be
+"TARGET_ZERO_EXTEND_WITH_AND && !optimize_size && reload_completed."
+
+The @code{define_insn_and_split} construction provides exactly the same
+functionality as two separate @code{define_insn} and @code{define_split}
+patterns. It exists for compactness, and as a maintenance tool to prevent
+having to ensure the two patterns' templates match.
+
@node Peephole Definitions
@section Machine-Specific Peephole Optimizers
@cindex peephole optimizer definitions