facebook / facebook/zstd

Support AVX2 dynamic dispatch

Open
#3,335 2 comments 2 reactions 1 assignee Claimed by @embg View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.