8000 Cannot build on macOS if adding -mavx / -mavx2 to global build flags · Issue #194 · google/snappy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cannot build on macOS if adding -mavx / -mavx2 to global build flags #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jcelerier opened this issue Nov 24, 2024 · 0 comments
Open

Comments

@jcelerier
Copy link

Repro:

$ clang++ -DHAVE_CONFIG_H -I/Users/jcelerier/build-score-qt_rhi-Debug/3rdparty/snappy -I/Users/jcelerier/score/3rdparty/snappy  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk   -c /Users/jcelerier/score/3rdparty/snappy/snappy.cc -mssse3 -mavx2 -std=c++20

/Users/jcelerier/score/3rdparty/snappy/snappy.cc:1242:3: error: unknown type name '__m256i'
  __m256i data = _mm256_lddqu_si256(static_cast<const __m256i *>(src));
  ^
/Users/jcelerier/score/3rdparty/snappy/snappy.cc:1242:55: error: unknown type name '__m256i'
  __m256i data = _mm256_lddqu_si256(static_cast<const __m256i *>(src));
                                                      ^
/Users/jcelerier/score/3rdparty/snappy/snappy.cc:1242:18: error: use of undeclared identifier '_mm256_lddqu_si256'; did you mean '_mm_lddqu_si128'?
  __m256i data = _mm256_lddqu_si256(static_cast<const __m256i *>(src));
                 ^~~~~~~~~~~~~~~~~~
                 _mm_lddqu_si128

It works if I add

#include <x86intrin.h>

at the top of snappy-internal.h:

#if SNAPPY_HAVE_SSSE3
// Please do not replace with <x86intrin.h> or with headers that assume more
// advanced SSE versions without checking with all the OWNERS.
#include <emmintrin.h>
#include <tmmintrin.h>
#include <x86intrin.h>
#endif 

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin24.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0