-
Notifications
You must be signed in to change notification settings - Fork 13.3k
.min and .floor operations for f64 types are non-functional on MIPS #34906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Output of
Contradiction with the issue title. Moreover |
I suspect this is due to a mismatch of float ABI (Tessel's OpenWrt uses soft float, while Rust's mipsel-unknown-linux-gnu default target uses hard float). The following program succeeded on Tessel 2 with a custom target.json. I rebuilt libstd using that target, using a compiler-rt built with the GCC from the OpenWrt build system. fn main() {
let test_val: f64 = 546.54;
assert_eq!(test_val.floor(), 546.0);
assert_eq!(test_val.min(0.0), 0.0);
println!("ok");
} So this isn't really a rust-lang/rust bug, beyond a 👍 for something like RFC 1133 that makes it easier to use customized target options. |
@kevinmehall Note that you are mixing different ABIs here: The OpenWRT toolchain is using uclibc and the Rust target ( (Thought most of the problems you observed are likely caused by the float ABI mismatch.) |
Thanks for the investigation @kevinmehall! Sounds like this is expected from ABI differences, so I'm going to close. |
Thanks @nagisa for pointing out the syntax/functional issues with my example. I've updated for posterity's sake. Thanks @kevinmehall for investigating the ABI. |
I'm building Rust code for Tessel 2 using some instructions created by @badboy here.
Simple scripts compiled on the Rust playground and my personal computer work fine but fail for different reasons on Tessel (which has a MIPS architecture).
Let me know if there are any other details I can provide to help debug!
The text was updated successfully, but these errors were encountered: