HomePhabricator

[CMAKE] Enable SSE4.1, SHA-NI and AVX2 for the crypto library

Description

[CMAKE] Enable SSE4.1, SHA-NI and AVX2 for the crypto library

Summary: They are enabled if the hardware support the appropriated instructions.

Test Plan:
Edit src/bench/bench_bitcoin.cpp and replace the line:

SHA256AutoDetect();

With:

std::cout << SHA256AutoDetect() <<std::endl;

Then

cmake -GNinja ..
ninja bitcoin-bench
./src/bench/bitcoin-bench -filter=SHA256

Check that the enabled features match your hardware capabilities by
looking at the CPU flags in /proc/cpuinfo.
Checked with all flags and without avx2.

Run the gitian builds.

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D4706

Details

Provenance
FabienAuthored on Dec 11 2019, 18:07
FabienPushed on Dec 13 2019, 07:51
Reviewer
Restricted Project
Differential Revision
D4706: [CMAKE] Enable SSE4.1, SHA-NI and AVX2 for the crypto library
Parents
rSTAGING695e8e1543b1: reduce code duplication in UpdateFlags
Branches
Unknown
Tags
Unknown