@@ -27,11 +27,20 @@ endif()
27
27
option (KLEIN_BUILD_SYM "Enable compilation of symbolic Klein utility" ON )
28
28
option (KLEIN_BUILD_C_BINDINGS "Enable compilation of the Klein C bindings" ON )
29
29
30
+ # The default platform and instruction set is x86 SSE3
30
31
add_library (klein INTERFACE )
31
32
add_library (klein::klein ALIAS klein)
32
33
target_include_directories (klein INTERFACE public )
33
34
target_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
35
44
# queried as of December 2019 while AVX2 is around 70%. Thus, we can assume
36
45
# FMA support is at least 70%, but perhaps not much more beyond that.
37
46
# TODO: Optionally support FMA
@@ -40,7 +49,8 @@ if(MSVC)
40
49
# AVX extensions). This is on by default.
41
50
else ()
42
51
# 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)
44
54
endif ()
45
55
46
56
if (KLEIN_ENABLE_PERF)
@@ -54,7 +64,7 @@ if(KLEIN_ENABLE_TESTS)
54
64
endif ()
55
65
56
66
if (KLEIN_BUILD_SYM)
57
- add_subdirectory (src )
67
+ add_subdirectory (sym )
58
68
endif ()
59
69
60
70
if (KLEIN_BUILD_C_BINDINGS)
0 commit comments