diff options
author | lloyd <[email protected]> | 2009-09-29 18:37:08 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-09-29 18:37:08 +0000 |
commit | 093f98e42a3ba6d51a6c676070090dd06cc39bc7 (patch) | |
tree | a61fb7fb68985ffc35826063fc3c7f5337d75abc /src/utils/cpuid.cpp | |
parent | 18d48581310d60e3c9cd0fbdc0a574d8ebaaeed4 (diff) |
Add some basic prefetching support (only supported with GNU C++ or things
that claim to be by defining __GNUG__ (such as Intel C++)) in new utils
header prefetch.h
Diffstat (limited to 'src/utils/cpuid.cpp')
-rw-r--r-- | src/utils/cpuid.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/cpuid.cpp b/src/utils/cpuid.cpp index 4f22ef867..d5149e2e5 100644 --- a/src/utils/cpuid.cpp +++ b/src/utils/cpuid.cpp @@ -31,12 +31,12 @@ u64bit x86_processor_flags() #if defined(BOTAN_TARGET_ARCH_IS_X86) || defined(BOTAN_TARGET_ARCH_IS_AMD64) -#if defined(__GNUG__) +#if defined(BOTAN_BUILD_COMPILER_IS_GCC) u32bit a = 1, b = 0, c = 0, d = 0; #if defined(__i386__) && defined(__PIC__) - // ebx is used in PIC on 32-bit x86, so save and restore it + // ebx is reserved for PIC on 32-bit x86, so save and restore it asm("xchgl %%ebx, %1\n\t" "cpuid\n\t" "xchgl %%ebx, %1\n\t" @@ -49,7 +49,7 @@ u64bit x86_processor_flags() proc_flags = ((u64bit)c << 32) | d; -#elif defined(_MSC_VER) +#elif defined(BOTAN_BUILD_COMPILER_IS_MSVC) int cpuinfo[4] = { 0 }; __cpuid(cpuinfo, 1); |