Browse Source

+ InterlockedCompareExchange which is a compiler intrinsic for win64

git-svn-id: trunk@3360 -
florian 19 years ago
parent
commit
593c23be6e
1 changed files with 14 additions and 0 deletions
  1. 14 0
      rtl/x86_64/sysutilp.inc

+ 14 - 0
rtl/x86_64/sysutilp.inc

@@ -73,3 +73,17 @@ asm
         movl    %edi,%eax
         movl    %edi,%eax
 {$endif win64}
 {$endif win64}
 end;
 end;
+
+
+function InterLockedCompareExchange(var Target: longint; Compare, NewValue: longint): longint; assembler;
+asm
+{$ifdef win64}
+        movl            %r8l,%eax
+        lock
+        cmpxchgl        %edx,(%rcx)
+{$else win64}
+        movl            %edx,%eax
+        lock
+        cmpxchgl        %esi,(%rdi)
+{$endif win64}
+end;