wfet

Wait For Event with Timeout

WFET <Wn>

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

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
31:12
0000
11:8
000
7:5
Rd
4:0
 
Format System
Opcode 0xD5031000
Extension Base (v8.7)

Operands

  • Wn
    Timeout

Related

More in Base (v8.7)

Reference

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);