Skip to content

Commit

Permalink
Enable f16 for LoongArch (#770)
Browse files Browse the repository at this point in the history
[ the configured-out tests should be re-enabled once we have the symbols
  in nightly - Trevor ]
  • Loading branch information
heiher authored Mar 5, 2025
1 parent 8daa566 commit 4690673
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 0 additions & 2 deletions configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ pub fn configure_f16_f128(target: &Target) {
// Selection failure <https://github.com/llvm/llvm-project/issues/50374>
"s390x" => false,
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
// FIXME(llvm20): loongarch fixed by <https://github.com/llvm/llvm-project/pull/107791>
"csky" => false,
"hexagon" => false,
"loongarch64" => false,
"powerpc" | "powerpc64" => false,
"sparc" | "sparc64" => false,
"wasm32" | "wasm64" => false,
Expand Down
1 change: 1 addition & 0 deletions testcrate/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions testcrate/tests/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 4690673

Please sign in to comment.