Skip to content

Commit 4690673

Browse files
authored
Enable f16 for LoongArch (#770)
[ the configured-out tests should be re-enabled once we have the symbols in nightly - Trevor ]
1 parent 8daa566 commit 4690673

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

configure.rs

-2
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ pub fn configure_f16_f128(target: &Target) {
7676
// Selection failure <https://github.com/llvm/llvm-project/issues/50374>
7777
"s390x" => false,
7878
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
79-
// FIXME(llvm20): loongarch fixed by <https://github.com/llvm/llvm-project/pull/107791>
8079
"csky" => false,
8180
"hexagon" => false,
82-
"loongarch64" => false,
8381
"powerpc" | "powerpc64" => false,
8482
"sparc" | "sparc64" => false,
8583
"wasm32" | "wasm64" => false,

testcrate/build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ fn main() {
7575
|| target.arch == "powerpc"
7676
|| target.arch == "powerpc64"
7777
|| target.arch == "powerpc64le"
78+
|| target.arch == "loongarch64"
7879
|| (target.arch == "x86" && !target.has_feature("sse"))
7980
|| target.os == "windows"
8081
// Linking says "error: function signature mismatch: __extendhfsf2" and seems to

testcrate/tests/conv.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,11 @@ mod extend {
306306
}
307307

308308
#[cfg(all(f16_enabled, f128_enabled))]
309-
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
309+
#[cfg(not(any(
310+
target_arch = "powerpc",
311+
target_arch = "powerpc64",
312+
target_arch = "loongarch64"
313+
)))]
310314
f_to_f! {
311315
extend,
312316
f16 => f32, Half => Single, __extendhfsf2, not(feature = "no-sys-f16");
@@ -336,7 +340,11 @@ mod trunc {
336340
}
337341

338342
#[cfg(all(f16_enabled, f128_enabled))]
339-
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
343+
#[cfg(not(any(
344+
target_arch = "powerpc",
345+
target_arch = "powerpc64",
346+
target_arch = "loongarch64"
347+
)))]
340348
f_to_f! {
341349
trunc,
342350
f32 => f16, Single => Half, __truncsfhf2, not(feature = "no-sys-f16");

0 commit comments

Comments
 (0)