Skip to content
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

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

GuillaumeGomez
Copy link
Member

It comes from this zulip discussion which is blocking the last GCC backend sync with rustc.

cc @Amanieu

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")))] {
Copy link
Member

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?

Copy link
Member Author

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!

Copy link
Member

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.

Copy link
Member Author

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. ^^'

@GuillaumeGomez
Copy link
Member Author

Applied suggestion!

@GuillaumeGomez
Copy link
Member Author

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 = []
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@GuillaumeGomez GuillaumeGomez changed the title Add only-soft-floats feature to prevent using any intrinsics or arch-specific code Add force-soft-floats feature to prevent using any intrinsics or arch-specific code Aug 7, 2024
@Amanieu Amanieu merged commit 300edb3 into rust-lang:master Aug 8, 2024
12 checks passed
@Amanieu
Copy link
Member

Amanieu commented Aug 8, 2024

Thanks! The next step is to update the libm submodule in compiler-builtins and ensure the feature is enabled.

@GuillaumeGomez GuillaumeGomez deleted the only-soft-floats branch August 8, 2024 10:28
@GuillaumeGomez
Copy link
Member Author

Gonna send a PR in a few hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants