-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add force-soft-floats
feature to prevent using any intrinsics or arch-specific code
#297
Conversation
src/math/ceil.rs
Outdated
@@ -12,7 +12,7 @@ pub fn ceil(x: f64) -> f64 { | |||
// `f64.ceil` native instruction, so we can leverage this for both code size | |||
// and speed. | |||
llvm_intrinsically_optimized! { | |||
#[cfg(target_arch = "wasm32")] { | |||
#[cfg(all(target_arch = "wasm32", not(feature = "only-soft-floats")))] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be done in the llvm_intrinsically_optimized!
macro definition instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this cfg
(target_arch = wasm32
) is always used in this macro call, so might as well move it directly into it, good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I meant the not(feature = "only-soft-floats")
bit, but I don't have strong feelings either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually what I meant too. ^^'
230107d
to
1c78a77
Compare
Applied suggestion! |
1c78a77
to
ac39e6a
Compare
And even fixed CI. :) |
Cargo.toml
Outdated
@@ -23,6 +23,9 @@ unstable = [] | |||
# musl libc. | |||
musl-reference-tests = ['rand'] | |||
|
|||
# Used to prevent using any intrinsics or arch-specific code. | |||
only-soft-floats = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename this to force-soft-float
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
only-soft-floats
feature to prevent using any intrinsics or arch-specific codeforce-soft-floats
feature to prevent using any intrinsics or arch-specific code
Thanks! The next step is to update the libm submodule in compiler-builtins and ensure the feature is enabled. |
Gonna send a PR in a few hours. |
It comes from this zulip discussion which is blocking the last GCC backend sync with rustc.
cc @Amanieu