about summary refs log tree commit diff
path: root/library/stdarch/crates/std_detect
AgeCommit message (Collapse)AuthorLines
2022-09-22Add HWCAP2 support for AArch64 Linux. (#1335)Jacob Bramley-89/+199
2022-09-11Bump `cfg-if` dependency to 1.0Charles Lew-1/+1
2022-08-22Allow internal use of stdsimd from detect_featureTomasz Miąsko-0/+1
This allows using feature detection macros, without placing a requirement of enabled stdsimd feature gate from end users. A follow-up to changes from #1311, which introduced the new macro.
2022-07-02Allow mapping a runtime feature to a set of target_features (#1311)Adam Gemmell-4/+17
2022-06-21Fully qualify recursive macro calls (#1310)Adam Gemmell-4/+4
2022-04-29Add stdsimd feature to allow_internal_unstable attribute in feature detect ↵Jane Lusby-1/+1
macros (#1303)
2022-03-17Use SPDX license format and update packed_simd crate link (#1297)Alex Touchet-1/+1
2022-03-11Import the asm macro in std_detect (#1290)Luca Barbato-0/+1
2022-02-17Avoid the use of #[cfg(doc)] in std_detect (#1283)Amanieu d'Antras-271/+115
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2022-02-10Split aarch64 `pauth` feature into `paca` and `pacg` (#1259)Adam Gemmell-6/+14
2022-02-09Stabilise `is_aarch64_feature_detected!` under `simd_aarch64` feature (#1239)Adam Gemmell-40/+40
2022-01-28Emit the full is_{arch}_feature_detected! macro on all arches when building ↵Amanieu d'Antras-1/+45
docs (#1276)
2022-01-24Fix std_detect_file_ioAmanieu d'Antras-0/+5
2022-01-18Handle stabilization of vec_spare_capacityAmanieu d'Antras-6/+0
2021-12-19Remove asm feature which is now stable (#1269)Amanieu d'Antras-1/+0
2021-12-14Fix a bunch of typosFrank Steffahn-5/+5
2021-12-08RISC-V feature and detect macro (#1263)Luo Jia-4/+364
2021-11-27Support riscv64gc-unknown-freebsd (#1260)Tobias Kortkamp-1/+2
2021-11-19Work-around buggy Intel chips erroneously reporting BMI1/BMI2 support (#1249)Thom Chiovoloni-0/+20
2021-11-10Add remaining insturctions (#1250)Sparrow Li-0/+2
* add vmmla vusmmla vsm4e vsm3 vrax1 vxar vsha512 vbcax veor3 neon instructions * update runtime feature detect * correct tests * add `vrnd32x` `vrnd64x` * add MISSING.md
2021-10-16Fix error message of is_*_feature_detected on nort_feature (#1232)Taiki Endo-1/+1
2021-09-20Make dedup guard optional (#1215)Hans Kratz-3/+3
2021-08-22Fix typos “an”→“a”Frank Steffahn-1/+1
2021-08-12Remove references to the crates on crates.io.Mara Bos-9/+0
They haven't been published in years. This removes the suggestion that the crates on crates.io are actively updated/maintained.
2021-05-28Update aarch64 linux feature detection (#1146)Adam Gemmell-65/+368
2021-04-24Move cfg!(target_feature) directly into is_*_feature_detected!() (#1141)Amanieu d'Antras-3/+3
Fixes #1135
2021-04-23remove unused const_fn feature (#1140)Ralf Jung-1/+1
2021-04-07Deny 2018 idiom lints (#1108)Joshua Nelson-2/+4
This lint is allow by default, which is why this wasn't spotted earlier. It's denied by rust-lang/rust, so it's good to warn about it here so it can be fixed more quickly.
2021-03-18Fix building std_detect as a dependency of std (#1089)Amanieu d'Antras-4/+15
2021-03-17Convert all uses of llvm_asm! to asm! (#1052)Amanieu d'Antras-4/+16
2021-03-13Remove trailing semicolon from macro expression (#1080)Aaron Hill-1/+1
Unblocks https://github.com/rust-lang/rust/pull/83089
2021-02-14Turn std_detect into a no_std crate (#1005)Amanieu d'Antras-95/+165
2021-01-18Fix false rustdoc broken_intra_link detection (#984)Carlos Pérez-1/+1
I saw in https://github.com/rust-lang/rust/issues/81037 that when you document private items with rustdoc the `x86 AVX-512 BITALG` feature comment does not contain scape characters in the message and therefore rustdoc was emiting warnings. This fixes it.
2021-01-04Avx512vbmi (#977)minybot-1/+1
2020-11-02Fix some clippy lints (#937)Joshua Nelson-2/+2
2020-09-17Optimize std_detect's caching (#908)Thom Chiovoloni-34/+47
2020-07-18Update and revamp wasm32 SIMD intrinsics (#874)Alex Crichton-0/+3
Lots of time and lots of things have happened since the simd128 support was first added to this crate. Things are starting to settle down now so this commit syncs the Rust intrinsic definitions with the current specification (https://github.com/WebAssembly/simd). Unfortuantely not everything can be enabled just yet but everything is in the pipeline for getting enabled soon. This commit also applies a major revamp to how intrinsics are tested. The intention is that the setup should be much more lightweight and/or easy to work with after this commit. At a high-level, the changes here are: * Testing with node.js and `#[wasm_bindgen]` has been removed. Instead intrinsics are tested with Wasmtime which has a nearly complete implementation of the SIMD spec (and soon fully complete!) * Testing is switched to `wasm32-wasi` to make idiomatic Rust bits a bit easier to work with (e.g. `panic!)` * Testing of this crate's simd128 feature for wasm is re-enabled. This will run on CI and both compile and execute intrinsics. This should bring wasm intrinsics to the same level of parity as x86 intrinsics, for example. * New wasm intrinsics have been added: * `iNNxMM_loadAxA_{s,u}` * `vNNxMM_load_splat` * `v8x16_swizzle` * `v128_andnot` * `iNNxMM_abs` * `iNNxMM_narrow_*_{u,s}` * `iNNxMM_bitmask` - commented out until LLVM is updated to LLVM 11 * `iNNxMM_widen_*_{u,s}` - commented out until bytecodealliance/wasmtime#1994 lands * `iNNxMM_{max,min}_{u,s}` * `iNNxMM_avgr_u` * Some wasm intrinsics have been removed: * `i64x2_trunc_*` * `f64x2_convert_*` * `i8x16_mul` * The `v8x16.shuffle` instruction is exposed. This is done through a `macro` (not `macro_rules!`, but `macro`). This is intended to be somewhat experimental and unstable until we decide otherwise. This instruction has 16 immediate-mode expressions and is as a result unsuited to the existing `constify_*` logic of this crate. I'm hoping that we can game out over time what a macro might look like and/or look for better solutions. For now, though, what's implemented is the first of its kind in this crate (an architecture-specific macro), so some extra scrutiny looking at it would be appreciated. * Lots of `assert_instr` annotations have been fixed for wasm. * All wasm simd128 tests are uncommented and passing now. This is still missing tests for new intrinsics and it's also missing tests for various corner cases. I hope to get to those later as the upstream spec itself gets closer to stabilization. In the meantime, however, I went ahead and updated the `hex.rs` example with a wasm implementation using intrinsics. With it I got some very impressive speedups using Wasmtime: test benches::large_default ... bench: 213,961 ns/iter (+/- 5,108) = 4900 MB/s test benches::large_fallback ... bench: 3,108,434 ns/iter (+/- 75,730) = 337 MB/s test benches::small_default ... bench: 52 ns/iter (+/- 0) = 2250 MB/s test benches::small_fallback ... bench: 358 ns/iter (+/- 0) = 326 MB/s or otherwise using Wasmtime hex encoding using SIMD is 15x faster on 1MB chunks or 7x faster on small <128byte chunks. All of these intrinsics are still unstable and will continue to be so presumably until the simd proposal in wasm itself progresses to a later stage. Additionaly we'll still want to sync with clang on intrinsic names (or decide not to) at some point in the future. * wasm: Unconditionally expose SIMD functions This commit unconditionally exposes SIMD functions from the `wasm32` module. This is done in such a way that the standard library does not need to be recompiled to access SIMD intrinsics and use them. This, hopefully, is the long-term story for SIMD in WebAssembly in Rust. It's unlikely that all WebAssembly runtimes will end up implementing SIMD so the standard library is unlikely to use SIMD any time soon, but we want to make sure it's easily available to folks! This commit enables all this by ensuring that SIMD is available to the standard library, regardless of compilation flags. This'll come with the same caveats as x86 support, where it doesn't make sense to call these functions unless you're enabling simd support one way or another locally. Additionally, as with x86, if you don't call these functions then the instructions won't show up in your binary. While I was here I went ahead and expanded the WebAssembly-specific documentation for the wasm32 module as well, ensuring that the current state of SIMD/Atomics are documented.
2020-05-29feature detectionMahmut Bulut-0/+4
2020-05-29Implementation for Aarch64 TME intrinsicsMahmut Bulut-0/+1
2020-04-24Unbreak non-x86 build on FreeBSDTobias Kortkamp-1/+1
error[E0432]: unresolved import `self::arm::check_for` --> src/libstd/../stdarch/crates/std_detect/src/detect/os/freebsd/mod.rs:11:17 | 11 | pub use self::arm::check_for; | ^^^^^^^^^^^^^^^^^^^^ no `check_for` in `std_detect::detect::os::arm` error[E0425]: cannot find value `detect_features` in module `self::os` --> src/libstd/../stdarch/crates/std_detect/src/detect/mod.rs:121:37 | 121 | cache::test(x as u32, self::os::detect_features) | ^^^^^^^^^^^^^^^ not found in `self::os` | help: possible candidate is found in another module, you can import it into scope | 20 | use crate::std_detect::detect::os::arm::detect_features;
2020-04-24Stabilize all remaining x86 features for feature detectionAmanieu d'Antras-19/+27
2020-04-09Use llvm_asm! instead of asm! (#846)Amanieu d'Antras-4/+4
2020-04-04Replace all max/min_value() with MAX/MINLinus Färnstrand-2/+2
2020-03-29Replace module MIN/MAX and min/max_value() with assoc consts (#843)Linus Färnstrand-1/+1
2020-03-29Add crypto target feature detection to arm32 (#833)Makoto Kato-0/+19
2020-03-19re-stabilize the AVX-512 features that were stabilized in Rust 1.27.0 (#842)Jack O'Connor-10/+14
* re-stabilize the AVX-512 features that were stabilized in Rust 1.27.0 https://github.com/rust-lang/stdarch/pull/739 added per-feature stabilization of runtime CPU feature detection. In so doing, it de-stabilized some detection features that had been stable since Rust 1.27.0, breaking some published crates (on nightly). This commit re-stabilizes the subset of AVX-512 detection features that were included in 1.27.0 (that is, the pre-Ice-Lake subset). Other instruction sets (MMX in particular) remain de-stabilized, pending a decision about whether should ever stabilize them. See https://github.com/rust-lang/rust/issues/68905. * add a comment explaining feature detection stability * adjust stabilizations to match most recent proposal https://github.com/rust-lang/rust/issues/68905#issuecomment-595376319
2020-01-28Fix race condition in feature cache on 32 platforms (#837)Aleksey Kladov-63/+36
* Fix race condition in feature cache on 32 platforms If we observe that the second word is initialized, we can't really assume that the first is initialized as well. So check each word separately. * Use stronger atomic ordering Better SeqCst than sorry! * Use two caches on x64 for simplicity
2020-01-26Add Icelake avx512 features (#838)Luca Barbato-0/+58
* Add Icelake avx512 features As documented in https://software.intel.com/sites/default/files/managed/c5/15//architecture-instruction-set-extensions-programming-reference.pdf * Sort the avx512 feature checks by bit * Unbreak macos Force nightly.
2019-12-27Use issue = "none" instead of "0"Yuki Okushi-1/+1
2019-12-11Run-time feature detection for Aarch64 on Windows.Makoto Kato-0/+58