wfet

Wait For Event with Timeout

WFET <Wn>

Waits for an event or a timeout (using a counter).

Details

Wait For Event with Timeout. Suspends execution until an event is signaled or the timeout counter expires. The timeout value is provided in Wn as a 32-bit count value. Condition flags are not affected. AArch64-only; available from v8.7 onwards.

Pseudocode Operation

timeout ← Wn
while (timeout > 0 AND event_not_signaled()) {
  timeout ← timeout - 1
  enter_low_power_state()
}
Wn ← timeout

Example

WFET w1

Encoding

Binary Layout
11010101000000110001
0000
000
Rd
 
Format System
Opcode 0xD5031000
Extension Base (v8.7)

Operands

  • Wn
    Timeout

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0xD5031000 WFET <Xt> A64 11010101000000110001 | 0000 | 000 | Rd

Description

Wait For Event 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. Wakeup events include the event signaled as a result of executing the SEV instruction on any PE in the multiprocessor system. For more information, see Wait For Event mechanism and Send event. As described in Wait For Event mechanism and Send event, the execution of a WFET 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_WFE(localtimeout, WFxType_WFET);