+ InterlockedCompareExchange128, Linux implementation.

git-svn-id: trunk@17140 -
This commit is contained in:
sergei 2011-03-16 06:28:47 +00:00
parent d8627f24f4
commit 7fc2d86bb2

View File

@ -50,6 +50,7 @@ unit cpu;
r8 ... NewValue
r9 ... Comperand
}
{$ifdef win64}
asm
pushq %rbx
@ -81,7 +82,30 @@ unit cpu;
popq %rbx
end;
{$else win64}
{
linux:
rdi ... target
[rsi:rdx] ... NewValue
[rcx:r8] ... Comperand
[rdx:rax] ... result
}
asm
pushq %rbx
movq %rsi,%rbx // new value low
movq %rcx,%rax // comperand low
movq %rdx,%rcx // new value high
movq %r8,%rdx // comperand high
{$ifdef oldbinutils}
.byte 0xF0,0x48,0x0F,0xC7,0x0F
{$else}
lock cmpxchg16b (%rdi)
{$endif}
popq %rbx
end;
{$endif win64}
procedure SetupSupport;
var