diff --git a/src/codegen.cpp b/src/codegen.cpp index 6e2ee5c341097..237ee639ce6a3 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -5797,51 +5797,51 @@ static void init_julia_llvm_env(Module *m) // If the user specifies native (or does not specify) we default // using the API provided by LLVM static inline SmallVector getTargetFeatures() { - StringMap HostFeatures; - if( !strcmp(jl_options.cpu_target,"native") ) - { - // On earlier versions of LLVM this is empty - llvm::sys::getHostCPUFeatures(HostFeatures); - } - - // Platform specific overides follow + StringMap HostFeatures; + if (!strcmp(jl_options.cpu_target,"native")) + { + // On earlier versions of LLVM this is empty + llvm::sys::getHostCPUFeatures(HostFeatures); + } + + // Platform specific overides follow #if defined(_CPU_X86_64_) || defined(_CPU_X86_) #ifndef USE_MCJIT - // Temporarily disable Haswell BMI2 features due to LLVM bug. - HostFeatures["bmi2"] = false; - HostFeatures["avx2"] = false; + // Temporarily disable Haswell BMI2 features due to LLVM bug. + HostFeatures["bmi2"] = false; + HostFeatures["avx2"] = false; #endif #ifdef V128_BUG - HostFeatures["avx"] = false; + HostFeatures["avx"] = false; #endif - // Require cx16 (cmpxchg16b) - // We need this for 128-bit atomic operations. We only need this - // when threading is enabled; however, to test whether this excludes - // important systems, we require this even when threading is - // disabled. - HostFeatures["cx16"] = true; + // Require cx16 (cmpxchg16b) + // We need this for 128-bit atomic operations. We only need this + // when threading is enabled; however, to test whether this + // excludes important systems, we require this even when threading + // is disabled. + HostFeatures["cx16"] = true; #endif - // Figure out if we know the cpu_target - std::string cpu = strcmp(jl_options.cpu_target,"native") ? jl_options.cpu_target : sys::getHostCPUName(); - if (cpu.empty() || cpu == "generic") { - jl_printf(JL_STDERR, "WARNING: unable to determine host cpu name.\n"); + // Figure out if we know the cpu_target + std::string cpu = strcmp(jl_options.cpu_target,"native") ? jl_options.cpu_target : sys::getHostCPUName(); + if (cpu.empty() || cpu == "generic") { + jl_printf(JL_STDERR, "WARNING: unable to determine host cpu name.\n"); #if defined(_CPU_ARM_) && defined(__ARM_PCS_VFP) - // Check if this is required when you have read the features directly from the processor - // This affects the platform calling convention. - // TODO: enable vfp3 for ARMv7+ (but adapt the ABI) - HostFeatures["vfp2"] = true; -#endif - } - - SmallVector attr; - for( StringMap::const_iterator it = HostFeatures.begin(); it != HostFeatures.end(); it++ ) - { - std::string att = it->getValue() ? it->getKey().str() : - std::string("-") + it->getKey().str(); - attr.append( 1, att ); - } - return attr; + // Check if this is required when you have read the features directly from the processor + // This affects the platform calling convention. + // TODO: enable vfp3 for ARMv7+ (but adapt the ABI) + HostFeatures["vfp2"] = true; +#endif + } + + SmallVector attr; + for (StringMap::const_iterator it = HostFeatures.begin(); it != HostFeatures.end(); it++) + { + std::string att = it->getValue() ? it->getKey().str() : + std::string("-") + it->getKey().str(); + attr.append(1, att); + } + return attr; } extern "C" void jl_init_debuginfo(void);