Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions testcrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ no-sys-f128 = ["no-sys-f128-int-convert", "no-sys-f16-f128-convert"]
no-sys-f128-int-convert = []
no-sys-f16-f128-convert = []
no-sys-f16-f64-convert = []
no-sys-f16-gnu-convert = []
# Skip tests that rely on f16 symbols being available on the system
no-sys-f16 = ["no-sys-f16-f64-convert", "no-sys-f16-gnu-convert"]
no-sys-f16 = ["no-sys-f16-f64-convert"]

# Enable report generation without bringing in more dependencies by default
benchmarking-reports = ["criterion/plotters", "criterion/html_reports"]
Expand Down
18 changes: 1 addition & 17 deletions testcrate/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,16 @@ enum Feature {
NoSysF16,
NoSysF16F64Convert,
NoSysF16F128Convert,
NoSysF16GnuConvert,
}

impl Feature {
fn implies(self) -> &'static [Self] {
match self {
Self::NoSysF128 => [Self::NoSysF128IntConvert, Self::NoSysF16F128Convert].as_slice(),
Self::NoSysF128IntConvert => [].as_slice(),
Self::NoSysF16 => [
Self::NoSysF16F64Convert,
Self::NoSysF16F128Convert,
Feature::NoSysF16GnuConvert,
]
.as_slice(),
Self::NoSysF16 => [Self::NoSysF16F64Convert, Self::NoSysF16F128Convert].as_slice(),
Self::NoSysF16F64Convert => [].as_slice(),
Self::NoSysF16F128Convert => [].as_slice(),
Self::NoSysF16GnuConvert => [].as_slice(),
}
}
}
Expand Down Expand Up @@ -92,11 +85,6 @@ fn main() {
features.insert(Feature::NoSysF16F64Convert);
}

// These platforms do not have `__gnu_f2h_ieee` or `__gnu_h2f_ieee`.
if false {
features.insert(Feature::NoSysF16GnuConvert);
}

// Add implied features. Collection is required for borrows.
features.extend(
features
Expand All @@ -121,10 +109,6 @@ fn main() {
"no-sys-f16-f128-convert",
"using apfloat fallback for f16 <-> f128 conversions",
),
Feature::NoSysF16GnuConvert => (
"no-sys-f16-gnu-convert",
"using apfloat fallback for __gnu f16",
),
Feature::NoSysF16 => ("no-sys-f16", "using apfloat fallback for f16"),
};
println!("cargo:warning={warning}");
Expand Down
4 changes: 2 additions & 2 deletions testcrate/tests/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ mod extend {
f_to_f! {
extend,
f16 => f32, Half => Single, __extendhfsf2, not(feature = "no-sys-f16");
f16 => f32, Half => Single, __gnu_h2f_ieee, not(feature = "no-sys-f16-gnu-convert");
f16 => f32, Half => Single, __gnu_h2f_ieee, not(feature = "no-sys-f16");
f16 => f64, Half => Double, __extendhfdf2, not(feature = "no-sys-f16-f64-convert");
f16 => f128, Half => Quad, __extendhftf2, not(feature = "no-sys-f16-f128-convert");
f32 => f128, Single => Quad, __extendsftf2, not(feature = "no-sys-f128");
Expand Down Expand Up @@ -348,7 +348,7 @@ mod trunc {
f_to_f! {
trunc,
f32 => f16, Single => Half, __truncsfhf2, not(feature = "no-sys-f16");
f32 => f16, Single => Half, __gnu_f2h_ieee, not(feature = "no-sys-f16-gnu-convert");
f32 => f16, Single => Half, __gnu_f2h_ieee, not(feature = "no-sys-f16");
f64 => f16, Double => Half, __truncdfhf2, not(feature = "no-sys-f16-f64-convert");
f128 => f16, Quad => Half, __trunctfhf2, not(feature = "no-sys-f16-f128-convert");
f128 => f32, Quad => Single, __trunctfsf2, not(feature = "no-sys-f128");
Expand Down