-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Tracking Issue for Wasm floating point instructions not in core
#133908
Comments
core
I would like to have these available on stable as soon as reasonably possible. Of course having them available in |
Bump `stdarch` This bumps `stdarch` to rust-lang/stdarch@684de0d to get in rust-lang/stdarch#1677 (tracked in rust-lang#133908). From the [commit history](rust-lang/stdarch@e5e00aa...684de0d) I deduced that there shouldn't be any changes to Rust necessary. From past PRs I'm assuming that bumping `stdarch` like this is fine, but please let me know if this is somehow inappropriate or requires something more to be done!
Bump `stdarch` This bumps `stdarch` to rust-lang/stdarch@684de0d to get in rust-lang/stdarch#1677 (tracked in rust-lang#133908). From the [commit history](rust-lang/stdarch@e5e00aa...684de0d) I deduced that there shouldn't be any changes to Rust necessary. From past PRs I'm assuming that bumping `stdarch` like this is fine, but please let me know if this is somehow inappropriate or requires something more to be done! try-job: arm-android
Bump `stdarch` This bumps `stdarch` to rust-lang/stdarch@684de0d to get in rust-lang/stdarch#1677 (tracked in rust-lang#133908). From the [commit history](rust-lang/stdarch@e5e00aa...684de0d) I deduced that there shouldn't be any changes to Rust necessary. From past PRs I'm assuming that bumping `stdarch` like this is fine, but please let me know if this is somehow inappropriate or requires something more to be done! try-job: arm-android try-job: armhf-gnu
Bump `stdarch` This bumps `stdarch` to rust-lang/stdarch@684de0d to get in rust-lang/stdarch#1677 (tracked in rust-lang/rust#133908). From the [commit history](rust-lang/stdarch@e5e00aa...684de0d) I deduced that there shouldn't be any changes to Rust necessary. From past PRs I'm assuming that bumping `stdarch` like this is fine, but please let me know if this is somehow inappropriate or requires something more to be done! try-job: arm-android try-job: armhf-gnu
Hereby requesting an FCP. Stabilization PR: rust-lang/stdarch#1700. @rustbot label +I-libs-api-nominated |
@tgross35 pointed out in Zulip that bringing these functions to |
Note that the implementation of these functions in libm now uses the |
👍 from me, although I'm not in a position to appropriately weigh the concerns of duplicating float methods in |
We discussed this in the libs-api meeting. We would like to wait for float methods in core to make some progress before deciding whether this is worth stabilizing independently. |
Just to address this - as long as we keep these
I actually would rather have the inline assembly version, but am unsure about its stability. Using the intrinsics or the methods in There shouldn't be an optimization problem either because for trivial routines (abs, copysign, platforms with sqrt, etc), LLVM lowers the intrinsic directly to its own assembly which can be optimized. For any other math ops that are intrinsics ( |
Oh, I meant the other way around: I assumed the implementations in
Are you talking about the immediate implementation of e.g. |
E.g. https://rust.godbolt.org/z/az9b1acE6, you can see that the initial |
In general inline asm is intended to be a "black box":
For wasm in particular, runtime code patching is not possible and separate tools like Binaryen's |
Not quite; pub fn sqrtf(x: f32) -> f32 {
unsafe { core::intrinsics::f32(x) }
} Which is what we effectively have on wasm. On wasm this is currently okay but we generally don't want to think about how LLVM will lower intrinsics. We should direct everyone using
That is correct. On WASM it should always get an asm lowering, but we probably shouldn't rely on this.
|
I can't speak for others but the second biggest reason (after Of course I can't expect you or anyone else to maintain a library perfectly suited for what I need. But if "libm as included via compiler_builtins" could benefit from some |
Feature gate:
#![feature(wasm_numeric_instr)]
This is a tracking issue for floating point instructions that aren't available in
core
but are available as simple instructions on Wasm directly.Public API
Steps / History
core
stdarch#1677Unresolved Questions
My impression from #50145 was that these methods (except
sqrt()
) are not intended to ever be added tocore
. But looking at a recent discussion in Zulip it paints a different picture.If indeed these methods are intended to come to
core
, then these additions will probably never be stabilized.Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: