-
Notifications
You must be signed in to change notification settings - Fork 213
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
target-feature=+soft-float breaks things #374
Comments
Could go either way. On one hand the SSE hardware is guaranteed to exist on x86_64, on the other hand it could be disabled (such as is the case during very early boot). Doubt that's an useful enough use-case to support and spend time on though. |
I suppose In any case, silently producing wrong results is very bad™. Not sure how to turn this into an error though, or even what part would be responsible for producing that error. Looks like the fn main() {
assert_eq!(a(1234), 1234.0);
}
#[inline(never)]
fn a(x: u32) -> f32 {
x as f32
}
So this is probably a |
Agreed. Interestingly, just copying in the It would be interesting to see if this still happens when doing The solution is to probably just ban
That's the only use I've seen on x86_64, but virtually all Rust OS kernels set this flag, including https://github.com/cloud-hypervisor/rust-hypervisor-firmware. So I agree that |
A crate compiled on
x86_64
with-Ctarget-feature=+soft-float
will use floating point conversions fromcompiler-builtins
. However, some of the floating point conversions incompiler-builtins
are implemented using floating point instructions. This breaks when enabling the+soft-float
target-feature. Should+soft-float
be supported? Or should this have given an error? Right now, it silently gives wrong results:https://godbolt.org/z/9zvecP
The text was updated successfully, but these errors were encountered: