AVX512 does not compile with g++ #412
Labels
No labels
announcement
bug
build
CI
dependencies
documentation
duplicate
enhancement
experience feedback
feature request
github_actions
help wanted
install
invalid
Long-term
optimization
portability
question
target-specific
test issue
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-Cyan4973/xxHash#412
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
xxhash passes
intwhere_MM_PERM_ENUMis required, for example:Fix seems simple enough:
github.com/embree/embree@40b9aca266Relevant discussion: https://developercommunity.visualstudio.com/content/problem/107147/avx512-permute-macros-are-missing.html
Thanks for the report @wolfpld .
FYI, I tested
-mavx512fwith gcc, from 7 to 10, and it compiled fine, at least on Linux.I note that the link to the discussion mentions Visual Studio.
So which it compiler is it ?
I have linked the article talking about MSVC only to give some context about the nature of this issue.
The build that is failing for me was performed on GitHub CI using
ubuntu-20.04image.I can repro this locally using gcc 9.3.0 with
-march=skylake-avx512 -O1. Enabling optimization is somehow needed here.I'm mystified.
Using exactly the same image
ubuntu-20.04, the same compilergcc 9.3.0and the same optimization flag-march=skylake-avx512, yet it doesn't produce any warning ...Not that I doubt it does happen. Just, it's better to be able to reproduce it so that it's controlled in CI.
Currently, it doesn't happen there :
https://travis-ci.org/github/Cyan4973/xxHash/jobs/702755044#L575
though this is using Travis CI instead of Github CI ...
It is to be noted that it seems like GCC is in
g++mode, as-fpermissive/-fno-permissiveis only a C++ option.oh, that's exactly right @easyaspi314 ,
with
g++, now I can see the issue.OK, so the issue is not about
_MM_SHUFFLE(),but rather that
_mm512_shuffle_epi32()expects an argument of type_MM_PERM_ENUM,in contrast with existing equivalent
AVX2andSSE2variants, which require anint.Both types are equivalent in
C, but different inC++.Furthermore, the permute macro
_MM_SHUFFLE(), which is used for all 3 variants, continue to return anint.I fail to find a good logic explaining this interface change.
Anyway, assuming type
_MM_PERM_ENUMis necessarily defined when_mm512_shuffle_epi32()exists, the fix seems indeed simple enough.