Next: , Previous: Constant Attributes, Up: Insn Attributes


16.19.7 Mnemonic Attribute

The 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:

     (define_attr "mnemonic" "unknown" (const_string "unknown"))

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 "mvcle\t%0,%1,0\;jo\t.-4".

The mnemonic attribute set is not generated automatically if the instruction string is generated via C code.

An existing 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 mnemonic attribute is useful for dealing with instruction specific properties in the pipeline description without defining additional insn attributes.

     (define_attr "ooo_expanded" ""
       (cond [(eq_attr "mnemonic" "dlr,dsgr,d,dsgf,stam,dsgfr,dlgr")
              (const_int 1)]
             (const_int 0)))