Rollup merge of #112150 - taiki-e:apple-atomic-128, r=Amanieu

Support 128-bit atomics on all x86_64 Apple targets

On x86_64, we currently set `max_atomic_width` to 128 only on macOS.

ad8304a0d5/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs (L8)

However, other x86_64 Apple targets (iOS, tvOS, and watchOS) are also core2+ and support cmpxchg16b.

ad8304a0d5/compiler/rustc_target/src/spec/apple_base.rs (L71-L76)

```console
# Script to get targets that support cmpxchg16b by default:
$ (for target in $(rustc --print target-list); do [[ $target == "x86_64"* ]] && rustc --print cfg --target "$target" | grep -q cmpxchg16b && echo "$target"; done)
x86_64-apple-darwin
x86_64-apple-ios
x86_64-apple-ios-macabi
x86_64-apple-tvos
x86_64-apple-watchos-sim
x86_64h-apple-darwin
```

r? `@Amanieu`
This commit is contained in:
Michael Goulet 2023-06-01 23:07:38 -07:00 committed by GitHub
commit fc557576a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@ pub fn target() -> Target {
.into(),
arch: arch.target_arch(),
options: TargetOptions {
max_atomic_width: Some(64),
max_atomic_width: Some(128),
stack_probes: StackProbeType::X86,
..base
},

View file

@ -15,7 +15,7 @@ pub fn target() -> Target {
.into(),
arch: arch.target_arch(),
options: TargetOptions {
max_atomic_width: Some(64),
max_atomic_width: Some(128),
stack_probes: StackProbeType::X86,
..base
},

View file

@ -9,7 +9,7 @@ pub fn target() -> Target {
data_layout: "e-m:o-i64:64-f80:128-n8:16:32:64-S128".into(),
arch: arch.target_arch(),
options: TargetOptions {
max_atomic_width: Some(64),
max_atomic_width: Some(128),
stack_probes: StackProbeType::X86,
..opts("tvos", arch)
},

View file

@ -10,7 +10,7 @@ pub fn target() -> Target {
.into(),
arch: arch.target_arch(),
options: TargetOptions {
max_atomic_width: Some(64),
max_atomic_width: Some(128),
stack_probes: StackProbeType::X86,
forces_embed_bitcode: true,
// Taken from a clang build on Xcode 11.4.1.