Skip to content

[clang] builtin __cxx_atomic_fetch_add should support all floating point types #68602

Open
@huixie90

Description

@huixie90

This issues came up in implementing P0020R6 Floating Point Atomic for libc++
#67799

Basically we are trying to use __cxx_atomic_fetch_add for implementing atomic RMW operations. However, this function would error on some platforms for long double if the representation is x87 fp80 format. On the library (libc++) side, there is no way for us to tell if the function __cxx_atomic_fetch_add is going to error on the current platform or not.

The builtin should handle this properly: generates FADD IR for platforms that support it, and fallback to the compare-exchange loop on the platforms that don't

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorclang:headersHeaders provided by Clang, e.g. for intrinsics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions