Skip to content

About the SIMD acceleration feature of ripgrep. #1822

Answered by BurntSushi
hongyi-zhao asked this question in General
Discussion options

You must be logged in to vote

In Rust, some uses of SIMD work on Rust stable. Some don't. Specifically, platform dependent use of specific vendor intrinsics on x86_64 works on stable Rust. And in particular, one can compile portable binaries where only specific functions in the code will use, say, 256-bit vectors while the rest of the code won't. (And it would be undefined behavior to call said functions on platforms that don't support 256-bit vectors.)

Most of the SIMD in ripgrep and its dependencies uses this form of SIMD.

But there is one dependency that doesn't: encoding_rs. That crate sticks with the unstable but platform independent higher level SIMD APIs. Enabling those requires using Rust nightly. Thus, when b…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by BurntSushi
Comment options

You must be logged in to vote
4 replies
@BurntSushi
Comment options

@hongyi-zhao
Comment options

@BurntSushi
Comment options

@hongyi-zhao
Comment options

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