RISC-V tail Pseudo-Instruction Details
Assembler pseudo-instructionTail call pseudo-instruction, expands to AUIPC t1 + JALR x0 (no return address saved). It is used when the final action of a function jumps to another function, whose return goes directly to the current function's caller.
What This Pseudo Instruction Is Saving You From Writing
Enables tail-call optimization — when the last action of a function is calling another, jump directly to the target without saving a new return address. This assumes the current function no longer needs its local state and has satisfied calling-convention requirements before the tail jump.
Official Semantics Checklist
Toolchain And Linker Boundaries
How To Read The Expansion
What You May See In objdump / Disassembly
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.
When To Think Of It First
Pitfalls / Common Confusions
FAQ
Is tail a real RISC-V instruction?
tail is an assembler pseudo-instruction or alias, not a separate hardware opcode. The “Typical Real Expansion” section lists the official expansion, and behavior is defined by the expanded ISA instructions.
What is the main trap when using tail?
tail does not write ra — the target returns directly to the current function's caller; if the current function created a stack frame, restore the stack and saved registers before the tail jump