You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When rust-lang/rust#29717 is stable, we should use that feature to do static feature detection.
In the case of 32-bit x86, we'll probably never use static feature detection. Instead, we'll always just use dynamic feature detection.
In the case of 64-bit x86-64, we'll probably only use positive feature detection, because the uesfulness of static feature detection on x86-64 seems limited to only be eliminating overhead for supporting legacy platforms. That is, we'll only use #[cfg(target_feature=)] and not #[cfg(not(target_feature=))].
In the case of ARM (ARMv{6,7}, AAarch32, and Aarch64), we'll start with positive feature detection only.
Later, we'll add negative feature detection for ARM. Negative feature detection needs to be augmented so that we can distinguish between "the target isn't guaranteed to support this feature, but ring should detect it at runtime" and "the code and feature detection for this feature should be entirely omitted because it is unwanted." For example, when compiling for a specific microcontroller, no feature detection logic should be included, and only one implementation of each primitive should be included. We can probably do this by having a "runtime-cpu-feature-detection" default feature that, when disabled, would cause #[cfg(not(target_feature="..."))] to be interpreted as "the code and feature detection for this feature should be entirely omitted because it is unwanted."
The text was updated successfully, but these errors were encountered:
Note that, in order for this to work optimally, we'll probably have to pull all the feature detection logic out of the asm code and move it to Rust (or C).
When rust-lang/rust#29717 is stable, we should use that feature to do static feature detection.
In the case of 32-bit x86, we'll probably never use static feature detection. Instead, we'll always just use dynamic feature detection.
In the case of 64-bit x86-64, we'll probably only use positive feature detection, because the uesfulness of static feature detection on x86-64 seems limited to only be eliminating overhead for supporting legacy platforms. That is, we'll only use
#[cfg(target_feature=)]
and not#[cfg(not(target_feature=))]
.In the case of ARM (ARMv{6,7}, AAarch32, and Aarch64), we'll start with positive feature detection only.
Later, we'll add negative feature detection for ARM. Negative feature detection needs to be augmented so that we can distinguish between "the target isn't guaranteed to support this feature, but ring should detect it at runtime" and "the code and feature detection for this feature should be entirely omitted because it is unwanted." For example, when compiling for a specific microcontroller, no feature detection logic should be included, and only one implementation of each primitive should be included. We can probably do this by having a "runtime-cpu-feature-detection" default feature that, when disabled, would cause
#[cfg(not(target_feature="..."))]
to be interpreted as "the code and feature detection for this feature should be entirely omitted because it is unwanted."The text was updated successfully, but these errors were encountered: