tests: Also gate f16::erfc() doctest with reliable_f16_math cfg - #137167
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @tgross35 (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
In 136324 the doctest for `f16::erf()` was gated with
`reliable_f16_math`. Add the same gate on `f16::erfc()` to
avoid:
rust_out.71e2e529d20ea47d-cgu.0:\
(.text._ZN8rust_out4main43_doctest_main_library_std_src_f16_rs_1321_017h485f3ffe6bf2a981E+0x38): \
undefined reference to `__gnu_h2f_ieee'
on MIPS (and maybe other architectures).
799639b to
f6485ff
Compare
f16::erfc() with reliable_f16_math cfgf16::erfc() doctest with reliable_f16_math cfg
GrigorenkoPV
left a comment
There was a problem hiding this comment.
Sorry, missed this one. I've double-checked now, and looks like this indeed is the only one that's missing.
|
@bors r+ rollup |
|
Thanks for the catch, unfortunately I don't think we run tests on any platforms that don't support f16 Lines 97 to 118 in ce36a96 However, I think we could actually remove mips from that list if llvm/llvm-project#110199 made it into llvm 20, which Rust just upgraded to. @martn3 if that sounds right, you could try deleting https://github.com/rust-lang/compiler-builtins/blob/3c09866aa4c699ed5f430567f6de97ed56b65126/configure.rs#L81 and then running tests. If it works also update the above std/build.rs, and then we have |
@tgross35 According to my testing, f16 works on MIPS with Rust master branch with LLVM 20 🎉 . I ran with Rust master plus this: diff --git a/configure.rs b/configure.rs
index fa3e302..ff52e88 100644
--- a/configure.rs
+++ b/configure.rs
@@ -80,3 +80,2 @@ pub fn configure_f16_f128(target: &Target) {
"loongarch64" => false,
- "mips" | "mips64" | "mips32r6" | "mips64r6" => false,
"powerpc" | "powerpc64" => false,and this: diff --git a/library/Cargo.lock b/library/Cargo.lock
index 0be2f9a1549..5340d74fc3c 100644
--- a/library/Cargo.lock
+++ b/library/Cargo.lock
@@ -64,4 +64,3 @@ name = "compiler_builtins"
version = "0.1.146"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a97117b1434b79833f39a5fabdf82f890bd98c1988334dea1cb67f7e627fa311"
+source = "git+https://github.com/martn3/compiler-builtins.git?branch=f16-mips#b15a085cf1ca4b8e9d31b56dd564bb8954306ae5"
dependencies = [
diff --git a/library/Cargo.toml b/library/Cargo.toml
index 1205f7c9ed6..b973d04d99e 100644
--- a/library/Cargo.toml
+++ b/library/Cargo.toml
@@ -43,2 +43,3 @@ rustc-demangle.debug = 0
[patch.crates-io]
+compiler_builtins = { git = 'https://github.com/martn3/compiler-builtins.git', branch = "f16-mips" }
# See comments in `library/rustc-std-workspace-core/README.md` for what's going on
diff --git a/library/std/build.rs b/library/std/build.rs
index 8dc326a3dde..723d1eb02e0 100644
--- a/library/std/build.rs
+++ b/library/std/build.rs
@@ -109,3 +109,2 @@ fn main() {
("loongarch64", _) => false,
- ("mips" | "mips64" | "mips32r6" | "mips64r6", _) => false,
("powerpc" | "powerpc64", _) => false,Disclaimer: I only tested on the MIPS hardware that happens to be available to me, and can't say anything about other MIPS hardware. Disclaimer: I didn't run tests that depend on conformant NaNs due to MIPS having non-conformat NaNs. In particular I skipped these tests: |
|
That's great news! Feel free to put up PRs to make those changes and
If those tests rely on |
In #136324 the doctest for
f16::erf()was gated withreliable_f16_math. Add the same gate onf16::erfc()to avoid:on MIPS (and maybe other architectures).
r? tgross35