Skip to content
This repository was archived by the owner on Oct 18, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions common/src/floats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,19 +417,25 @@ where
} else if cfg!(any(target_arch = "x86", target_arch = "x86_64")) {
match WIDTH {
16 => {
assert!(cfg!(target_feature = "avx512f"));
const {
assert!(cfg!(target_feature = "avx512f"));
}
None
}
8 => {
assert!(cfg!(target_feature = "avx"));
const {
assert!(cfg!(target_feature = "avx"));
}
if cfg!(target_feature = "avx512f") {
NonZeroUsize::new(2)
} else {
None
}
}
4 => {
assert!(cfg!(any(target_arch = "x86_64", target_feature = "sse")));
const {
assert!(cfg!(any(target_arch = "x86_64", target_feature = "sse")));
}
if cfg!(target_feature = "avx") {
NonZeroUsize::new(2)
} else if cfg!(target_feature = "avx512f") {
Expand Down Expand Up @@ -524,19 +530,25 @@ where
} else if cfg!(any(target_arch = "x86", target_arch = "x86_64")) {
match WIDTH {
8 => {
assert!(cfg!(target_feature = "avx512f"));
const {
assert!(cfg!(target_feature = "avx512f"));
}
None
}
4 => {
assert!(cfg!(target_feature = "avx"));
const {
assert!(cfg!(target_feature = "avx"));
}
if cfg!(target_feature = "avx512f") {
NonZeroUsize::new(2)
} else {
None
}
}
2 => {
assert!(cfg!(any(target_arch = "x86_64", target_feature = "sse2")));
const {
assert!(cfg!(any(target_arch = "x86_64", target_feature = "sse2")));
}
if cfg!(target_feature = "avx") {
NonZeroUsize::new(2)
} else if cfg!(target_feature = "avx512f") {
Expand Down Expand Up @@ -666,10 +678,12 @@ pub fn subnormal_sampler<T: FloatLike, R: Rng>(extremal_bias: f32) -> impl Fn(&m
/// the point where non-extremal values are not exercized enough.
pub fn suggested_extremal_bias(inside_test: bool, output_size: usize) -> f32 {
if inside_test {
assert!(
cfg!(any(test, feature = "unstable_test")),
"extremal_bias is a testing feature and should not be enabled outside of unit tests"
);
const {
assert!(
cfg!(any(test, feature = "unstable_test")),
"extremal_bias is a testing feature and should not be enabled outside of unit tests"
);
}
let min_extremal_bias = 0.05;
let max_extremal_bias = 0.25;
let output_size = output_size as f64;
Expand Down
Loading