yield
Yield (Thumb)
YIELD
Details
Yield is a hint instruction that suggests the processor may improve performance by yielding to other threads or tasks. It does not perform any operation if the yield hint is not implemented. No registers, memory, or condition flags are modified. YIELD is available in all privilege levels and is used for spinlock and busy-wait optimization.
Pseudocode Operation
HintYield()
Example
YIELD
Encoding
Binary Layout
10111111
0001
0000
Operands
Reference (Arm AArch32 ISA)
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x0320F001 | YIELD{<c>}{<q>} | A32 | cond | 00110 | 0 | 10 | 00 | 00 | 1 | 1 | 1 | 1 | 000000000001 | ||
| 0xBF10 | YIELD{<c>}{<q>} | T32 | 10111111 | 0001 | 0000 | ||
| 0xF3AF8001 | YIELD{<c>}.W | T32 | 111100111010 | 1 | 1 | 1 | 1 | 10 | 0 | 0 | 0 | 000 | 0000 | 0001 |
Description
YIELD is a hint instruction. Software with a multithreading capability can use a YIELD instruction to indicate to the PE that it is performing a task, for example a spin-lock, that could be swapped out to improve overall system performance. The PE can use this hint to suspend and resume multiple software threads if it supports the capability.
For more information about the recommended use of this instruction see The Yield instruction.
Operation
if ConditionPassed() then
EncodingSpecificOperations();
Hint_Yield();