about summary refs log tree commit diff
path: root/library/stdarch/crates/std_detect/src/detect/cache.rs
AgeCommit message (Collapse)AuthorLines
2025-07-22Move `std_detect` from `library/stdarch` to `library`Jakub Beránek-223/+0
2025-05-30Add back `std_detect_env_override`sayantn-2/+59
2025-04-20Remove `cupid` dependency and `env-override-no-avx` CI runsayantn-59/+2
2025-04-16RISC-V: OS-independent implication logicTsukasa OI-1/+1
This commit adds the OS-independent extension implication logic for RISC-V. It implements: 1. Regular implication (A → B) a. "the extension A implies the extension B" b. "the extension A requires the extension B" c. "the extension A depends on the extension B" 2. Extension group or shorthand (A == B1 & B2...) a. "the extension A is shorthand for other extensions: B1, B2..." b. "the extension A comprises instructions provided by B1, B2..." This is implemented as (A → B1 & B2... + B1 & B2... → A) where the former is a regular implication as required by specifications and the latter is a "reverse" implication to improve usability. and prepares for: 3. Implication with multiple requirements (A1 & A2... → B) a. "A1 + A2 implies B" b. (implicitly used to implement reverse implication of case 2) Although it uses macros and iterators, good optimizers turn the series of implications into fast bit-manipulation operations. In the case 2 (extension group or shorthand; where a superset extension is just a collection of other subextensions and provides no features by a superset itself), specifications do specify that an extension group implies its members but not vice versa. However, implying an extension group from its members would improve usability on the feature detection (especially when the feature provider does not provide existence of such extension group but provides existence of its members). Similar "reverse implication" on RISC-V is implemented on LLVM. Case 3 is implicitly used to implement reverse implication of case 2 but there's another use case: implication with multiple requirements like "Zcf" and "Zcd" extensions (not yet implemented in this crate for now). To handle extension groups perfectly, we need to loop implication several times (until they converge; normally 2 times and up to 4 times when we add most of `riscv_hwprobe`-based features). To make implementation of that loop possible, `cache::Initializer` is modified to implement `PartialEq` and `Eq`.
2025-02-09Apply missing_unsafe_on_externEric Huss-1/+1
2024-09-30Minor lintingYuri Astrakhan-1/+1
2024-09-18Use C string literalTaiki Endo-4/+5
2024-06-23Added runtime detectionsayantn-11/+19
Expanded the cache size to 93 (we will need this in near future) Fixed detection of VAES, GFNI and VPCLMULQDQ Could not test with `cupid` because they do not support these yet
2024-05-07Remove libc dependency on Windows by using Win32 to get env varsDaniel Paoliello-9/+34
2023-10-31Derive `Default` for `Initializer` in std_detectEduardo Sánchez Muñoz-8/+3
2022-10-25Fix dupe word typos (#1344)Rageking8-1/+1
2021-02-14Turn std_detect into a no_std crate (#1005)Amanieu d'Antras-5/+12
2020-09-17Optimize std_detect's caching (#908)Thom Chiovoloni-33/+46
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-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
2019-10-10Remove need for `#[macro_use]` with `cfg-if`Alex Crichton-1/+1
Modernizes usage of `cfg_if!` slightly
2019-09-17Make the test function smallerLuca Barbato-7/+6
2019-09-17Remove the FIXME about the cache size checksLuca Barbato-6/+2
And leave a NOTE.
2019-09-17Override the features detected using an env::varLuca Barbato-1/+24
Fixes: #804
2019-09-17Add a mean to unset a bit in the cacheLuca Barbato-0/+19
2019-04-17Fix clippy issuesgnzlbg-6/+3
2019-02-19Change imports in std_detect to edition-agnostic styleTaiki Endo-3/+3
2019-02-18Various cosmetic improvements.Alexander Regueiro-1/+1
2019-02-09Add cargo features to disable usage of file I/O and dlsym in std_detectgnzlbg-3/+3
2019-02-05Remove const workaround in std_detect cachegnzlbg-2/+1
2019-01-22Do not use Self constructorsgnzlbg-2/+4
2019-01-22Fix clippy issuesgnzlbg-1/+5
2019-01-22Refactor stdsimdgnzlbg-0/+162
This commit: * renames `coresimd` to `core_arch` and `stdsimd` to `std_detect` * `std_detect` does no longer depend on `core_arch` - it is a freestanding `no_std` library that only depends on `core` - it is renamed to `std_detect` * moves the top-level coresimd and stdsimd directories into the appropriate crates/... directories - this simplifies creating crate.io releases of these crates * moves the top-level `coresimd` and `stdsimd` sub-directories into their corresponding crates in `crates/{core_arch, std_detect}`.