Skip to content

cranelift: Disable NaN Canonicalization for RISC-V #7322

@afonso360

Description

@afonso360

👋 Hey,

In RISC-V almost all floating point instructions return a canonical NaN when its result would be a NaN. In cranelift we have a separate pass that includes some NaN normalization code when the enable_nan_canonicalization flag is enabled. RISC-V's canonical NaN pattern is also defined to be the same as WASM's canonical NaN.

This isn't really required for RISC-V and just causes additional overhead, so it would be nice if we could disable it. This thought occurred to me while reading #7321 which might make that easier by querying each backend and applying those legalization rules conditionally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions