Skip to content

Stop optimizing under the assumption of default denormal behavior #123123

Open
@DemiMarie

Description

@DemiMarie

On some platforms (QNX on Arm comes to mind, but there are probably others) flush-to-zero and denormals-are-zero are turned on by default and cannot be disabled. Furthermore, PipeWire turns on FTZ and DAZ because it is the only way to get realtime behavior (otherwise, denormals are handled by microcode assists or traps that are far too slow).

Right now, this means that one cannot use Rust for realtime code that performs floating point operations, which I think is silly. Instead, I think Rust should treat compile-time operations on floating-point numbers as partial functions. When a denormal or NaN is hit, Rust should defer the operation until runtime, when the actual behavior is known.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-floating-pointArea: Floating point numbers and arithmeticC-discussionCategory: Discussion or questions that doesn't represent real issues.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions