From 465f278a1b721248313dff097d194b58a0e818a8 Mon Sep 17 00:00:00 2001 From: MikeRohsoft <26527907+MikeRohsoft@users.noreply.github.com> Date: Sun, 27 Jan 2019 03:37:10 +0100 Subject: [PATCH] Long overdue FPC 64bit Support --- Source/CPUID.pas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/CPUID.pas b/Source/CPUID.pas index e1ccaff..2ffb85a 100644 --- a/Source/CPUID.pas +++ b/Source/CPUID.pas @@ -139,10 +139,17 @@ procedure ___CallCPUID(const ID: NativeInt; var CPUIDStruct); MOV RAX,RCX MOV R9,RDX CPUID + {$IFNDEF FPC} MOV R9.TCPUIDStruct.rEAX,EAX MOV R9.TCPUIDStruct.rEBX,EBX MOV R9.TCPUIDStruct.rECX,ECX MOV R9.TCPUIDStruct.rEDX,EDX + {$ELSE FPC} + MOV [R9].TCPUIDStruct.rEAX,EAX + MOV [R9].TCPUIDStruct.rEBX,EBX + MOV [R9].TCPUIDStruct.rECX,ECX + MOV [R9].TCPUIDStruct.rEDX,EDX + {$ENDIF !FPC} POP RDX POP RBX POP R9 @@ -160,7 +167,7 @@ function ___IsAVXSupported: Boolean; 2) Detect CPUID.1:ECX.AVX[bit 28] = 1 => AVX instructions supported. - 3) Issue XGETBV and verify that XCR0[2:1] = ‘11b’ + 3) Issue XGETBV and verify that XCR0[2:1] = ‘11b’ => XMM state and YMM state are enabled by OS. }