13
0

For 64-bit compilation, MSVC no longer supports inline assembly

This commit is contained in:
John Emmas 2021-01-07 09:22:43 +00:00
parent 381ebeab13
commit ef7a5e1b00

View File

@ -266,11 +266,21 @@ FPU::FPU ()
memset (*fxbuf, 0, 512);
#ifdef COMPILER_MSVC
char *buf = *fxbuf;
char* buf = *fxbuf;
#ifdef _WIN64
/* For 64-bit compilation, MSVC doesn't support inline assembly !!
( https://docs.microsoft.com/en-us/cpp/assembler/inline/inline-assembler?view=msvc-160 ) */
/* but instead, it uses something called 'x64 intrinsics'
1: ( https://docs.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list?view=msvc-160 )
2: ( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_fxsave ) */
_fxsave (buf);
#else
__asm {
mov eax, buf
fxsave [eax]
};
#endif
#else
asm volatile (
"fxsave (%0)"