Debian Codegraph @

third_party/rust/cpufeatures/README.md

raw
1 # [RustCrypto]: CPU Feature Detection
2
3 [![crate][crate-image]][crate-link]
4 [![Docs][docs-image]][docs-link]
5 ![Apache2/MIT licensed][license-image]
6 ![Rust Version][rustc-image]
7 [![Project Chat][chat-image]][chat-link]
8 [![Build Status][build-image]][build-link]
9
10 Lightweight and efficient runtime CPU feature detection for `aarch64` and
11 `x86`/`x86_64` targets.
12
13 Supports `no_std` as well as mobile targets including iOS and Android,
14 providing an alternative to the `std`-dependent `is_x86_feature_detected!`
15 macro.
16
17 [Documentation][docs-link]
18
19 ## Supported architectures
20
21 # Supported target architectures
22
23 *NOTE: target features with an asterisk are unstable (nightly-only) and subject
24 to change to match upstream name changes in the Rust standard library.
25
26 ## `aarch64`
27
28 Linux, iOS, and macOS/ARM only (ARM64 does not support OS-independent feature detection)
29
30 Target features:
31
32 - `aes`*
33 - `sha2`*
34 - `sha3`*
35
36 ## `x86`/`x86_64`
37
38 OS independent and `no_std`-friendly
39
40 Target features:
41
42 - `adx`
43 - `aes`
44 - `avx`
45 - `avx2`
46 - `avx512bw`*
47 - `avx512cd`*
48 - `avx512dq`*
49 - `avx512er`*
50 - `avx512f`*
51 - `avx512ifma`*
52 - `avx512pf`*
53 - `avx512vl`*
54 - `bmi1`
55 - `bmi2`
56 - `fma`,
57 - `mmx`
58 - `pclmulqdq`
59 - `popcnt`
60 - `rdrand`
61 - `rdseed`
62 - `sgx`
63 - `sha`
64 - `sse`
65 - `sse2`
66 - `sse3`
67 - `sse4.1`
68 - `sse4.2`
69 - `ssse3`
70
71 If you would like detection support for a target feature which is not on
72 this list, please [open a GitHub issue].
73
74 ## License
75
76 Licensed under either of:
77
78 * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
79 * [MIT license](http://opensource.org/licenses/MIT)
80
81 at your option.
82
83 ### Contribution
84
85 Unless you explicitly state otherwise, any contribution intentionally submitted
86 for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
87 dual licensed as above, without any additional terms or conditions.
88
89 [//]: # (badges)
90
91 [crate-image]: https://img.shields.io/crates/v/cpufeatures.svg
92 [crate-link]: https://crates.io/crates/cpufeatures
93 [docs-image]: https://docs.rs/cpufeatures/badge.svg
94 [docs-link]: https://docs.rs/cpufeatures/
95 [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
96 [rustc-image]: https://img.shields.io/badge/rustc-1.40+-blue.svg
97 [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
98 [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260052-utils
99 [build-image]: https://github.com/RustCrypto/utils/workflows/cpufeatures/badge.svg?branch=master&event=push
100 [build-link]: https://github.com/RustCrypto/utils/actions/workflows/cpufeatures.yml
101
102 [//]: # (general links)
103
104 [RustCrypto]: https://github.com/rustcrypto
105 [RustCrypto/utils#378]: https://github.com/RustCrypto/utils/issues/378
106 [open a GitHub issue]: https://github.com/RustCrypto/utils/issues/new?title=cpufeatures:%20requesting%20support%20for%20CHANGEME%20target%20feature