Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/cmake_modules/SetupCxxFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ endif()
if(ARROW_CPU_FLAG STREQUAL "x86")
# x86/amd64 compiler flags, msvc/gcc/clang
if(MSVC)
set(ARROW_SSE4_2_FLAG "/arch:SSE4.2")
set(ARROW_SSE4_2_FLAG "")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this only for x86 environment?
This disables SSE 4.2 on x64 environment too.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSE4.2 appears to behave identically for x64. The official Microsoft documentation lists SSE4.2 as valid flag for msvc-180, but the compiler begs to disagree. I am having trouble finding documentation to support this, but building with x64 does produce the same nuisance warnings as with x86. This appears to be because SSE2 and its extensions are implicitly targeted as the baseline. Here is the relevant usage line on my machine:

Command> "C:\Program Files\Microsoft Visual Studio\18\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe" /? 2>nul | findstr "arch:"

[Output]
/arch:<AVX|AVX2|AVX512> minimum CPU architecture requirements, one of:

Next week I will expand the scope of testing to see if there is any MSVC version that supports the SSE4.2 flag without warnings.

# These definitions are needed for xsimd to consider the corresponding instruction
# sets available, but they are not set by MSVC (unlike other compilers).
# See https://github.com/AcademySoftwareFoundation/OpenImageIO/issues/4265
Expand Down
Loading