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]

Re: PATCH: document MD_INIT_BUILTINS and MD_EXPAND_BUILTIN


On 1 Feb 2001, Lars Brinkhoff wrote:

>         * tm.texi (MD_INIT_BUILTINS): document.
>         (MD_EXPAND_BUILTIN): likewise.

I've committed this one instead.


Bernd

	* tm.texi (MD_INIT_BUILTINS, MD_EXPAND_BUILTIN): Document.

Index: tm.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tm.texi,v
retrieving revision 1.169
diff -u -p -r1.169 tm.texi
--- tm.texi	2001/02/06 01:23:12	1.169
+++ tm.texi	2001/02/07 10:37:04
@@ -8377,4 +8377,33 @@ converting code to conditional execution
 A C expression to cancel any machine dependent modifications in
 converting code to conditional execution in the basic blocks
 @code{TEST_BB}, @code{THEN_BB}, @code{ELSE_BB}, and @code{JOIN_BB}.
+
+@findex MD_INIT_BUILTINS
+@item MD_INIT_BUILTINS
+Define this macro if you have any machine-specific builtin functions that
+need to be defined.  It should be a C expression that performs the
+necessary setup.
+
+Machine specific builtins can be useful to expand special machine
+instructions that would otherwise not normally be generated because
+they have no equivalent in the source language (for example, SIMD vector
+instructions or prefetch instructions).
+
+To create a builtin function, call the function @code{builtin_function}
+which is defined by the language frontend.  You can use any type nodes set
+up by @code{build_common_tree_nodes} and @code{build_common_tree_nodes_2};
+only language frontends that use these two functions will use
+@samp{MD_INIT_BUILTINS}.
+
+@findex MD_EXPAND_BUILTIN
+@item MD_EXPAND_BUILTIN(@var{exp}, @var{target}, @var{subtarget}, @var{mode}, @var{ignore})
+
+Expand a call to a machine specific builtin that was set up by
+@samp{MD_INIT_BUILTINS}.  @var{exp} is the expression for the function call;
+the result should go to @var{target} if that is convenient, and have mode
+@var{mode} if that is convenient.  @var{subtarget} may be used as the target
+for computing one of @var{exp}'s operands. @var{ignore} is nonzero if the value
+is to be ignored.
+This macro should return the result of the call to the builtin.
+
 @end table


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