rust-lang / rust-lang/rust

Tracking Issue for Wasm floating point instructions not in `core`

Open
#133,908 13 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-tracking-issue T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

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
mod arch {
    mod wasm32 {
        pub fn f32_ceil(a: f32) -> f32;
        pub fn f32_floor(a: f32) -> f32;
        pub fn f32_trunc(a: f32) -> f32;
        pub fn f32_nearest(a: f32) -> f32;
        pub fn f32_sqrt(a: f32) -> f32;
        pub fn f64_ceil(a: f64) -> f64;
        pub fn f64_floor(a: f64) -> f64;
        pub fn f64_trunc(a: f64) -> f64;
        pub fn f64_nearest(a: f64) -> f64;
        pub fn f64_sqrt(a: f64) -> f64;
    }
}
Steps / History
Unresolved Questions

My impression from https://github.com/rust-lang/rust/issues/50145 was that these methods (except sqrt()) are not intended to ever be added to core. 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the feature gate wasm_numeric_instr and the implementation in stdarch PR 1677. Resolve whether these floating-point methods belong in core by reviewing rust-lang/rust#50145 and the linked Zulip discussion, then determine whether the remaining FCP and stabilization steps can proceed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.