Skip to content

Commit

Permalink
Update arm/aarch64-related comments
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jul 19, 2024
1 parent 3a3965d commit 8a3181c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/imp/arm_linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ where
// This is not single-copy atomic reads, but this is ok because subsequent
// CAS will check for consistency.
//
// ARM's memory model allow mixed-sized atomic access.
// https://github.com/rust-lang/unsafe-code-guidelines/issues/345#issuecomment-1172891466
//
// Note that the C++20 memory model does not allow mixed-sized atomic access,
// so we must use inline assembly to implement byte_wise_atomic_load.
// (i.e., byte-wise atomic based on the standard library's atomic types
Expand Down
4 changes: 2 additions & 2 deletions src/imp/atomic128/detect/aarch64_aa64reg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ fn _detect(info: &mut CpuInfo) {
info.set(CpuInfo::HAS_RCPC3);
}
}
// OpenBSD has an API to get this, but currently always returns 0.
// https://github.com/openbsd/src/blob/6a233889798dc3ecb18acc52dce1e57862af2957/sys/arch/arm64/arm64/machdep.c#L371-L377
// OpenBSD has an API to get AA64MMFR2, but currently always returns 0.
// https://github.com/openbsd/src/blob/1847475460684e4251d673e6b1bceb1b38e699c3/sys/arch/arm64/arm64/machdep.c#L367
#[cfg_attr(target_os = "openbsd", cfg(test))]
{
// ID_AA64MMFR2_EL1, AArch64 Memory Model Feature Register 2
Expand Down
3 changes: 2 additions & 1 deletion src/imp/atomic128/detect/aarch64_macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
// This module is currently only enabled on tests because aarch64 macOS always supports FEAT_LSE and FEAT_LSE2.
// https://github.com/llvm/llvm-project/blob/llvmorg-18.1.2/llvm/include/llvm/TargetParser/AArch64TargetParser.h#L728
//
// If macOS supporting Armv9.4-a becomes popular in the future, this module will
// If macOS supporting FEAT_LSE128/FEAT_LRCPC3 becomes popular in the future, this module will
// be used to support outline-atomics for FEAT_LSE128/FEAT_LRCPC3.
// M4 is armv9.4-a but I don't know if it supports FEAT_LSE128/FEAT_LRCPC3.
//
// Refs: https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics
//
Expand Down

0 comments on commit 8a3181c

Please sign in to comment.