-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More formatting fixes from clang tidy
- Loading branch information
1 parent
7701552
commit 7a116ce
Showing
10 changed files
with
182 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,17 +20,17 @@ | |
|
||
#undef X86_BUILD | ||
#if defined(__x86_64__) || defined(__i386__) || defined(_WIN32) | ||
# if !defined(ANDROID_BUILD) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
amitdo
Collaborator
|
||
# define X86_BUILD 1 | ||
# endif // !ANDROID_BUILD | ||
#endif // x86 target | ||
#if !defined(ANDROID_BUILD) | ||
#define X86_BUILD 1 | ||
#endif // !ANDROID_BUILD | ||
#endif // x86 target | ||
|
||
#if defined(X86_BUILD) | ||
# if defined(__GNUC__) | ||
# include <cpuid.h> | ||
# elif defined(_WIN32) | ||
# include <intrin.h> | ||
# endif | ||
#if defined(__GNUC__) | ||
#include <cpuid.h> | ||
#elif defined(_WIN32) | ||
#include <intrin.h> | ||
#endif | ||
#endif | ||
|
||
SIMDDetect SIMDDetect::detector; | ||
|
@@ -43,25 +43,26 @@ bool SIMDDetect::sse_available_; | |
// Constructor. | ||
// Tests the architecture in a system-dependent way to detect AVX, SSE and | ||
// any other available SIMD equipment. | ||
// __GNUC__ is also defined by compilers that include GNU extensions such as clang. | ||
// __GNUC__ is also defined by compilers that include GNU extensions such as | ||
// clang. | ||
SIMDDetect::SIMDDetect() { | ||
#if defined(X86_BUILD) | ||
# if defined(__GNUC__) | ||
#if defined(__GNUC__) | ||
unsigned int eax, ebx, ecx, edx; | ||
if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) != 0) { | ||
sse_available_ = (ecx & 0x00080000) != 0; | ||
avx_available_ = (ecx & 0x10000000) != 0; | ||
} | ||
# elif defined(_WIN32) | ||
#elif defined(_WIN32) | ||
int cpuInfo[4]; | ||
__cpuid(cpuInfo, 0); | ||
if (cpuInfo[0] >= 1) { | ||
__cpuid(cpuInfo, 1); | ||
sse_available_ = (cpuInfo[2] & 0x00080000) != 0; | ||
avx_available_ = (cpuInfo[2] & 0x10000000) != 0; | ||
} | ||
# else | ||
# error "I don't know how to test for SIMD with this compiler" | ||
# endif | ||
#endif // X86_BUILD | ||
#else | ||
#error "I don't know how to test for SIMD with this compiler" | ||
#endif | ||
#endif // X86_BUILD | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
According to the Google C++ Style Guide, this and the following code was perfect. Why was it changed?