Skip to content

Commit

Permalink
Update to stabilized Arm64EC asm
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Nov 11, 2024
1 parent c9d7286 commit 3a85789
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This crate provides a way to soundly perform such operations.

## Platform Support

Currently, x86, x86_64, Arm, AArch64, RISC-V, LoongArch64, s390x, Arm64EC, MIPS, PowerPC, MSP430, AVR, SPARC, Hexagon, M68k, and Xtensa are supported.
Currently, x86, x86_64, Arm, AArch64, RISC-V, LoongArch64, Arm64EC, s390x, MIPS, PowerPC, MSP430, AVR, SPARC, Hexagon, M68k, and Xtensa are supported.

| target_arch | primitives | load/store | swap/CAS |
| ------------------------------- | --------------------------------------------------- |:----------:|:--------:|
Expand All @@ -31,8 +31,8 @@ Currently, x86, x86_64, Arm, AArch64, RISC-V, LoongArch64, s390x, Arm64EC, MIPS,
| riscv32 | isize,usize,i8,u8,i16,u16,i32,u32 ||\[1] |
| riscv64 | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64 ||\[1] |
| loongarch64 \[6] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64 |||
| arm64ec \[7] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64,i128,u128 |||
| s390x \[7] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64,i128,u128 |||
| arm64ec \[8] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64,i128,u128 |||
| mips / mips32r6 \[8] | isize,usize,i8,u8,i16,u16,i32,u32 |||
| mips64 / mips64r6 \[8] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64 |||
| powerpc \[8] | isize,usize,i8,u8,i16,u16,i32,u32 |||
Expand Down
10 changes: 5 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ fn main() {
println!("cargo:rustc-cfg=atomic_maybe_uninit_no_asm");
}
}
"s390x" => {
// asm! on s390x stabilized in Rust 1.84 (nightly-2024-11-11): /~https://github.com/rust-lang/rust/pull/131258
"arm64ec" | "s390x" => {
// asm! on Arm64EC and s390x stabilized in Rust 1.84 (nightly-2024-11-11): /~https://github.com/rust-lang/rust/pull/131781, /~https://github.com/rust-lang/rust/pull/131258
if !version.probe(84, 2024, 11, 10) {
if version.nightly
&& version.probe(77, 2024, 1, 4)
&& (target_arch != "s390x" || version.probe(77, 2024, 1, 4))
&& is_allowed_feature("asm_experimental_arch")
{
// /~https://github.com/rust-lang/rust/pull/119431 merged in Rust 1.77 (nightly-2024-01-05).
Expand All @@ -106,8 +106,8 @@ fn main() {
}
}
}
"arm64ec" | "avr" | "hexagon" | "m68k" | "mips" | "mips32r6" | "mips64" | "mips64r6"
| "msp430" | "powerpc" | "powerpc64" | "xtensa" => {
"avr" | "hexagon" | "m68k" | "mips" | "mips32r6" | "mips64" | "mips64r6" | "msp430"
| "powerpc" | "powerpc64" | "xtensa" => {
if version.nightly && is_allowed_feature("asm_experimental_arch") {
println!("cargo:rustc-cfg=atomic_maybe_uninit_unstable_asm_experimental_arch");
}
Expand Down
8 changes: 2 additions & 6 deletions src/arch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
target_arch = "riscv32",
target_arch = "riscv64",
target_arch = "loongarch64",
all(target_arch = "s390x", not(atomic_maybe_uninit_no_asm)),
all(any(target_arch = "arm64ec", target_arch = "s390x"), not(atomic_maybe_uninit_no_asm)),
all(
any(
target_arch = "arm64ec",
target_arch = "avr",
target_arch = "hexagon",
target_arch = "m68k",
Expand Down Expand Up @@ -57,10 +56,7 @@
#[path = "cfgs/unsupported.rs"]
mod unsupported;

#[cfg(any(
target_arch = "aarch64",
all(target_arch = "arm64ec", atomic_maybe_uninit_unstable_asm_experimental_arch),
))]
#[cfg(any(target_arch = "aarch64", all(target_arch = "arm64ec", not(atomic_maybe_uninit_no_asm))))]
mod aarch64;
#[cfg(target_arch = "arm")]
#[cfg(all(
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This crate provides a way to soundly perform such operations.
## Platform Support
Currently, x86, x86_64, Arm, AArch64, RISC-V, LoongArch64, s390x, Arm64EC, MIPS, PowerPC, MSP430, AVR, SPARC, Hexagon, M68k, and Xtensa are supported.
Currently, x86, x86_64, Arm, AArch64, RISC-V, LoongArch64, Arm64EC, s390x, MIPS, PowerPC, MSP430, AVR, SPARC, Hexagon, M68k, and Xtensa are supported.
| target_arch | primitives | load/store | swap/CAS |
| ------------------------------- | --------------------------------------------------- |:----------:|:--------:|
Expand All @@ -25,8 +25,8 @@ Currently, x86, x86_64, Arm, AArch64, RISC-V, LoongArch64, s390x, Arm64EC, MIPS,
| riscv32 | isize,usize,i8,u8,i16,u16,i32,u32 | ✓ | ✓\[1] |
| riscv64 | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64 | ✓ | ✓\[1] |
| loongarch64 \[6] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64 | ✓ | ✓ |
| arm64ec \[7] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64,i128,u128 | ✓ | ✓ |
| s390x \[7] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64,i128,u128 | ✓ | ✓ |
| arm64ec \[8] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64,i128,u128 | ✓ | ✓ |
| mips / mips32r6 \[8] | isize,usize,i8,u8,i16,u16,i32,u32 | ✓ | ✓ |
| mips64 / mips64r6 \[8] | isize,usize,i8,u8,i16,u16,i32,u32,i64,u64 | ✓ | ✓ |
| powerpc \[8] | isize,usize,i8,u8,i16,u16,i32,u32 | ✓ | ✓ |
Expand Down

0 comments on commit 3a85789

Please sign in to comment.