|
@@ -22,7 +22,7 @@ unit cpu;
|
|
// Unless overridebinutils is defined (for ports usage), use db instead of the instruction
|
|
// Unless overridebinutils is defined (for ports usage), use db instead of the instruction
|
|
{$ifndef overridebinutils}
|
|
{$ifndef overridebinutils}
|
|
{$define oldbinutils}
|
|
{$define oldbinutils}
|
|
- {$endif}
|
|
|
|
|
|
+ {$endif}
|
|
{$endif}
|
|
{$endif}
|
|
|
|
|
|
uses
|
|
uses
|
|
@@ -31,6 +31,9 @@ unit cpu;
|
|
function InterlockedCompareExchange128Support : boolean;inline;
|
|
function InterlockedCompareExchange128Support : boolean;inline;
|
|
function AESSupport : boolean;inline;
|
|
function AESSupport : boolean;inline;
|
|
|
|
|
|
|
|
+ var
|
|
|
|
+ is_sse3_cpu : boolean = false;
|
|
|
|
+
|
|
function InterlockedCompareExchange128(var Target: Int128Rec; NewValue: Int128Rec; Comperand: Int128Rec): Int128Rec;
|
|
function InterlockedCompareExchange128(var Target: Int128Rec; NewValue: Int128Rec; Comperand: Int128Rec): Int128Rec;
|
|
|
|
|
|
implementation
|
|
implementation
|
|
@@ -77,7 +80,7 @@ unit cpu;
|
|
movq 8(%r9),%rdx
|
|
movq 8(%r9),%rdx
|
|
|
|
|
|
{$ifdef oldbinutils}
|
|
{$ifdef oldbinutils}
|
|
- .byte 0xF0,0x49,0x0F,0xC7,0x08
|
|
|
|
|
|
+ .byte 0xF0,0x49,0x0F,0xC7,0x08
|
|
{$else}
|
|
{$else}
|
|
lock cmpxchg16b (%r8)
|
|
lock cmpxchg16b (%r8)
|
|
{$endif}
|
|
{$endif}
|
|
@@ -115,6 +118,7 @@ unit cpu;
|
|
end;
|
|
end;
|
|
{$endif win64}
|
|
{$endif win64}
|
|
|
|
|
|
|
|
+
|
|
procedure SetupSupport;
|
|
procedure SetupSupport;
|
|
var
|
|
var
|
|
_ecx : longint;
|
|
_ecx : longint;
|
|
@@ -127,10 +131,10 @@ unit cpu;
|
|
popq %rbx
|
|
popq %rbx
|
|
end;
|
|
end;
|
|
_InterlockedCompareExchange128Support:=(_ecx and $2000)<>0;
|
|
_InterlockedCompareExchange128Support:=(_ecx and $2000)<>0;
|
|
- _AESSupport:=(_ecx and $2000000)<>0;
|
|
|
|
|
|
+ _AESSupport:=(_ecx and $2000000)<>0;
|
|
|
|
+ is_sse3_cpu:=(_ecx and $1)<>0;
|
|
end;
|
|
end;
|
|
|
|
|
|
-
|
|
|
|
begin
|
|
begin
|
|
SetupSupport;
|
|
SetupSupport;
|
|
end.
|
|
end.
|