tail

RISC-V tail Pseudo-Instruction Details

Assembler pseudoinstruction

tail symbol is a pseudoinstruction for a far-away subroutine tail call. Its default base instructions are auipc x6, offset[31:12] and jalr x0, x6, offset[11:0]; with Zicfilp, x7 is used as a scratch register.

What You Write
tail symbol
Typical Real Expansion
auipc x6, offset[31:12] jalr x0, x6, offset[11:0]

What This Pseudo Instruction Is Saving You From Writing

tail performs a far-away subroutine tail call, using AUIPC and JALR to form and jump to the target.

How To Read The Expansion

Step 1
AUIPC first uses auipc x6, offset[31:12] for the high part of the far-away target.
Step 2
It then uses jalr x0, x6, offset[11:0] to jump without saving a return address; with Zicfilp, x7 is the scratch register.

Official References And Reading Order

This page treats pseudo-instructions as assembler-level aliases or macros: first read what real instructions they expand to, then use the official ISA manual for the behavior of those real instructions. ABI, relocation, and linker-relaxation details follow the psABI document.

Pitfalls / Common Confusions

x6 is the default scratch register; x7 is used when Zicfilp is available.

FAQ

Is tail a separate RISC-V hardware instruction?

No. tail symbol is an assembler pseudoinstruction with AUIPC and JALR as its base instructions.