From: Jan Kotas Date: Fri, 28 Aug 2020 17:13:47 +0000 (-0700) Subject: Make gc/vxsort/isa_detection.cpp portable (#41517) X-Git-Tag: submit/tizen/20210909.063632~5720 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af415cd736f664bf2370dc55336847210c2ba2f0;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Make gc/vxsort/isa_detection.cpp portable (#41517) Fixes #41515 --- diff --git a/src/coreclr/src/gc/CMakeLists.txt b/src/coreclr/src/gc/CMakeLists.txt index b802602..c68bbce 100644 --- a/src/coreclr/src/gc/CMakeLists.txt +++ b/src/coreclr/src/gc/CMakeLists.txt @@ -42,7 +42,7 @@ endif(CLR_CMAKE_HOST_UNIX) if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) set ( GC_SOURCES ${GC_SOURCES} - vxsort/isa_detection_dummy.cpp + vxsort/isa_detection.cpp vxsort/do_vxsort_avx2.cpp vxsort/do_vxsort_avx512.cpp vxsort/machine_traits.avx2.cpp diff --git a/src/coreclr/src/gc/sample/CMakeLists.txt b/src/coreclr/src/gc/sample/CMakeLists.txt index e7849c8..88dae6f 100644 --- a/src/coreclr/src/gc/sample/CMakeLists.txt +++ b/src/coreclr/src/gc/sample/CMakeLists.txt @@ -27,7 +27,7 @@ set(SOURCES if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) set ( SOURCES ${SOURCES} - ../vxsort/isa_detection_dummy.cpp + ../vxsort/isa_detection.cpp ../vxsort/do_vxsort_avx2.cpp ../vxsort/do_vxsort_avx512.cpp ../vxsort/machine_traits.avx2.cpp diff --git a/src/coreclr/src/gc/vxsort/isa_detection.cpp b/src/coreclr/src/gc/vxsort/isa_detection.cpp index 770c34f..2a60ea0 100644 --- a/src/coreclr/src/gc/vxsort/isa_detection.cpp +++ b/src/coreclr/src/gc/vxsort/isa_detection.cpp @@ -2,7 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "common.h" + +#ifdef TARGET_WINDOWS #include +#include +#endif #include "do_vxsort.h" @@ -17,13 +21,11 @@ enum class SupportedISA static DWORD64 GetEnabledXStateFeaturesHelper() { - LIMITED_METHOD_CONTRACT; - // On Windows we have an api(GetEnabledXStateFeatures) to check if AVX is supported typedef DWORD64(WINAPI* PGETENABLEDXSTATEFEATURES)(); PGETENABLEDXSTATEFEATURES pfnGetEnabledXStateFeatures = NULL; - HMODULE hMod = WszLoadLibraryEx(WINDOWS_KERNEL32_DLLNAME_W, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); + HMODULE hMod = LoadLibraryExW(L"kernel32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); if (hMod == NULL) return 0; diff --git a/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp b/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp deleted file mode 100644 index e277a76..0000000 --- a/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#include "common.h" - -#include "do_vxsort.h" - -#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS) - -void InitSupportedInstructionSet (int32_t) -{ -} - -bool IsSupportedInstructionSet (InstructionSet) -{ - return false; -} -#endif // defined(TARGET_AMD64) && defined(TARGET_WINDOWS) -