This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: generating compare and branch instructions
Ãyvind Harboe <oyvind.harboe@zylin.com> writes:
> What I miss in the manual is a complete list of all the named patterns:
> "9.8 Standard Pattern Names For Generation".
>
> Is there a way to find out about all the standard patterns via a grep or
> reading in some source file, or?
There is no consolidated list; as you have apparently noticed, that
section of the manual is grossly incomplete.
Every define_expand in a machine description, and every define_insn or
define_insn_and_split which specifies a name that does not begin with
an asterisk, induces a function named gen_<name> and a preprocessor
macro HAVE_<name>. The functions can be found in the generated source
file insn-emit.c, and the #defines in insn-config.h.
These functions get used in two ways. First, many source files
contain explicit calls to them. Almost all such calls are wrapped in
#ifdefs on the corresponding HAVE_ macro, and there are other
functions named gen_<thing>, so you will probably have better luck
finding explicit calls to insn generation functions by grepping for
\<HAVE_[a-z] (egrep syntax).
Second, there are classes of named patterns which correspond to things
called "optabs". Optabs are not documented anywhere to my knowledge.
They provide an indirect manner of invoking the gen_* functions.
The mapping from named patterns to optabs is defined by genopinit.c.
zw