diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2021-03-17 01:44:35 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-17 01:44:35 +0000 |
| commit | a1e151e8389c983196ae62027174151861f980f7 (patch) | |
| tree | 8dfbaf6be866d6b90fb45b2403252d622c195a59 /library/stdarch/crates/std_detect/src | |
| parent | 7accc8256962a1ae326c423e66c377a53dd5a8cd (diff) | |
| download | rust-a1e151e8389c983196ae62027174151861f980f7.tar.gz rust-a1e151e8389c983196ae62027174151861f980f7.zip | |
Convert all uses of llvm_asm! to asm! (#1052)
Diffstat (limited to 'library/stdarch/crates/std_detect/src')
| -rw-r--r-- | library/stdarch/crates/std_detect/src/detect/os/aarch64.rs | 18 | ||||
| -rw-r--r-- | library/stdarch/crates/std_detect/src/lib.rs | 2 |
2 files changed, 16 insertions, 4 deletions
diff --git a/library/stdarch/crates/std_detect/src/detect/os/aarch64.rs b/library/stdarch/crates/std_detect/src/detect/os/aarch64.rs index c95b6889701..2f289f58074 100644 --- a/library/stdarch/crates/std_detect/src/detect/os/aarch64.rs +++ b/library/stdarch/crates/std_detect/src/detect/os/aarch64.rs @@ -34,7 +34,11 @@ pub(crate) fn detect_features() -> cache::Initializer { // ID_AA64ISAR0_EL1 - Instruction Set Attribute Register 0 let aa64isar0: u64; unsafe { - llvm_asm!("mrs $0, ID_AA64ISAR0_EL1" : "=r"(aa64isar0)); + asm!( + "mrs {}, ID_AA64ISAR0_EL1", + out(reg) aa64isar0, + options(pure, nomem, preserves_flags, nostack) + ); } let aes = bits_shift(aa64isar0, 7, 4) >= 1; @@ -51,7 +55,11 @@ pub(crate) fn detect_features() -> cache::Initializer { // ID_AA64PFR0_EL1 - Processor Feature Register 0 let aa64pfr0: u64; unsafe { - llvm_asm!("mrs $0, ID_AA64PFR0_EL1" : "=r"(aa64pfr0)); + asm!( + "mrs {}, ID_AA64PFR0_EL1", + out(reg) aa64pfr0, + options(pure, nomem, preserves_flags, nostack) + ); } let fp = bits_shift(aa64pfr0, 19, 16) < 0xF; @@ -74,7 +82,11 @@ pub(crate) fn detect_features() -> cache::Initializer { // ID_AA64ISAR1_EL1 - Instruction Set Attribute Register 1 let aa64isar1: u64; unsafe { - llvm_asm!("mrs $0, ID_AA64ISAR1_EL1" : "=r"(aa64isar1)); + asm!( + "mrs {}, ID_AA64ISAR1_EL1", + out(reg) aa64isar1, + options(pure, nomem, preserves_flags, nostack) + ); } enable_feature(Feature::rcpc, bits_shift(aa64isar1, 23, 20) >= 1); diff --git a/library/stdarch/crates/std_detect/src/lib.rs b/library/stdarch/crates/std_detect/src/lib.rs index 46cf8fb68d6..b051be5c0a5 100644 --- a/library/stdarch/crates/std_detect/src/lib.rs +++ b/library/stdarch/crates/std_detect/src/lib.rs @@ -15,7 +15,7 @@ #![feature(const_fn, staged_api, stdsimd, doc_cfg, allow_internal_unstable)] #![allow(clippy::shadow_reuse)] #![deny(clippy::missing_inline_in_public_items)] -#![cfg_attr(all(target_os = "freebsd", target_arch = "aarch64"), feature(llvm_asm))] +#![cfg_attr(all(target_os = "freebsd", target_arch = "aarch64"), feature(asm))] #![cfg_attr(test, allow(unused_imports))] #![cfg_attr(feature = "std_detect_file_io", feature(vec_spare_capacity))] #![no_std] |
