diff --git a/Cargo.lock b/Cargo.lock index d70ff0d0..024a2bf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,7 +35,7 @@ version = "0.0.2" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.6" dependencies = [ "libc", ] diff --git a/cpufeatures/CHANGELOG.md b/cpufeatures/CHANGELOG.md index 2f89603d..71acc5de 100644 --- a/cpufeatures/CHANGELOG.md +++ b/cpufeatures/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.2.6 (2023-03-24) +### Added +- Support dynamic feature detection on iOS and derivative platforms ([#848]) +- Support for detecting AVX-512 target features ([#862]) + +[#848]: https://github.com/RustCrypto/utils/issues/848 +[#862]: https://github.com/RustCrypto/utils/pull/862 + ## 0.2.5 (2022-09-04) ### Fixed - Add workaround for [CPUID bug] in `std` ([#800]) diff --git a/cpufeatures/Cargo.toml b/cpufeatures/Cargo.toml index 4022d0a1..58eec221 100644 --- a/cpufeatures/Cargo.toml +++ b/cpufeatures/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cpufeatures" -version = "0.2.5" +version = "0.2.6" description = """ Lightweight runtime CPU feature detection for x86/x86_64 and aarch64 with no_std support and support for mobile targets including Android and iOS @@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0" documentation = "https://docs.rs/cpufeatures" repository = "https://github.com/RustCrypto/utils" keywords = ["cpuid", "target-feature"] -categories = ["no-std"] +categories = ["hardware-support", "no-std"] edition = "2018" readme = "README.md" diff --git a/cpufeatures/README.md b/cpufeatures/README.md index 5a5bb406..273789d7 100644 --- a/cpufeatures/README.md +++ b/cpufeatures/README.md @@ -18,20 +18,24 @@ macro. ## Supported architectures -### `aarch64`: Android, iOS, Linux, and macOS/M4 only +# Supported target architectures -Note: ARM64 does not support OS-independent feature detection, so support must -be implemented on an OS-by-OS basis. +*NOTE: target features with an asterisk are unstable (nightly-only) and subject +to change to match upstream name changes in the Rust standard library. + +## `aarch64` + +Linux, iOS, and macOS/ARM only (ARM64 does not support OS-independent feature detection) Target features: -- `aes` -- `sha2` -- `sha3` +- `aes`* +- `sha2`* +- `sha3`* -Note: please open a GitHub Issue to request support for additional features. +## `x86`/`x86_64` -### `x86`/`x86_64`: OS independent and `no_std`-friendly +OS independent and `no_std`-friendly Target features: @@ -39,9 +43,17 @@ Target features: - `aes` - `avx` - `avx2` +- `avx512bw`* +- `avx512cd`* +- `avx512dq`* +- `avx512er`* +- `avx512f`* +- `avx512ifma`* +- `avx512pf`* +- `avx512vl`* - `bmi1` - `bmi2` -- `fma` +- `fma`, - `mmx` - `pclmulqdq` - `popcnt` @@ -56,6 +68,9 @@ Target features: - `sse4.2` - `ssse3` +If you would like detection support for a target feature which is not on +this list, please [open a GitHub issue]. + ## License Licensed under either of: @@ -88,3 +103,4 @@ dual licensed as above, without any additional terms or conditions. [RustCrypto]: https://github.com/rustcrypto [RustCrypto/utils#378]: https://github.com/RustCrypto/utils/issues/378 +[open a GitHub issue]: https://github.com/RustCrypto/utils/issues/new?title=cpufeatures:%20requesting%20support%20for%20CHANGEME%20target%20feature diff --git a/cpufeatures/src/lib.rs b/cpufeatures/src/lib.rs index 63c1c7a9..dfd1feab 100644 --- a/cpufeatures/src/lib.rs +++ b/cpufeatures/src/lib.rs @@ -2,17 +2,18 @@ //! as a stopgap until Rust [RFC 2725] adding first-class target feature detection //! macros to `libcore` is implemented. //! -//! //! # Supported target architectures //! -//! *NOTE: target features with an asterisk are unstable and subject to change -//! to match upstream name changes in the Rust standard library. +//! *NOTE: target features with an asterisk are unstable (nightly-only) and +//! subject to change to match upstream name changes in the Rust standard +//! library. //! //! ## `aarch64` //! //! Linux, iOS, and macOS/ARM only (ARM64 does not support OS-independent feature detection) //! //! Target features: +//! //! - `aes`* //! - `sha2`* //! - `sha3`* @@ -22,6 +23,7 @@ //! OS independent and `no_std`-friendly //! //! Target features: +//! //! - `adx` //! - `aes` //! - `avx`