Sfoglia il codice sorgente

+ CPU.BMI1Support and CPU.BMI2Support

git-svn-id: trunk@49582 -
florian 4 anni fa
parent
commit
5ca73c61f4
2 ha cambiato i file con 39 aggiunte e 3 eliminazioni
  1. 18 1
      rtl/i386/cpu.pp
  2. 21 2
      rtl/x86_64/cpu.pp

+ 18 - 1
rtl/i386/cpu.pp

@@ -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.

+ 21 - 2
rtl/x86_64/cpu.pp

@@ -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.