Skip to content

Wrong intrinsics for GCC in atomic/atomic.h #32

@leafi

Description

@leafi

When PSNIP_ATOMIC_IMPL is equal to PSNIP_ATOMIC_IMPL_GCC, the wrong intrinsics are used for the _int64_add & _int64_sub implementations.

In https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html , you can see these intrinsics exist:

__atomic_add_fetch
__atomic_sub_fetch

__atomic_fetch_add
__atomic_fetch_sub

To be consistent with the other implementations of psnip_atomic_int64_add and psnip_atomic_int64_sub, we want to fetch and then add or subtract. However, the intrinsics used in PSNIP_ATOMIC_IMPL_GCC do things in the opposite "order".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions