Skip to content

Commit

Permalink
clang msvc use x86intrin.h for xop
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed May 23, 2024
1 parent 187402f commit 23337ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,8 @@ else()
check_cxx_source_compiles("#include <immintrin.h>\nint main() { __m256 _s, _a, _b; _s = _mm256_fmadd_ps(_a, _b, _s); return 0; }" NCNN_COMPILER_SUPPORT_X86_FMA)

set(CMAKE_REQUIRED_FLAGS "/arch:AVX -mxop")
check_cxx_source_compiles("#include <ammintrin.h>\nint main() { __m128 _s, _a, _b; _s = _mm_maddd_epi16(_a, _b, _s); return 0; }" NCNN_COMPILER_SUPPORT_X86_XOP_0)
check_cxx_source_compiles("#include <x86intrin.h>\nint main() { __m128 _s, _a, _b; _s = _mm_maddd_epi16(_a, _b, _s); return 0; }" NCNN_COMPILER_SUPPORT_X86_XOP_1)
check_cxx_source_compiles("#include <x86intrin.h>\nint main() { __m128 _s, _a, _b; _s = _mm_maddd_epi16(_a, _b, _s); return 0; }" NCNN_COMPILER_SUPPORT_X86_XOP)

check_cxx_compiler_flag("/arch:AVX -mxop" NCNN_COMPILER_SUPPORT_X86_XOP)
check_cxx_compiler_flag("/arch:AVX -mf16c" NCNN_COMPILER_SUPPORT_X86_F16C)
check_cxx_compiler_flag("/arch:AVX2 -mfma -mf16c" NCNN_COMPILER_SUPPORT_X86_AVX2)
check_cxx_compiler_flag("/arch:AVX512 -mfma -mf16c -mavx512cd -mavx512bw -mavx512dq -mavx512vl" NCNN_COMPILER_SUPPORT_X86_AVX512)
Expand Down
2 changes: 1 addition & 1 deletion src/layer/x86/x86_usability.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#if __AVX__
#include <immintrin.h>
#if __XOP__
#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(__clang__)
#include <ammintrin.h>
#else
#include <x86intrin.h>
Expand Down

0 comments on commit 23337ae

Please sign in to comment.