Support AVX2 dynamic dispatch
- Dominant language
- C
- Stars
- 27.9k
- Forks
- 2.6k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 8
Description
We currently detect BMI2 instructions at runtime, but users can only benefit from AVX2 if they compile with `-march=haswell`. It would be nice to provide AVX2 support to users who are compiling with default options.
This issue is motivated specifically by [this loop in ZSTD_copyCDictTableIntoCCtx()](https://github.com/facebook/zstd/blob/dev/lib/compress/zstd_compress.c#L2135-L2139) which was added as part of my [short cache PR](https://github.com/facebook/zstd/pull/3152). Overall extDict compression speed at level 1 is 2-3% slower if that loop is compiled to SSE2 instructions vs AVX2 instructions.
There may be other functions which can be tagged for AVX2 dispatch in the future. I expect this issue would be closed after tagging ZSTD_copyCDictTableIntoCCtx(), and we can tag additional functions gradually.
Contributor guide
Assessment
This issue has not been assessed yet.