Skip to content

Commit f95353d

Browse files
committed
Real "FORCESCALAR" mode on Windows
1 parent 2e42d0f commit f95353d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ else()
140140
if (NOT QUICKED_FORCESCALAR)
141141
add_compile_options(/arch:SSE4.2 /arch:AVX2) # Strictly speaking, it should be SSE4.1. But MSVC lacks this flag.
142142
add_compile_definitions(USE_SSE) # MSVC do not define the macro when using /arch:SSE4.2
143+
else()
144+
add_compile_options(/arch:SSE2) # Forcefully disable SSE4.1 and AVX2 (SSE2 is the minimum supported by MSVC)
143145
endif()
144146
else()
145147
if(NOT (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_APPLE_SILICON_PROCESSOR STREQUAL "arm64"))

bindings/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ if (NOT MSVC)
1616
target_compile_options(pyquicked_scalar PRIVATE -fvisibility=hidden)
1717
target_compile_options(pyquicked_scalar PRIVATE -mno-sse4.1 -mno-avx2) # Disable SSE4.1 and AVX2 for the scalar Python binding
1818
else()
19-
target_compile_options(pyquicked_scalar PRIVATE /arch:IA32) # Disable SSE4.1 and AVX2 for the scalar Python binding
20-
target_compile_definitions(pyquicked_scalar PRIVATE _M_IX86)
19+
target_compile_options(pyquicked_scalar PRIVATE /arch:SSE2) # Disable SSE4.1 and AVX2 for the scalar Python binding (SSE2 is the minimum supported by MSVC)
2120
endif()
2221

2322

quicked/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ endif()
4646
if (NOT MSVC)
4747
target_compile_options(quicked_scalar PRIVATE -mno-sse4.1 -mno-avx2) # Disable SSE4.1 and AVX2 for the scalar Python binding
4848
else()
49-
target_compile_options(quicked_scalar PRIVATE /arch:IA32) # Disable SSE4.1 and AVX2 for the scalar Python binding
50-
target_compile_definitions(quicked_scalar PRIVATE _M_IX86)
49+
target_compile_options(quicked_scalar PRIVATE /arch:SSE2) # Disable SSE4.1 and AVX2 for the scalar Python binding (SSE2 is the minimum supported by MSVC)
5150
endif()
5251
set_target_properties(quicked_scalar PROPERTIES EXCLUDE_FROM_ALL TRUE)
5352

0 commit comments

Comments
 (0)