From 118bce2a37f4f6ad2ff6c461836c7245c41d9429 Mon Sep 17 00:00:00 2001 From: WANG Rui Date: Wed, 26 Feb 2025 15:56:14 +0800 Subject: [PATCH] Skip the f16-related tests on LoongArch Skip the f16-related tests on LoongArch if there are no f16 symbols in the system libraries. --- testcrate/build.rs | 1 + testcrate/tests/conv.rs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/testcrate/build.rs b/testcrate/build.rs index 171c1d52..868d8700 100644 --- a/testcrate/build.rs +++ b/testcrate/build.rs @@ -75,6 +75,7 @@ fn main() { || target.arch == "powerpc" || target.arch == "powerpc64" || target.arch == "powerpc64le" + || target.arch == "loongarch64" || (target.arch == "x86" && !target.has_feature("sse")) || target.os == "windows" // Linking says "error: function signature mismatch: __extendhfsf2" and seems to diff --git a/testcrate/tests/conv.rs b/testcrate/tests/conv.rs index f94aaf17..d7066354 100644 --- a/testcrate/tests/conv.rs +++ b/testcrate/tests/conv.rs @@ -306,7 +306,11 @@ mod extend { } #[cfg(all(f16_enabled, f128_enabled))] - #[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))] + #[cfg(not(any( + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "loongarch64" + )))] f_to_f! { extend, f16 => f32, Half => Single, __extendhfsf2, not(feature = "no-sys-f16"); @@ -336,7 +340,11 @@ mod trunc { } #[cfg(all(f16_enabled, f128_enabled))] - #[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))] + #[cfg(not(any( + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "loongarch64" + )))] f_to_f! { trunc, f32 => f16, Single => Half, __truncsfhf2, not(feature = "no-sys-f16");