55//!
66//! [arm_ref]: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0073a/IHI0073A_arm_neon_intrinsics_ref.pdf
77//! [arm_dat]: https://developer.arm.com/technologies/neon/intrinsics
8- #![ allow( non_camel_case_types) ]
98
109mod armclang;
11-
1210pub use self :: armclang:: * ;
1311
1412mod v6;
1513pub use self :: v6:: * ;
1614
17- #[ cfg( any( target_arch = "aarch64" , target_feature = "v7" ) ) ]
18- mod v7;
19- #[ cfg( any( target_arch = "aarch64" , target_feature = "v7" ) ) ]
20- pub use self :: v7:: * ;
15+ // Supported arches: 6, 7-M. See Section 10.1 of ACLE (e.g. SSAT)
16+ #[ cfg( any( target_feature = "v6" , doc) ) ]
17+ mod sat;
18+
19+ #[ cfg( any( target_feature = "v6" , doc) ) ]
20+ pub use self :: sat:: * ;
21+
22+ // Supported arches: 5TE, 7E-M. See Section 10.1 of ACLE (e.g. QADD)
23+ // We also include the A profile even though DSP is deprecated on that profile as of ACLE 2.0 (see
24+ // section 5.4.7)
25+ // Here we workaround the difference between LLVM's +dsp and ACLE's __ARM_FEATURE_DSP by gating on
26+ // '+v5te' rather than on '+dsp'
27+ #[ cfg( any(
28+ // >= v5TE but excludes v7-M
29+ all( target_feature = "v5te" , not( target_feature = "mclass" ) ) ,
30+ // v7E-M
31+ all( target_feature = "mclass" , target_feature = "dsp" ) ,
32+ doc,
33+ ) ) ]
34+ pub mod dsp;
35+
36+ #[ cfg( any(
37+ // >= v5TE but excludes v7-M
38+ all( target_feature = "v5te" , not( target_feature = "mclass" ) ) ,
39+ // v7E-M
40+ all( target_feature = "mclass" , target_feature = "dsp" ) ,
41+ doc,
42+ ) ) ]
43+ pub use self :: dsp:: * ;
44+
45+ // Deprecated in ACLE 2.0 for the A profile but fully supported on the M and R profiles, says
46+ // Section 5.4.9 of ACLE. We'll expose these for the A profile even if deprecated
47+ #[ cfg( any(
48+ // v7-A, v7-R
49+ all( target_feature = "v6" , not( target_feature = "mclass" ) ) ,
50+ // v7E-M
51+ all( target_feature = "mclass" , target_feature = "dsp" ) ,
52+ doc,
53+ ) ) ]
54+ mod simd32;
2155
22- #[ cfg( any( target_arch = "aarch64" , target_feature = "v7" , doc) ) ]
23- mod neon;
24- #[ cfg( any( target_arch = "aarch64" , target_feature = "v7" , doc) ) ]
25- pub use self :: neon:: * ;
56+ #[ cfg( any(
57+ // v7-A, v7-R
58+ all( target_feature = "v6" , not( target_feature = "mclass" ) ) ,
59+ // v7E-M
60+ all( target_feature = "mclass" , target_feature = "dsp" ) ,
61+ doc,
62+ ) ) ]
63+ pub use self :: simd32:: * ;
2664
27- #[ cfg( any( target_arch = "aarch64" , target_feature = "v7" ) ) ]
28- mod crc ;
29- #[ cfg( any( target_arch = "aarch64" , target_feature = "v7" ) ) ]
30- pub use self :: crc :: * ;
65+ #[ cfg( any( target_feature = "v7" , doc ) ) ]
66+ mod v7 ;
67+ #[ cfg( any( target_feature = "v7" , doc ) ) ]
68+ pub use self :: v7 :: * ;
3169
32- #[ cfg( any( target_arch = "aarch64" , target_feature = "v7" ) ) ]
33- mod crypto;
34- #[ cfg( any( target_arch = "aarch64" , target_feature = "v7" ) ) ]
35- pub use self :: crypto:: * ;
70+ mod ex;
71+ pub use self :: ex:: * ;
3672
37- pub use crate :: core_arch:: acle :: * ;
73+ pub use crate :: core_arch:: arm_shared :: * ;
3874
3975#[ cfg( test) ]
4076use stdarch_test:: assert_instr;
4177
78+ #[ cfg( any( target_feature = "v7" , doc) ) ]
79+ pub ( crate ) mod neon;
80+ #[ cfg( any( target_feature = "v7" , doc) ) ]
81+ pub use neon:: * ;
82+
4283/// Generates the trap instruction `UDF`
4384#[ cfg( target_arch = "arm" ) ]
4485#[ cfg_attr( test, assert_instr( udf) ) ]
@@ -47,6 +88,26 @@ pub unsafe fn udf() -> ! {
4788 crate :: intrinsics:: abort ( )
4889}
4990
50- #[ cfg( test) ]
51- #[ cfg( any( target_arch = "aarch64" , target_feature = "v7" ) ) ]
52- pub ( crate ) mod test_support;
91+ /// Generates a DBG instruction.
92+ ///
93+ /// This provides a hint to debugging and related systems. The argument must be
94+ /// a constant integer from 0 to 15 inclusive. See implementation documentation
95+ /// for the effect (if any) of this instruction and the meaning of the
96+ /// argument. This is available only when compliling for AArch32.
97+ // Section 10.1 of ACLE says that the supported arches are: 7, 7-M
98+ // "The DBG hint instruction is added in ARMv7. It is UNDEFINED in the ARMv6 base architecture, and
99+ // executes as a NOP instruction in ARMv6K and ARMv6T2." - ARM Architecture Reference Manual ARMv7-A
100+ // and ARMv7-R edition (ARM DDI 0406C.c) sections D12.4.1 "ARM instruction set support" and D12.4.2
101+ // "Thumb instruction set support"
102+ #[ cfg( any( target_feature = "v7" , doc) ) ]
103+ #[ inline( always) ]
104+ #[ rustc_legacy_const_generics( 0 ) ]
105+ pub unsafe fn __dbg < const IMM4 : i32 > ( ) {
106+ static_assert_imm4 ! ( IMM4 ) ;
107+ dbg ( IMM4 ) ;
108+ }
109+
110+ extern "C" {
111+ #[ link_name = "llvm.arm.dbg" ]
112+ fn dbg ( _: i32 ) ;
113+ }
0 commit comments