@@ -27,11 +27,20 @@ endif()
2727option (KLEIN_BUILD_SYM "Enable compilation of symbolic Klein utility" ON )
2828option (KLEIN_BUILD_C_BINDINGS "Enable compilation of the Klein C bindings" ON )
2929
30+ # The default platform and instruction set is x86 SSE3
3031add_library (klein INTERFACE )
3132add_library (klein::klein ALIAS klein )
3233target_include_directories (klein INTERFACE public )
3334target_compile_features (klein INTERFACE cxx_std_17 )
34- # SSE4.2 has > 96% market penetration according to the Steam hardware survey
35+ if (NOT MSVC )
36+ target_compile_options (klein INTERFACE -msse3 )
37+ endif ()
38+
39+ add_library (klein_sse42 INTERFACE )
40+ add_library (klein::klein_sse42 ALIAS klein_sse42 )
41+ target_include_directories (klein_sse42 INTERFACE public )
42+ target_compile_features (klein_sse42 INTERFACE cxx_std_17 )
43+ # SSE4.1 has > 97% market penetration according to the Steam hardware survey
3544# queried as of December 2019 while AVX2 is around 70%. Thus, we can assume
3645# FMA support is at least 70%, but perhaps not much more beyond that.
3746# TODO: Optionally support FMA
@@ -40,7 +49,8 @@ if(MSVC)
4049 # AVX extensions). This is on by default.
4150else ()
4251 # Unlike MSVC, FMA instructions are enabled with a separate feature flag
43- target_compile_options (klein INTERFACE -msse4.2 )
52+ target_compile_options (klein_sse42 INTERFACE -msse4.1 )
53+ target_compile_definitions (klein_sse42 INTERFACE KLEIN_SSE_4_1 )
4454endif ()
4555
4656if (KLEIN_ENABLE_PERF)
@@ -54,7 +64,7 @@ if(KLEIN_ENABLE_TESTS)
5464endif ()
5565
5666if (KLEIN_BUILD_SYM)
57- add_subdirectory (src )
67+ add_subdirectory (sym )
5868endif ()
5969
6070if (KLEIN_BUILD_C_BINDINGS)
0 commit comments