+ CPU.BMI1Support and CPU.BMI2Support

git-svn-id: trunk@49582 -
This commit is contained in:
florian 2021-07-07 20:26:59 +00:00
parent 229506acd0
commit 5ca73c61f4
2 changed files with 39 additions and 3 deletions

View File

@ -43,6 +43,8 @@ unit cpu;
function F16CSupport: boolean;inline;
function RDRANDSupport: boolean;inline;
function RTMSupport: boolean;inline;
function BMI1Support: boolean;inline;
function BMI2Support: boolean;inline;
var
is_sse3_cpu : boolean = false;
@ -63,7 +65,9 @@ unit cpu;
_MOVBESupport,
_F16CSupport,
_RDRANDSupport,
_RTMSupport: boolean;
_RTMSupport,
_BMI1Support,
_BMI2Support: boolean;
{$ASMMODE ATT}
@ -204,6 +208,8 @@ unit cpu;
popl %ebx
end;
_AVX2Support:=_AVXSupport and ((_ebx and $20)<>0);
_BMI1Support:=(_ebx and $8)<>0;
_BMI2Support:=(_ebx and $100)<>0;
_RTMSupport:=((_ebx and $800)<>0);
end;
end;
@ -283,6 +289,17 @@ unit cpu;
end;
function BMI1Support: boolean;inline;
begin
result:=_BMI1Support;
end;
function BMI2Support: boolean;inline;
begin
result:=_BMI2Support;
end;
begin
SetupSupport;
end.

View File

@ -40,6 +40,8 @@ unit cpu;
function F16CSupport: boolean;inline;
function RDRANDSupport: boolean;inline;
function RTMSupport: boolean;inline;
function BMI1Support: boolean;inline;
function BMI2Support: boolean;inline;
var
is_sse3_cpu : boolean = false;
@ -62,7 +64,9 @@ unit cpu;
_MOVBESupport,
_F16CSupport,
_RDRANDSupport,
_RTMSupport: boolean;
_RTMSupport,
_BMI1Support,
_BMI2Support: boolean;
function InterlockedCompareExchange128(var Target: Int128Rec; NewValue: Int128Rec; Comperand: Int128Rec): Int128Rec; assembler;
{
@ -181,7 +185,9 @@ unit cpu;
movl %ebx,_ebx
end ['rax','rbx','rcx','rdx'];
_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;
@ -255,6 +261,19 @@ unit cpu;
result:=_RTMSupport;
end;
function BMI1Support: boolean;inline;
begin
result:=_BMI1Support;
end;
function BMI2Support: boolean;inline;
begin
result:=_BMI2Support;
end;
begin
SetupSupport;
end.