wfit
Wait For Interrupt with Timeout
WFIT <Wn>
Waits for an interrupt or a timeout.
Details
Wait For Interrupt with Timeout. Suspends execution until an interrupt is pending or the timeout counter expires. The timeout value is provided in Wn as a 32-bit count. Condition flags are not affected. AArch64-only; available from v8.7 onwards.
Pseudocode Operation
timeout ← Wn
while (timeout > 0 AND interrupt_not_pending()) {
timeout ← timeout - 1
enter_low_power_state()
}
Wn ← timeout
Example
WFIT w1
Encoding
Binary Layout
11010101000000110001
0000
001
Rd
Operands
-
Wn
Timeout
Reference (Arm A64 ISA)
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0xD5031020 | WFIT <Xt> | A64 | 11010101000000110001 | 0000 | 001 | Rd |
Description
Wait For Interrupt with Timeout is a hint instruction that indicates that the PE can enter a low-power state and remain there until either a local timeout event or a wakeup event occurs. For more information, see Wait For Interrupt.
As described in Wait For Interrupt, the execution of a WFIT instruction that would otherwise cause entry to a low-power state can be trapped to a higher Exception level.
Operation
integer localtimeout = UInt(X[d, 64]);
if Halted() && ConstrainUnpredictableBool(Unpredictable_WFxTDEBUG) then
EndOfInstruction();
Hint_WFI(localtimeout, WFxType_WFIT);