Skip to content

Commit 213aaa9

Browse files
committed
Move __dbg intrinsic to 'arm' (from arm_shared)
1 parent 8794cae commit 213aaa9

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

crates/core_arch/src/arm/mod.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,27 @@ pub(crate) mod neon;
7979
pub use neon::*;
8080

8181
/// Generates the trap instruction `UDF`
82-
#[cfg(target_arch = "arm")]
8382
#[cfg_attr(test, assert_instr(udf))]
8483
#[inline]
8584
pub unsafe fn udf() -> ! {
8685
crate::intrinsics::abort()
8786
}
87+
88+
/// Generates a DBG instruction.
89+
///
90+
/// This provides a hint to debugging and related systems. The argument must be
91+
/// a constant integer from 0 to 15 inclusive. See implementation documentation
92+
/// for the effect (if any) of this instruction and the meaning of the
93+
/// argument. This is available only when compliling for AArch32.
94+
// Section 10.1 of ACLE says that the supported arches are: 7, 7-M
95+
// "The DBG hint instruction is added in ARMv7. It is UNDEFINED in the ARMv6 base architecture, and
96+
// executes as a NOP instruction in ARMv6K and ARMv6T2." - ARM Architecture Reference Manual ARMv7-A
97+
// and ARMv7-R edition (ARM DDI 0406C.c) sections D12.4.1 "ARM instruction set support" and D12.4.2
98+
// "Thumb instruction set support"
99+
#[cfg(any(target_feature = "v7", doc))]
100+
#[inline(always)]
101+
#[rustc_legacy_const_generics(0)]
102+
pub unsafe fn __dbg<const IMM4: i32>() {
103+
static_assert_imm4!(IMM4);
104+
dbg(IMM4);
105+
}

crates/core_arch/src/arm_shared/hints.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,27 +69,6 @@ pub unsafe fn __yield() {
6969
hint(HINT_YIELD);
7070
}
7171

72-
/// Generates a DBG instruction.
73-
///
74-
/// This provides a hint to debugging and related systems. The argument must be
75-
/// a constant integer from 0 to 15 inclusive. See implementation documentation
76-
/// for the effect (if any) of this instruction and the meaning of the
77-
/// argument. This is available only when compliling for AArch32.
78-
// Section 10.1 of ACLE says that the supported arches are: 7, 7-M
79-
// "The DBG hint instruction is added in ARMv7. It is UNDEFINED in the ARMv6 base architecture, and
80-
// executes as a NOP instruction in ARMv6K and ARMv6T2." - ARM Architecture Reference Manual ARMv7-A
81-
// and ARMv7-R edition (ARM DDI 0406C.c) sections D12.4.1 "ARM instruction set support" and D12.4.2
82-
// "Thumb instruction set support"
83-
#[cfg(target_feature = "v7")]
84-
#[cfg(any(target_arch = "arm", doc))]
85-
#[doc(cfg(target_arch = "arm"))]
86-
#[inline(always)]
87-
#[rustc_legacy_const_generics(0)]
88-
pub unsafe fn __dbg<const IMM4: i32>() {
89-
static_assert_imm4!(IMM4);
90-
dbg(IMM4);
91-
}
92-
9372
/// Generates an unspecified no-op instruction.
9473
///
9574
/// Note that not all architectures provide a distinguished NOP instruction. On

crates/stdarch-verify/tests/arm.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ fn verify_all_signatures() {
448448
"vpadalq_u8",
449449
"vpadalq_u16",
450450
"vpadalq_u32",
451+
"__dbg",
451452
];
452453
if !skip.contains(&rust.name) {
453454
println!(
@@ -479,6 +480,7 @@ fn verify_all_signatures() {
479480
"vreinterpret_p64_s64",
480481
"vreinterpret_f32_p64",
481482
"vreinterpretq_f32_p64",
483+
"__dbg",
482484
];
483485
let arm = match map.get(rust.name) {
484486
Some(i) => i,

0 commit comments

Comments
 (0)