Skip to content

Why does only x86_64_apple_darwin have max_atomic_width set to 128? #76952

Closed
@est31

Description

@est31

CI failure of #76866 brought this to my attention. This grep shows what confuses me:

$ rg max_atomic_width | rg 128
compiler/rustc_target/src/spec/aarch64_linux_android.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/aarch64_unknown_none.rs:        max_atomic_width: Some(128),
compiler/rustc_target/src/spec/aarch64_unknown_linux_musl.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/aarch64_apple_ios.rs:            max_atomic_width: Some(128),
compiler/rustc_target/src/spec/aarch64_unknown_netbsd.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/aarch64_apple_darwin.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/x86_64_apple_darwin.rs:    base.max_atomic_width = Some(128); // core2 support cmpxchg16b
compiler/rustc_target/src/spec/aarch64_unknown_none_softfloat.rs:        max_atomic_width: Some(128),
compiler/rustc_target/src/spec/aarch64_unknown_freebsd.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/aarch64_unknown_linux_gnu.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/aarch64_apple_tvos.rs:            max_atomic_width: Some(128),
compiler/rustc_target/src/spec/aarch64_unknown_hermit.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/aarch64_unknown_cloudabi.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/aarch64_wrs_vxworks.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/aarch64_unknown_openbsd.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/aarch64_unknown_redox.rs:    base.max_atomic_width = Some(128);
compiler/rustc_target/src/spec/aarch64_fuchsia.rs:    base.max_atomic_width = Some(128);

Why is the apple OS the only OS which allows 128 bit wide atomics, but the other x86_64 based OSs don't support it?

cc @Amanieu @gnzlbg @shepmaster

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions