Skip to content
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

Use the SHA extension backend with enabled asm feature #224

Merged
merged 3 commits into from Jan 30, 2021
Merged

Conversation

@newpavlov
Copy link
Member

@newpavlov newpavlov commented Jan 30, 2021

The SHA extension backend is significantly faster then our ASM code, so with this change on x86 targets we first will check if CPU has the extension and only then we will fallback either to ASM or software implementation.

Closes #220.

cc @dgbo

@newpavlov newpavlov requested a review from tarcieri Jan 30, 2021
@newpavlov newpavlov merged commit f6a0efd into master Jan 30, 2021
98 checks passed
98 checks passed
Security Audit
Details
clippy
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, thumbv7em-none-eabi)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (1.41.0, wasm32-unknown-unknown)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, thumbv7em-none-eabi)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
build (stable, wasm32-unknown-unknown)
Details
rustfmt
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (1.41.0)
Details
linux (i686-unknown-linux-gnu, 1.41.0, sudo apt update && sudo apt install gcc-multilib)
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (1.41.0)
Details
test (stable)
Details
test (stable)
Details
test (stable)
Details
test (stable)
Details
test (stable)
Details
test (stable)
Details
test (stable)
Details
test (stable)
Details
test (stable)
Details
test (stable)
Details
linux (i686-unknown-linux-gnu, stable, sudo apt update && sudo apt install gcc-multilib)
Details
test (stable)
Details
test (stable)
Details
test (stable)
Details
test (stable)
Details
linux (x86_64-unknown-linux-gnu, 1.41.0)
Details
linux (x86_64-unknown-linux-gnu, stable)
Details
simd
Details
macos (1.41.0)
Details
macos (stable)
Details
windows (x86_64-pc-windows-gnu, stable)
Details
cross (aarch64-unknown-linux-gnu, stable)
Details
@newpavlov newpavlov deleted the sha2/asm_ext branch Jan 30, 2021
@not-an-aardvark
Copy link
Contributor

@not-an-aardvark not-an-aardvark commented Jan 31, 2021

Thanks for making this change. Would it make sense to do the same thing with SHA1 in addition to SHA2? I'm in a similar situation where I'd like to use the SHA1 intrinsic if available, otherwise fall back to the asm implementation. As-is it seems like the asm feature disables the intrinsics.

@not-an-aardvark
Copy link
Contributor

@not-an-aardvark not-an-aardvark commented Jan 31, 2021

I went ahead and created #225 to apply the same change to SHA1.

@dgbo
Copy link

@dgbo dgbo commented Feb 1, 2021

Thank you! This does solve our problem.

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

Successfully merging this pull request may close these issues.

3 participants