From ef7a5e1b00ca04be8a246eae100e2bd5c8527f60 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Thu, 7 Jan 2021 09:22:43 +0000 Subject: [PATCH] For 64-bit compilation, MSVC no longer supports inline assembly --- libs/pbd/fpu.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/pbd/fpu.cc b/libs/pbd/fpu.cc index c179def222..0c281a74e8 100644 --- a/libs/pbd/fpu.cc +++ b/libs/pbd/fpu.cc @@ -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)"