PAUSE

From Asmpedia

Jump to: navigation, search

Hint for spin loops

Intel AMD
+ +


Mode


32 64
+ +


Definition:


Provides a hit to a processor to reduce power consumption and improve the performance of spin loops.


Implementation example (ECX points to a spin lock variable):

hal!KfAcquireSpinLock:
...
81f97f05 f00fba2900             lock bts dword ptr [ecx],0
81f97f0a 7201                   jb       hal!KfAcquireSpinLock+0x19 (81f97f0d)
81f97f0c c3                     ret
81f97f0d f70101000000           test     dword ptr [ecx],1
81f97f13 74f0                   je       hal!KfAcquireSpinLock+0x11 (81f97f05)
81f97f15 f390                   pause
81f97f17 ebf4                   jmp      hal!KfAcquireSpinLock+0x19 (81f97f0d)


Operation in pseudo code:

pause()
{
   delay();   
}


Opcodes (x86):


f3 90


EFLAGS/RFLAGS


Not affected


Annotated WinDbg disassembly (x86):

f390            pause


Annotated WinDbg disassembly (x64):

f390            pause

Related instructions:

Personal tools