# Pre-RFC: is\_x86\_feature\_detected! in core

**URL:** <https://internals.rust-lang.org/t/pre-rfc-is-x86-feature-detected-in-core/24538>\
**Category:** libs\
**Created:** [August 18, 2026, 7:58am UTC](https://internals.rust-lang.org/t/pre-rfc-is-x86-feature-detected-in-core/24538 "2026-08-18T07:58:08Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![newpavlov](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/newpavlov/32/3290_2.png) [@newpavlov](https://internals.rust-lang.org/u/newpavlov)\
**Post date:** [November 10, 2026, 10:48pm UTC](https://internals.rust-lang.org/t/pre-rfc-is-x86-feature-detected-in-core/24538/5 "2026-11-10T22:48:09Z")

</div>

> [@farnz](#):
>
> For example, a target might want to require SSE2, permit AVX2 if present in this CPU (Intel still released new processors without AVX2 in 2021), but ban AVX-512 to save the ~1.5 KiB of AVX-512 state in the XSAVE area.

For this we need something like this:

> [@Allow #\[cfg(target\_feature = "-feature")\]](https://internals.rust-lang.org/t/18169):
>
> Right now in library code we can only query whether a target feature is enabled during compilation or not using #[cfg(target\_feature = "feature")]. In other words, we can write code for two cases: "target feature is enabled" and "target feature is not enabled, but may be available during runtime". In the second case crates could use runtime target feature detection (e.g. based on CPUID) between two code branches: normal and target feature specific wrapped in #[target\_feature(enable = "feature")].…

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-is-x86-feature-detected-in-core/24538)._
