Einzelnen Beitrag anzeigen

Kas Ob.

Registriert seit: 3. Sep 2023
457 Beiträge
 
#11

AW: Umfrage/Architekturfrage zur DEC

  Alt 20. Mai 2025, 09:53
Missed this part
Delphi-Quellcode:
class procedure TCSPRNG.DetectSIMDSupport;
{$IF Defined(CPUX86) or Defined(CPUX64)}
asm
  {$IFDEF CPUX86}
  push ebx
  {$ENDIF}
  mov eax, 1 // CPUID leaf 1
  cpuid
  test edx, 1 shl 26 // Check SSE2 bit (bit 26 in EDX)
  jz @NoSIMD
  mov byte ptr [FSIMDSupported], 1
  jmp @Done
@NoSIMD:
  mov byte ptr [FSIMDSupported], 0
@Done:
{  mov eax, 1          // CPUID leaf 1 (faster than mov eax,1 on some CPUs)
  cpuid
  xor al, al          // AL = 0 (prepare for no SSE2)
  test edx, 1 shl 26  // Check SSE2 bit (bit 26 in EDX)
  setnz al            // AL = 1 if supported, 0 otherwise
  mov [FSIMDSupported], al}

  {$IFDEF CPUX86}
  pop ebx
  {$ENDIF}
end;
{$ELSE}
begin
  FSIMDSupported := False; // Non-x86 platforms use Pascal
end;
{$ENDIF}
Kas
  Mit Zitat antworten Zitat