Skip to content

Does Cranelift honour the requirement of WebAssembly that NaN results of most float ops must be arithmetic? #8967

@primoly

Description

@primoly

NaNs in IEEE floats are encoded just like infinities, except that at least one of the mantissa bits is set to one. Wasm NaNs in results of float ops (except fabs, fneg and fcopysign) have the additional requirement that the most significant bit of the mantissa must be one (arithmetic NaN). Is this actually honoured by Cranelift codegen? If NaNs are always canonicalised then this is guaranteed (as the canonical NaN is also an arithmetic one), but if NaNs are simply propagated then this could be an issue.

https://webassembly.github.io/spec/core/exec/numerics.html#nan-propagation
https://webassembly.github.io/spec/core/syntax/values.html#syntax-float
https://webassembly.github.io/spec/core/syntax/values.html#arithmetic-nan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions