Skip to content

Commit

Permalink
cmake: at least MSVC 2015 & default to __vectorcall
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Kretz <kretz@kde.org>
  • Loading branch information
mattkretz committed Sep 20, 2016
1 parent 2273a2e commit 65b58e7
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions cmake/VcMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -303,21 +303,17 @@ macro(vc_set_preferred_compiler_flags)
AddCompilerFlag("/wd4748") # Disable warning "/GS can not protect parameters and local variables from local buffer overrun because optimizations are disabled in function" (I don't get it)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()

# MSVC does not support inline assembly on 64 bit! :(
# searching the help for xgetbv doesn't turn up anything. So just fall back to not supporting AVX on Windows :(
# TODO: apparently MSVC 2010 SP1 added _xgetbv
set(Vc_DEFINITIONS "${Vc_DEFINITIONS} -DVc_NO_XGETBV")
vc_add_compiler_flag(Vc_COMPILE_FLAGS "/Gv") # default to __vectorcall

# get rid of the min/max macros
set(Vc_DEFINITIONS "${Vc_DEFINITIONS} -DNOMINMAX")

# MSVC doesn't implement the XOP or FMA4 intrinsics
set(Vc_XOP_INTRINSICS_BROKEN true)
set(Vc_FMA4_INTRINSICS_BROKEN true)
#set(Vc_XOP_INTRINSICS_BROKEN true)
#set(Vc_FMA4_INTRINSICS_BROKEN true)

if(MSVC_VERSION LESS 1700)
UserWarning("MSVC before 2012 has a broken std::vector::resize implementation. STL + Vc code will probably not compile.")
if(MSVC_VERSION LESS 1900)
UserWarning("MSVC before 2015 does not support enough of C++11")
endif()
elseif(Vc_COMPILER_IS_CLANG)
##################################################################################################
Expand Down

0 comments on commit 65b58e7

Please sign in to comment.