From 587d20338493cab93c7d36ec761c0b52b0620bea Mon Sep 17 00:00:00 2001 From: Auburn Date: Sat, 27 Apr 2024 21:15:55 +0100 Subject: [PATCH] Hopeful fix for MinGW unaligned vector access with AVX+ --- dispatch/cmake/ClassSIMD.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dispatch/cmake/ClassSIMD.cmake b/dispatch/cmake/ClassSIMD.cmake index 1a37d1d..b4253b6 100644 --- a/dispatch/cmake/ClassSIMD.cmake +++ b/dispatch/cmake/ClassSIMD.cmake @@ -102,10 +102,14 @@ function(fastsimd_create_dispatch_library simd_library_name) set_target_properties(${simd_library_name} PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() - if(CMAKE_COMPILER_IS_GNUCC) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set_target_properties(${simd_library_name} PROPERTIES COMPILE_FLAGS "-Wno-ignored-attributes") endif() - + + if(MINGW) + target_compile_options(${simd_library_name} PRIVATE -Wa,-muse-unaligned-vector-move) + endif() + if(fastsimd_create_dispatch_library_RELAXED) target_compile_definitions(${simd_library_name} PUBLIC FASTSIMD_IS_RELAXED=1) endif()