ERET
Exception Return
Exception Return.
The PE branches to the address held in the register holding the preferred return address, and restores PSTATE from SPSR_<current_mode>.
The register holding the preferred return address is:
ELR_hyp, when executing in Hyp mode.
LR, when executing in a mode other than Hyp mode, User mode, or System mode.
The PE checks SPSR_<current_mode> for an illegal return event. See Illegal return events from AArch32 state.
Exception Return is constrained unpredictable in User mode and System mode.
In Debug state, the T1 encoding of ERET executes the DRPS operation.
For more information about the constrained unpredictable behavior of this instruction, see Architectural Constraints on UNPREDICTABLE behaviors.
It has encodings from the following instruction sets:
A32 (
A1
)
and
T32 (
T1
)
.
!= 1111
0
0
0
1
0
1
1
0
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
0
1
1
0
(1)
(1)
(1)
(0)
ERET{<c>}{<q>}
// No additional decoding required
1
1
1
1
0
0
1
1
1
1
0
1
1
1
1
0
1
0
(0)
0
(1)
(1)
(1)
(1)
0
0
0
0
0
0
0
0
ERET{<c>}{<q>}
if InITBlock() && !LastInITBlock() then UNPREDICTABLE;
<c>
See Standard assembler syntax fields.
<q>
See Standard assembler syntax fields.
if ConditionPassed() then
EncodingSpecificOperations();
if !Halted() then
if PSTATE.M IN {M32_User,M32_System} then
UNPREDICTABLE; // UNDEFINED or NOP
else
new_pc_value = if PSTATE.EL == EL2 then ELR_hyp else R[14];
AArch32.ExceptionReturn(new_pc_value, SPSR[]);
else // Perform DRPS operation in Debug state
if PSTATE.M == M32_User then
UNDEFINED;
elsif PSTATE.M == M32_System then
UNPREDICTABLE; // UNDEFINED or NOP
else
SynchronizeContext();
DebugRestorePSR();
PSTATE.M IN {M32_User,M32_System}