Skip to content

apfloat bug: incorrect handling of infinities in FMA #100233

Closed
@RalfJung

Description

@RalfJung

The Rust port of LLVM's apfloat has a bug in its FMA (fused-multiply-add) implementation. See rust-lang/miri#2468 (comment) for details, but basically it fails this assertion:

    let neg_inf: f32 = f32::NEG_INFINITY;
    assert_eq!((-3.2f32).mul_add(2.4, neg_inf), neg_inf);

AFAIK we don't use apfloat FMA anywhere (Miri stopped using them to work around this bug), but this should still be tracked, and will need to be fixed before we can allow FMA in const.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-floating-pointArea: Floating point numbers and arithmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions