Skip to content

Consider adding load/store atomics for targets that don't support compare and swap #45085

Closed
@parched

Description

@parched

Some targets, Armv6-M for example, don't support atomic compare and swap so have "max-atomic-width" set to 0 in their target specs. Often you just need to AtomicUsize::load and AtomicUsize::store and none of the other CAS dependent methods but unfortunately it's not supported by rust even if that targets natively support it.

We could add another field to the target spec, "max-atomic-load-store-width", that defaults to the same value as "max-atomic-width", for determining whether to enable Atomic* without the CAS dependent methods.

cc @japaric who probably would like this for https://github.com/japaric/spscrb

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions