diff options
author | John Emmas <johne53@tiscali.co.uk> | 2015-08-16 13:14:54 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2015-08-16 13:14:54 +0100 |
commit | 1d2938b16228723c6de8be653db18fa8ac6fced6 (patch) | |
tree | 664da8e7f8cdcfd47481ad02a0ee20290a603f1e /libs/pbd/fpu.cc | |
parent | f65bcc6e74314adce53b6941785b783383c2d7ed (diff) |
Add '_xgetbv()' for MSVC-9 and earlier
Diffstat (limited to 'libs/pbd/fpu.cc')
-rw-r--r-- | libs/pbd/fpu.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/pbd/fpu.cc b/libs/pbd/fpu.cc index 7b73c689c4..97e6ed59dd 100644 --- a/libs/pbd/fpu.cc +++ b/libs/pbd/fpu.cc @@ -95,6 +95,23 @@ _xgetbv (uint32_t xcr) #endif } +#elif _MSC_VER < 1600 + +// '_xgetbv()' was only available from VC10 onwards +__declspec(noinline) static uint64_t +_xgetbv (uint32_t xcr) +{ + return 0; + + // N.B. The following would probably work for a pre-VC10 build, + // although it might suffer from optimization issues. We'd need + // to place this function into its own (unoptimized) source file. + __asm { + mov ecx, [xcr] + __asm _emit 0x0f __asm _emit 0x01 __asm _emit 0xd0 /*xgetbv*/ + } +} + #endif /* !COMPILER_MSVC */ #endif /* ARCH_X86 */ |