This chapter covers features of the gnu assembler that are specific to the Xtensa architecture. For details about the Xtensa instruction set, please consult the [Xtensa Instruction Set Architecture (ISA) Reference Manual].
The Xtensa version of the gnu assembler supports these special options:
Enable or disable use of the Xtensa code density option (16-bit instructions). Section 42.3.1 Using Density Instructions. If the processor is configured with the density option, this is enabled by default; otherwise, it is always disabled.
Enable or disable relaxation of instructions with immediate operands that are outside the legal range for the instructions. Section 42.4 Xtensa Relaxation. The default is -relax and this default should almost always be used. If relaxation is disabled with -no-relax, instruction operands that are out of range will cause errors. Note: In the current implementation, these options also control whether assembler optimizations are performed, making these options equivalent to -generics and -no-generics.
Enable or disable all assembler transformations of Xtensa instructions, including both relaxation and optimization. The default is -generics; -no-generics should only be used in the rare cases when the instructions must be exactly as specified in the assembly source. As with -no-relax, using -no-generics causes out of range instruction operands to be errors.
Control the treatment of literal pools. The default is -no-text-section-literals, which places literals in a separate section in the output file. This allows the literal pool to be placed in a data RAM/ROM, and it also allows the linker to combine literal pools from separate object files to remove redundant literals and improve code size. With -text-section-literals, the literals are interspersed in the text section in order to keep them as close as possible to their references. This may be necessary for large assembly files.
Enable or disable automatic alignment to reduce branch penalties at some expense in code size. Section 42.3.2 Automatic Instruction Alignment. This optimization is enabled by default. Note that the assembler will always align instructions like LOOP that have fixed alignment requirements.
Enable or disable transformation of call instructions to allow calls across a greater range of addresses. Section 42.4.2 Function Call Relaxation. This option should be used when call targets can potentially be out of range, but it degrades both code size and performance. The default is -no-longcalls.