Skip to content

RISC-V and NaNs #646

@sunfishcode

Description

@sunfishcode

RISC-V is a new ISA with interesting potential. Overall, it looks like it should support WebAssembly very well. The following are two concerns regarding its handling of NaNs:

  • RISC-V defines its hardware-generated NaN values as all-ones. This differs from ARM, MIPS (in IEEE 754-2008 mode, which wasm already requires), Power, and x86, and could significantly complicate NaN boxing on wasm. I've posted to the RISC-V isa-dev forum asking whether it's feasible to change RISC-V to be compatible, as a first step.
  • IEEE 754-2008 makes exemptions to its usual NaN propagation rules for min, max, and conversions. RISC-V takes advantage of these exemptions. The current wasm design does not currently have these exemptions, but they are in IEEE 754-2008, and could be added to wasm without significant practical cost, so we should consider them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions