mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 10:49:09 +02:00
+ CPU.BMI1Support and CPU.BMI2Support
git-svn-id: trunk@49582 -
This commit is contained in:
parent
229506acd0
commit
5ca73c61f4
@ -43,6 +43,8 @@ unit cpu;
|
|||||||
function F16CSupport: boolean;inline;
|
function F16CSupport: boolean;inline;
|
||||||
function RDRANDSupport: boolean;inline;
|
function RDRANDSupport: boolean;inline;
|
||||||
function RTMSupport: boolean;inline;
|
function RTMSupport: boolean;inline;
|
||||||
|
function BMI1Support: boolean;inline;
|
||||||
|
function BMI2Support: boolean;inline;
|
||||||
|
|
||||||
var
|
var
|
||||||
is_sse3_cpu : boolean = false;
|
is_sse3_cpu : boolean = false;
|
||||||
@ -63,7 +65,9 @@ unit cpu;
|
|||||||
_MOVBESupport,
|
_MOVBESupport,
|
||||||
_F16CSupport,
|
_F16CSupport,
|
||||||
_RDRANDSupport,
|
_RDRANDSupport,
|
||||||
_RTMSupport: boolean;
|
_RTMSupport,
|
||||||
|
_BMI1Support,
|
||||||
|
_BMI2Support: boolean;
|
||||||
|
|
||||||
{$ASMMODE ATT}
|
{$ASMMODE ATT}
|
||||||
|
|
||||||
@ -204,6 +208,8 @@ unit cpu;
|
|||||||
popl %ebx
|
popl %ebx
|
||||||
end;
|
end;
|
||||||
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
|
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
|
||||||
|
_BMI1Support:=(_ebx and $8)<>0;
|
||||||
|
_BMI2Support:=(_ebx and $100)<>0;
|
||||||
_RTMSupport:=((_ebx and $800)<>0);
|
_RTMSupport:=((_ebx and $800)<>0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -283,6 +289,17 @@ unit cpu;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function BMI1Support: boolean;inline;
|
||||||
|
begin
|
||||||
|
result:=_BMI1Support;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function BMI2Support: boolean;inline;
|
||||||
|
begin
|
||||||
|
result:=_BMI2Support;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
SetupSupport;
|
SetupSupport;
|
||||||
end.
|
end.
|
||||||
|
@ -40,6 +40,8 @@ unit cpu;
|
|||||||
function F16CSupport: boolean;inline;
|
function F16CSupport: boolean;inline;
|
||||||
function RDRANDSupport: boolean;inline;
|
function RDRANDSupport: boolean;inline;
|
||||||
function RTMSupport: boolean;inline;
|
function RTMSupport: boolean;inline;
|
||||||
|
function BMI1Support: boolean;inline;
|
||||||
|
function BMI2Support: boolean;inline;
|
||||||
|
|
||||||
var
|
var
|
||||||
is_sse3_cpu : boolean = false;
|
is_sse3_cpu : boolean = false;
|
||||||
@ -62,7 +64,9 @@ unit cpu;
|
|||||||
_MOVBESupport,
|
_MOVBESupport,
|
||||||
_F16CSupport,
|
_F16CSupport,
|
||||||
_RDRANDSupport,
|
_RDRANDSupport,
|
||||||
_RTMSupport: boolean;
|
_RTMSupport,
|
||||||
|
_BMI1Support,
|
||||||
|
_BMI2Support: boolean;
|
||||||
|
|
||||||
function InterlockedCompareExchange128(var Target: Int128Rec; NewValue: Int128Rec; Comperand: Int128Rec): Int128Rec; assembler;
|
function InterlockedCompareExchange128(var Target: Int128Rec; NewValue: Int128Rec; Comperand: Int128Rec): Int128Rec; assembler;
|
||||||
{
|
{
|
||||||
@ -181,7 +185,9 @@ unit cpu;
|
|||||||
movl %ebx,_ebx
|
movl %ebx,_ebx
|
||||||
end ['rax','rbx','rcx','rdx'];
|
end ['rax','rbx','rcx','rdx'];
|
||||||
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
|
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
|
||||||
_RTMSupport:=((_ebx and $800)<>0);
|
_BMI1Support:=(_ebx and $8)<>0;
|
||||||
|
_BMI2Support:=(_ebx and $100)<>0;
|
||||||
|
_RTMSupport:=(_ebx and $800)<>0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -255,6 +261,19 @@ unit cpu;
|
|||||||
result:=_RTMSupport;
|
result:=_RTMSupport;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function BMI1Support: boolean;inline;
|
||||||
|
begin
|
||||||
|
result:=_BMI1Support;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function BMI2Support: boolean;inline;
|
||||||
|
begin
|
||||||
|
result:=_BMI2Support;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
SetupSupport;
|
SetupSupport;
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user