File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 11Environment variables control the disabling of certain explicit SIMD optimizations.
22
33```
4+ x64 options:
45TH_NO_AVX2=1 # disable AVX2 codepaths
56TH_NO_AVX=1 # disable AVX codepaths
67TH_NO_SSE=1 # disable SSE codepaths
7- ```
8+
9+ ppc64le options:
10+ TH_NO_VSX=1 # disable VSX codepaths
11+ ```
Original file line number Diff line number Diff line change @@ -78,7 +78,13 @@ static inline uint32_t detectHostSIMDExtensions()
7878
7979static inline uint32_t detectHostSIMDExtensions ()
8080{
81- return SIMDExtension_VSX ;
81+ uint32_t hostSimdExts = SIMDExtension_DEFAULT ;
82+ char * evar ;
83+
84+ evar = getenv ("TH_NO_VSX" );
85+ if (evar == NULL || strncmp (evar , "1" , 2 ) != 0 )
86+ hostSimdExts = SIMDExtension_VSX ;
87+ return hostSimdExts ;
8288}
8389
8490 #else //PPC64 without VSX
@@ -89,7 +95,7 @@ static inline uint32_t detectHostSIMDExtensions()
8995}
9096
9197 #endif
92-
98+
9399#else // x86
94100static inline void cpuid (uint32_t * eax , uint32_t * ebx , uint32_t * ecx , uint32_t * edx )
95101{
@@ -146,7 +152,7 @@ static inline uint32_t detectHostSIMDExtensions()
146152
147153 evar = getenv ("TH_NO_SSE" );
148154 if (evar == NULL || strncmp (evar , "1" , 2 ) != 0 )
149- TH_NO_SSE = 0 ;
155+ TH_NO_SSE = 0 ;
150156 if (edx & CPUID_SSE_BIT && TH_NO_SSE == 0 ) {
151157 hostSimdExts |= SIMDExtension_SSE ;
152158 }
You can’t perform that action at this time.
0 commit comments