diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2020-09-02 21:41:30 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2020-09-02 21:41:30 +0300 |
commit | 4446c3a593c51603e135e38951607b9b668ddec5 (patch) | |
tree | 9552dbd903b4fd05ea740e1bba9b1b87d97414a1 /extern/bullet2/src/LinearMath/btCpuFeatureUtility.h | |
parent | 6f6f6ee18695dad66ad8aa0eb2bcab72501df597 (diff) |
Sync Bullet to upstream
This syncs Bullet to the latest upstream git version as of writing this.
(commit 47b0259b9700455022b5cf79b651cc1dc71dd59e).
Diffstat (limited to 'extern/bullet2/src/LinearMath/btCpuFeatureUtility.h')
-rw-r--r-- | extern/bullet2/src/LinearMath/btCpuFeatureUtility.h | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/extern/bullet2/src/LinearMath/btCpuFeatureUtility.h b/extern/bullet2/src/LinearMath/btCpuFeatureUtility.h index d2cab52d488..5e4b9a313c7 100644 --- a/extern/bullet2/src/LinearMath/btCpuFeatureUtility.h +++ b/extern/bullet2/src/LinearMath/btCpuFeatureUtility.h @@ -4,20 +4,20 @@ #include "LinearMath/btScalar.h" -#include <string.h>//memset -#ifdef USE_SIMD +#include <string.h> //memset +#ifdef USE_SIMD #include <emmintrin.h> #ifdef BT_ALLOW_SSE4 #include <intrin.h> -#endif //BT_ALLOW_SSE4 -#endif //USE_SIMD +#endif //BT_ALLOW_SSE4 +#endif //USE_SIMD #if defined BT_USE_NEON -#define ARM_NEON_GCC_COMPATIBILITY 1 +#define ARM_NEON_GCC_COMPATIBILITY 1 #include <arm_neon.h> #include <sys/types.h> -#include <sys/sysctl.h> //for sysctlbyname -#endif //BT_USE_NEON +#include <sys/sysctl.h> //for sysctlbyname +#endif //BT_USE_NEON ///Rudimentary btCpuFeatureUtility for CPU features: only report the features that Bullet actually uses (SSE4/FMA3, NEON_HPFP) ///We assume SSE2 in case BT_USE_SSE2 is defined in LinearMath/btScalar.h @@ -26,14 +26,13 @@ class btCpuFeatureUtility public: enum btCpuFeature { - CPU_FEATURE_FMA3=1, - CPU_FEATURE_SSE4_1=2, - CPU_FEATURE_NEON_HPFP=4 + CPU_FEATURE_FMA3 = 1, + CPU_FEATURE_SSE4_1 = 2, + CPU_FEATURE_NEON_HPFP = 4 }; static int getCpuFeatures() { - static int capabilities = 0; static bool testedCapabilities = false; if (0 != testedCapabilities) @@ -49,15 +48,15 @@ public: if (0 == err && hasFeature) capabilities |= CPU_FEATURE_NEON_HPFP; } -#endif //BT_USE_NEON +#endif //BT_USE_NEON -#ifdef BT_ALLOW_SSE4 +#ifdef BT_ALLOW_SSE4 { - int cpuInfo[4]; + int cpuInfo[4]; memset(cpuInfo, 0, sizeof(cpuInfo)); - unsigned long long sseExt = 0; + unsigned long long sseExt = 0; __cpuid(cpuInfo, 1); - + bool osUsesXSAVE_XRSTORE = cpuInfo[2] & (1 << 27) || false; bool cpuAVXSuport = cpuInfo[2] & (1 << 28) || false; @@ -79,14 +78,11 @@ public: capabilities |= btCpuFeatureUtility::CPU_FEATURE_SSE4_1; } } -#endif//BT_ALLOW_SSE4 +#endif //BT_ALLOW_SSE4 testedCapabilities = true; return capabilities; } - - }; - -#endif //BT_CPU_UTILITY_H +#endif //BT_CPU_UTILITY_H |