eret

Exception Return

ERET

Returns from an exception.

Pseudocode Operation

PC ← ELR_ELx
CPSR ← SPSR_ELx
Branch(PC)

Encoding

Binary Layout
1101011
31:25
0100
24:21
11111
20:16
0000
15:12
0
11
0
10
11111
9:5
00000
4:0
 
Format System
Opcode 0xD69F03E0
Extension Base

Operands

Related

Other forms of eret

  • eret Exception Return (A32)
  • eret Exception Return (Thumb)

More in Base

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0xD69F03E0 ERET A64 1101011 | 0100 | 11111 | 0000 | 0 | 0 | 11111 | 00000

Description

Exception Return using the ELR and SPSR for the current Exception level. When executed, the PE restores PSTATE from the SPSR, and branches to the address held in the ELR. The PE checks the SPSR for the current Exception level for an illegal return event. See Illegal return events from AArch64 state. ERET is UNDEFINED at EL0.

Operation

if PSTATE.EL == EL0 then UNDEFINED;
AArch64.CheckForERetTrap(FALSE, TRUE);
bits(64) target = ELR_ELx[];

AArch64.ExceptionReturn(target, SPSR_ELx[]);