aboutsummaryrefslogtreecommitdiff
path: root/benches
diff options
context:
space:
mode:
authorMatthew Krupcale <[email protected]>2020-08-14 18:02:06 -0400
committerMatthew Krupcale <[email protected]>2020-08-24 00:54:46 -0400
commitd91f20dd29e491b70d0fb900ff3445f53add50a3 (patch)
tree02ddbc3bd3281617bcb282be0b825b01df5427f7 /benches
parentadbf07d67a1f08c40e1c7ff60845519f81e0254f (diff)
Start SSE2 implementation based on SSE4.1 version
Wire up basic functions and features for SSE2 support using the SSE4.1 version as a basis without implementing the SSE2 instructions yet. * Cargo.toml: add no_sse2 feature * benches/bench.rs: wire SSE2 benchmarks * build.rs: add SSE2 rust intrinsics and assembly builds * c/Makefile.testing: add SSE2 C and assembly targets * c/README.md: add SSE2 to C build instructions * c/blake3_c_rust_bindings/build.rs: add SSE2 C rust binding builds * c/blake3_c_rust_bindings/src/lib.rs: add SSE2 C rust bindings * c/blake3_dispatch.c: add SSE2 C dispatch * c/blake3_impl.h: add SSE2 C function prototypes * c/blake3_sse2.c: add SSE2 C intrinsic file starting with SSE4.1 version * c/blake3_sse2_x86-64_{unix.S,windows_gnu.S,windows_msvc.asm}: add SSE2 assembly files starting with SSE4.1 version * src/ffi_sse2.rs: add rust implementation using SSE2 C rust bindings * src/lib.rs: add SSE2 rust intrinsics and SSE2 C rust binding rust SSE2 module configurations * src/platform.rs: add SSE2 rust platform detection and dispatch * src/rust_sse2.rs: add SSE2 rust intrinsic file starting with SSE4.1 version * tools/instruction_set_support/src/main.rs: add SSE2 feature detection
Diffstat (limited to 'benches')
-rw-r--r--benches/bench.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/benches/bench.rs b/benches/bench.rs
index 782e06e..ba5a404 100644
--- a/benches/bench.rs
+++ b/benches/bench.rs
@@ -62,6 +62,14 @@ fn bench_single_compression_portable(b: &mut Bencher) {
#[bench]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+fn bench_single_compression_sse2(b: &mut Bencher) {
+ if let Some(platform) = Platform::sse2() {
+ bench_single_compression_fn(b, platform);
+ }
+}
+
+#[bench]
+#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
fn bench_single_compression_sse41(b: &mut Bencher) {
if let Some(platform) = Platform::sse41() {
bench_single_compression_fn(b, platform);
@@ -104,6 +112,14 @@ fn bench_many_chunks_fn(b: &mut Bencher, platform: Platform) {
#[bench]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+fn bench_many_chunks_sse2(b: &mut Bencher) {
+ if let Some(platform) = Platform::sse2() {
+ bench_many_chunks_fn(b, platform);
+ }
+}
+
+#[bench]
+#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
fn bench_many_chunks_sse41(b: &mut Bencher) {
if let Some(platform) = Platform::sse41() {
bench_many_chunks_fn(b, platform);
@@ -163,6 +179,14 @@ fn bench_many_parents_fn(b: &mut Bencher, platform: Platform) {
#[bench]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+fn bench_many_parents_sse2(b: &mut Bencher) {
+ if let Some(platform) = Platform::sse2() {
+ bench_many_parents_fn(b, platform);
+ }
+}
+
+#[bench]
+#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
fn bench_many_parents_sse41(b: &mut Bencher) {
if let Some(platform) = Platform::sse41() {
bench_many_parents_fn(b, platform);