diff options
author | Andreas Krebbel <Andreas.Krebbel@de.ibm.com> | 2013-10-10 12:02:16 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2013-10-10 12:02:16 +0000 |
commit | 13b72c22f731e9be33af0331f244f3407dca12f8 (patch) | |
tree | 79429f73a4181fe8fe287450a46d1b2f9a4b3980 | |
parent | 5db40447b829acea13897238012ebf4dc8090b04 (diff) | |
download | gcc-13b72c22f731e9be33af0331f244f3407dca12f8.zip gcc-13b72c22f731e9be33af0331f244f3407dca12f8.tar.gz gcc-13b72c22f731e9be33af0331f244f3407dca12f8.tar.bz2 |
md.texi: Document the mnemonic attribute.
2013-10-10 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* doc/md.texi: Document the mnemonic attribute.
From-SVN: r203354
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/doc/md.texi | 67 |
2 files changed, 62 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fdf0f2c..87ba2a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2013-10-10 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + * doc/md.texi: Document the mnemonic attribute. + +2013-10-10 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + PR target/57377 * gensupport.c (gen_mnemonic_attr): Handle (set (attr x) y) and (set_attr_alternative x ...) when searching for user defined diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index c07663b..2a5a2e1 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -7698,6 +7698,7 @@ to track the condition codes. * Attr Example:: An example of assigning attributes. * Insn Lengths:: Computing the length of insns. * Constant Attributes:: Defining attributes that are constant. +* Mnemonic Attribute:: Obtain the instruction mnemonic as attribute value. * Delay Slots:: Defining delay slots required for a machine. * Processor pipeline description:: Specifying information for insn scheduling. @end menu @@ -7717,15 +7718,17 @@ by the target machine. It looks like: (define_attr @var{name} @var{list-of-values} @var{default}) @end smallexample -@var{name} is a string specifying the name of the attribute being defined. -Some attributes are used in a special way by the rest of the compiler. The -@code{enabled} attribute can be used to conditionally enable or disable -insn alternatives (@pxref{Disable Insn Alternatives}). The @code{predicable} -attribute, together with a suitable @code{define_cond_exec} -(@pxref{Conditional Execution}), can be used to automatically generate -conditional variants of instruction patterns. The compiler internally uses -the names @code{ce_enabled} and @code{nonce_enabled}, so they should not be -used elsewhere as alternative names. +@var{name} is a string specifying the name of the attribute being +defined. Some attributes are used in a special way by the rest of the +compiler. The @code{enabled} attribute can be used to conditionally +enable or disable insn alternatives (@pxref{Disable Insn +Alternatives}). The @code{predicable} attribute, together with a +suitable @code{define_cond_exec} (@pxref{Conditional Execution}), can +be used to automatically generate conditional variants of instruction +patterns. The @code{mnemonic} attribute can be used to check for the +instruction mnemonic (@pxref{Mnemonic Attribute}). The compiler +internally uses the names @code{ce_enabled} and @code{nonce_enabled}, +so they should not be used elsewhere as alternative names. @var{list-of-values} is either a string that specifies a comma-separated list of values that can be assigned to the attribute, or a null string to @@ -7789,6 +7792,11 @@ distances. @xref{Insn Lengths}. The @code{enabled} attribute can be defined to prevent certain alternatives of an insn definition from being used during code generation. @xref{Disable Insn Alternatives}. + +@item mnemonic +The @code{mnemonic} attribute can be defined to implement instruction +specific checks in e.g. the pipeline description. +@xref{Mnemonic Attribute}. @end table For each of these special attributes, the corresponding @@ -8341,6 +8349,47 @@ forms involving insn attributes. @end ifset @ifset INTERNALS +@node Mnemonic Attribute +@subsection Mnemonic Attribute +@cindex mnemonic attribute + +The @code{mnemonic} attribute is a string type attribute holding the +instruction mnemonic for an insn alternative. The attribute values +will automatically be generated by the machine description parser if +there is an attribute definition in the md file: + +@smallexample +(define_attr "mnemonic" "unknown" (const_string "unknown")) +@end smallexample + +The default value can be freely chosen as long as it does not collide +with any of the instruction mnemonics. This value will be used +whenever the machine description parser is not able to determine the +mnemonic string. This might be the case for output templates +containing more than a single instruction as in +@code{"mvcle\t%0,%1,0\;jo\t.-4"}. + +The @code{mnemonic} attribute set is not generated automatically if the +instruction string is generated via C code. + +An existing @code{mnemonic} attribute set in an insn definition will not +be overriden by the md file parser. That way it is possible to +manually set the instruction mnemonics for the cases where the md file +parser fails to determine it automatically. + +The @code{mnemonic} attribute is useful for dealing with instruction +specific properties in the pipeline description without defining +additional insn attributes. + +@smallexample +(define_attr "ooo_expanded" "" + (cond [(eq_attr "mnemonic" "dlr,dsgr,d,dsgf,stam,dsgfr,dlgr") + (const_int 1)] + (const_int 0))) +@end smallexample + +@end ifset +@ifset INTERNALS @node Delay Slots @subsection Delay Slot Scheduling @cindex delay slots, defining |