File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,12 +84,7 @@ class function TCpuFeatures.CPUHasAVX2(): Boolean;
8484 LXcr0: UInt64;
8585{ $ENDIF}
8686begin
87- { $IFNDEF HASHLIB_X86_SIMD}
88- Result := False;
89- { $ELSE}
90- { $IFDEF HASHLIB_I386_ASM}
91- Result := False;
92- { $ELSE}
87+ { $IFDEF HASHLIB_X86_SIMD}
9388 CpuIdQuery(1 , 0 , @LCpuId);
9489
9590 // OSXSAVE: ECX bit 27 (required for OS AVX state saving)
@@ -106,7 +101,8 @@ class function TCpuFeatures.CPUHasAVX2(): Boolean;
106101
107102 // AVX2: EBX bit 5
108103 Result := (LCpuId.RegEBX and (1 shl 5 )) <> 0 ;
109- { $ENDIF}
104+ { $ELSE}
105+ Result := False;
110106{ $ENDIF}
111107end ;
112108
@@ -116,16 +112,12 @@ class function TCpuFeatures.CPUHasSHANI(): Boolean;
116112 LCpuId: TCpuIdResult;
117113{ $ENDIF}
118114begin
119- { $IFNDEF HASHLIB_X86_SIMD}
120- Result := False;
121- { $ELSE}
122- { $IFDEF HASHLIB_I386_ASM}
123- Result := False;
124- { $ELSE}
115+ { $IFDEF HASHLIB_X86_SIMD}
125116 CpuIdQuery(7 , 0 , @LCpuId);
126117 // SHA-NI: EBX bit 29
127118 Result := (LCpuId.RegEBX and (1 shl 29 )) <> 0 ;
128- { $ENDIF}
119+ { $ELSE}
120+ Result := False;
129121{ $ENDIF}
130122end ;
131123
You can’t perform that action at this time.
0 commit comments