aboutsummaryrefslogtreecommitdiff
path: root/build.rs
AgeCommit message (Collapse)Author
2025-03-16Rust 1.80 compatibility form `blake3_wasm32_simd`Ivan Boldyrev
2025-03-16Misc textual improvementsIvan Boldyrev
2025-03-16Wasm32 SIMD implementationIvan Boldyrev
This code is based on rust_sse2.rs of the same distribution, and is subject to further improvements. Some comments are left intact even if their applicability is questioned. SIMD implementation is gated by `wasm32-simd` feature, portable version is used otherwise. Performance measurements with a primitive benchmark with ~16Kb of data: | M1 native | 11,610 ns | | M1 WASM SIMD | 13,355 ns | | M1 WASM | 22,037 ns | | x64 native | 6,713 ns | | x64 WASM SIMD | 11,985 ns | | x64 WASM | 25,978 ns | wasmtime v12.0.1 was used on both platforms. Closes #187.
2025-03-14@toothbrush7777777's fix for `use_msvc_asm`Jack O'Connor
https://github.com/BLAKE3-team/BLAKE3/pull/230#issuecomment-2014908888
2025-03-14Fix cross compilation with clang-clSporif
2025-02-13fix build.rs errors on win7 targetsOmer Cheri
2024-07-17build(windows): add support for gnullvm targetsMaksim Bondarenkov
2024-07-12Do not let cc-rs trigger a rebuild any time the env changesMichael Hinton
2024-06-01add check-cfg directives in build.rs to silence nightly warningsJack O'Connor
See https://blog.rust-lang.org/2024/05/06/check-cfg.html.
2023-09-19don't default to NEON intrinsics in build.rs for big-endian targetsJack O'Connor
2021-10-08Add `no_neon` feature to disable NEON on aarch64rsdy
2021-10-07Implement better target detection for NEONrsdy
2021-03-22comment cleanup in build.rs (#164)P.M
2020-08-24Start SSE2 implementation based on SSE4.1 versionMatthew Krupcale
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
2020-04-13refactor build.rsJack O'Connor
Two main changes: - In https://github.com/BLAKE3-team/BLAKE3/issues/79 we learned that older versions of Clang require AVX-512 flags even to compile AVX-512 assembly. - If the C compiler doesn't support AVX-512, we'd still prefer to build the SSE4.1 and AVX2 assembly implementations, on x86_64.
2020-04-01automatically fall back to the pure Rust buildJack O'Connor
There are two scenarios where compiling AVX-512 C or assembly code might not work: 1. There might not be a C compiler installed at all. Most commonly this is either in cross-compiling situations, or with the Windows GNU target. 2. The installed C compiler might not support e.g. -mavx512f, because it's too old. In both of these cases, print a relevant warning, and then automatically fall back to using the pure Rust intrinsics build. Note that this only affects x86 targets. Other targets always use pure Rust, unless the "neon" feature is enabled.
2020-03-29refactor the Cargo feature setJack O'Connor
The biggest change here is that assembly implementations are enabled by default. Added features: - "pure" (Pure Rust, with no C or assembly implementations.) Removed features: - "c" (Now basically the default.) Renamed features; - "c_prefer_intrinsics" -> "prefer_intrinsics" - "c_neon" -> "neon" Unchanged: - "rayon" - "std" (Still the only feature on by default.)
2020-03-29add a Windows GNU AVX-512 build break workaroundJack O'Connor
The break in question only repros under --release, and we didn't start testing a release build of the prefer-intrinsics mode until just now.
2020-02-14check for AVX-512 compiler support even when using assemblyJack O'Connor
2020-02-12more file renaming, use underscores more consistentlyJack O'Connor
2020-02-12Rename assembly files (blake3-* -> blake3_*)Erik Johansson
This gives the assembly files the same prefix as the intrinsics files which simplifies building when the build system should pick between the assembly and the intrinsics files.
2020-02-12integrate assembly implementations into the blake3 crateJack O'Connor
2020-01-13explicitly check for -mavx512f or /arch:AVX512 supportJack O'Connor
If AVX-512 is enabled, and the local C compiler doesn't support it, the build is going to fail. However, if we check for this explicitly, we can give a better error message. Fixes https://github.com/BLAKE3-team/BLAKE3/issues/6.
2020-01-13avoid using MSVC-style flags with the GNU toolchain on WindowsJack O'Connor
2020-01-09delete the previous vendored C files and repoint the Rust codeJack O'Connor
2019-12-12make the "c_avx512" feature a no-op on non-x86Jack O'Connor
This lets us enable it by default in b3sum.
2019-12-11switch to representing CVs as words for the compression functionJack O'Connor
The portable implementation was getting slowed down by converting back and forth between words and bytes. I made the corresponding change on the C side first (https://github.com/veorq/BLAKE3-c/commit/12a37be8b50922a358c016ba07f46816a3da4a31), and as part of this commit I'm re-vendoring the C code. I'm also exposing a small FFI interface to C so that blake3_neon.c can link against portable.rs rather than blake3_portable.c, see c_neon.rs.
2019-12-09set ARMv7 NEON compiler flags automaticallyJack O'Connor
2019-12-08add Rust FFI wrappers for AVX-512 and NEONJack O'Connor