Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
est31 opened this issue Sep 20, 2020 · 2 comments
Closed

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

est31 opened this issue Sep 20, 2020 · 2 comments

Comments

@est31
Copy link
Member

est31 commented Sep 20, 2020

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

@carbotaniuman
Copy link
Contributor

I'm not the person who put the gate in, but I think it's because all the Mac versions we support mandate it, whereas some Windows versions (7?) can get by without it.

@est31
Copy link
Member Author

est31 commented Sep 20, 2020

Hmm yeah. See 04835ea . It's explained here. Case rested.

@est31 est31 closed this as completed Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants