From d263854dd38199992c02d0f68f282a7ada336779 Mon Sep 17 00:00:00 2001 From: purplerain Date: Sun, 26 Jan 2025 18:10:58 +0000 Subject: [PATCH] sync with OpenBSD -current --- lib/mesa/src/amd/llvm/ac_llvm_helper.cpp | 1 + .../src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/mesa/src/amd/llvm/ac_llvm_helper.cpp b/lib/mesa/src/amd/llvm/ac_llvm_helper.cpp index 5d065279..af4a50f8 100644 --- a/lib/mesa/src/amd/llvm/ac_llvm_helper.cpp +++ b/lib/mesa/src/amd/llvm/ac_llvm_helper.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index b50a1742..06b9c40c 100644 --- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -402,8 +402,14 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, * which allows us to enable/disable code generation based * on the results of cpuid on these architectures. */ - llvm::StringMap features; - llvm::sys::getHostCPUFeatures(features); + #if LLVM_VERSION_MAJOR >= 19 + /* llvm-19+ returns StringMap from getHostCPUFeatures. + */ + auto features = llvm::sys::getHostCPUFeatures(); + #else + llvm::StringMap features; + llvm::sys::getHostCPUFeatures(features); + #endif for (StringMapIterator f = features.begin(); f != features.end(); @@ -443,8 +449,10 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, /* All avx512 have avx512f */ MAttrs.push_back(util_get_cpu_caps()->has_avx512f ? "+avx512f" : "-avx512f"); MAttrs.push_back(util_get_cpu_caps()->has_avx512cd ? "+avx512cd" : "-avx512cd"); +#if LLVM_VERSION_MAJOR < 19 MAttrs.push_back(util_get_cpu_caps()->has_avx512er ? "+avx512er" : "-avx512er"); MAttrs.push_back(util_get_cpu_caps()->has_avx512pf ? "+avx512pf" : "-avx512pf"); +#endif MAttrs.push_back(util_get_cpu_caps()->has_avx512bw ? "+avx512bw" : "-avx512bw"); MAttrs.push_back(util_get_cpu_caps()->has_avx512dq ? "+avx512dq" : "-avx512dq"); MAttrs.push_back(util_get_cpu_caps()->has_avx512vl ? "+avx512vl" : "-avx512vl");