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

polyval: remove cfg(polyval_armv8); enable by default #214

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion polyval/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ std = ["universal-hash/std"]

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = ["cfg(polyval_armv8)", "cfg(polyval_force_soft)"]
check-cfg = ["cfg(polyval_force_soft)"]

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion polyval/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod soft;
use cfg_if::cfg_if;

cfg_if! {
if #[cfg(all(target_arch = "aarch64", polyval_armv8, not(polyval_force_soft)))] {
if #[cfg(all(target_arch = "aarch64", not(polyval_force_soft)))] {
mod autodetect;
mod pmull;
pub use crate::backend::autodetect::Polyval;
Expand Down
4 changes: 2 additions & 2 deletions polyval/src/backend/autodetect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ use universal_hash::{
KeyInit, Reset, UhfClosure, UniversalHash,
};

#[cfg(all(target_arch = "aarch64", polyval_armv8))]
#[cfg(target_arch = "aarch64")]
use super::pmull as intrinsics;

#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
use super::clmul as intrinsics;

#[cfg(all(target_arch = "aarch64", polyval_armv8))]
#[cfg(target_arch = "aarch64")]
cpufeatures::new!(mul_intrinsics, "aes"); // `aes` implies PMULL

#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
Expand Down
12 changes: 3 additions & 9 deletions polyval/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,10 @@
//! ## ARMv8 intrinsics (`PMULL`, MSRV 1.61+)
//! On `aarch64` targets including `aarch64-apple-darwin` (Apple M1) and Linux
//! targets such as `aarch64-unknown-linux-gnu` and `aarch64-unknown-linux-musl`,
//! support for using the `PMULL` instructions in ARMv8's Cryptography Extensions
//! with the following `RUSTFLAGS`:
//! support for using the `PMULL` instructions in ARMv8's Cryptography Extensions.
//!
//! ```text
//! --cfg polyval_armv8
//! ```
//!
//! On Linux and macOS when the ARMv8 features are enabled, support for `PMULL`
//! intrinsics is autodetected at runtime. On other platforms the `crypto`
//! target feature must be enabled via RUSTFLAGS.
//! On Linux and macOS, support for `PMULL` intrinsics is autodetected at runtime.
//! On other platforms the `crypto` target feature must be enabled via RUSTFLAGS.
//!
//! ## `x86`/`x86_64` intrinsics (`CMLMUL`)
//! By default this crate uses runtime detection on `i686`/`x86_64` targets
Expand Down