Skip to content

APFloat incorrectly generates signaling NaNs on MIPS #60796

Open

Description

@Muon

The signaling bit convention on MIPS is opposite that of x86 and ARM, but APFloat doesn't know that. As a result, constant folding to a NaN erroneously produces a signaling NaN instead of a quiet NaN on MIPS: https://godbolt.org/z/TP5hePhWP

Activity

  1. llvmbot commented on Feb 16, 2023

    @llvmbot
    Member

    @llvm/issue-subscribers-backend-mips

  2. RalfJung commented on Jul 19, 2023

    @RalfJung
    Contributor

    The signaling bit convention on MIPS

    From what I understand, this is true for some MIPS chips, but other more recent chips actually make this runtime-configurable. For those chips it is impossible to know at compiletime which NaN needs to be produced to get a quiet NaN, isn't it?

  3. wzssyqa commented on Aug 28, 2023

    @wzssyqa
    Contributor

    For MIPSr2/r3/r5, we have an option -mnan=2008/legacy to swtich it.
    For r6, 2008 is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions