See the Xtensa Instruction Set Architecture (ISA) Reference Manual for a complete list of opcodes and descriptions of their semantics.
The Xtensa assembler distinguishes between generic and
specific opcodes. Specific opcodes correspond directly to Xtensa
machine instructions. Prefixing an opcode with an underscore character
(_
) identifies it as a specific opcode. Opcodes without a
leading underscore are generic, which means the assembler is required to
preserve their semantics but may not translate them directly to the
specific opcodes with the same names. Instead, the assembler may
optimize a generic opcode and select a better instruction to use in its
place (see Xtensa Optimizations), or the
assembler may relax the instruction to handle operands that are out of
range for the corresponding specific opcode (see Xtensa Relaxation).
Only use specific opcodes when it is essential to select the exact machine instructions produced by the assembler. Using specific opcodes unnecessarily only makes the code less efficient, by disabling assembler optimization, and less flexible, by disabling relaxation.
Note that this special handling of underscore prefixes only applies to
Xtensa opcodes, not to either built-in macros or user-defined macros.
When an underscore prefix is used with a macro (e.g., _NOP
), it
refers to a different macro. The assembler generally provides built-in
macros both with and without the underscore prefix, where the underscore
versions behave as if the underscore carries through to the instructions
in the macros. For example, _NOP
expands to _OR a1,a1,a1
.
The underscore prefix only applies to individual instructions, not to
series of instructions. For example, if a series of instructions have
underscore prefixes, the assembler will not transform the individual
instructions, but it may insert other instructions between them (e.g.,
to align a LOOP
instruction). To prevent the assembler from
modifying a series of instructions as a whole, use the
no-generics
directive. See generics.