#
std_detect/detect/arch/
aarch64.rs

    1//! Aarch64 run-time features.
    2
    3features! {
    4    @TARGET: aarch64;
    5    @CFG: any(target_arch = "aarch64", target_arch = "arm64ec");
    6    @MACRO_NAME: is_aarch64_feature_detected;
    7    @MACRO_ATTRS:
    8    /// This macro tests, at runtime, whether an `aarch64` feature is enabled on aarch64 platforms.
    9    /// Currently most features are only supported on linux-based platforms.
    10    ///
    11    /// This macro takes one argument which is a string literal of the feature being tested for.
    12    /// The feature names are mostly taken from their FEAT_* definitions in the [ARM Architecture
    13    /// Reference Manual][docs].
    14    ///
    15    /// ## Supported arguments
    16    ///
    17    /// * `"aes"` - FEAT_AES & FEAT_PMULL
    18    /// * `"asimd"` or "neon" - FEAT_AdvSIMD
    19    /// * `"bf16"` - FEAT_BF16
    20    /// * `"bti"` - FEAT_BTI
    21    /// * `"crc"` - FEAT_CRC
    22    /// * `"cssc"` - FEAT_CSSC
    23    /// * `"dit"` - FEAT_DIT
    24    /// * `"dotprod"` - FEAT_DotProd
    25    /// * `"dpb"` - FEAT_DPB
    26    /// * `"dpb2"` - FEAT_DPB2
    27    /// * `"ecv"` - FEAT_ECV
    28    /// * `"f32mm"` - FEAT_F32MM
    29    /// * `"f64mm"` - FEAT_F64MM
    30    /// * `"faminmax"` - FEAT_FAMINMAX
    31    /// * `"fcma"` - FEAT_FCMA
    32    /// * `"fhm"` - FEAT_FHM
    33    /// * `"flagm"` - FEAT_FLAGM
    34    /// * `"flagm2"` - FEAT_FLAGM2
    35    /// * `"fp"` - FEAT_FP
    36    /// * `"fp16"` - FEAT_FP16
    37    /// * `"fp8"` - FEAT_FP8
    38    /// * `"fp8dot2"` - FEAT_FP8DOT2
    39    /// * `"fp8dot4"` - FEAT_FP8DOT4
    40    /// * `"fp8fma"` - FEAT_FP8FMA
    41    /// * `"fpmr"` - FEAT_FPMR
    42    /// * `"frintts"` - FEAT_FRINTTS
    43    /// * `"hbc"` - FEAT_HBC
    44    /// * `"i8mm"` - FEAT_I8MM
    45    /// * `"jsconv"` - FEAT_JSCVT
    46    /// * `"lse"` - FEAT_LSE
    47    /// * `"lse128"` - FEAT_LSE128
    48    /// * `"lse2"` - FEAT_LSE2
    49    /// * `"lut"` - FEAT_LUT
    50    /// * `"mops"` - FEAT_MOPS
    51    /// * `"mte"` - FEAT_MTE & FEAT_MTE2
    52    /// * `"paca"` - FEAT_PAuth (address authentication)
    53    /// * `"pacg"` - FEAT_Pauth (generic authentication)
    54    /// * `"pauth-lr"` - FEAT_PAuth_LR
    55    /// * `"pmull"` - FEAT_PMULL
    56    /// * `"rand"` - FEAT_RNG
    57    /// * `"rcpc"` - FEAT_LRCPC
    58    /// * `"rcpc2"` - FEAT_LRCPC2
    59    /// * `"rcpc3"` - FEAT_LRCPC3
    60    /// * `"rdm"` - FEAT_RDM
    61    /// * `"sb"` - FEAT_SB
    62    /// * `"sha2"` - FEAT_SHA1 & FEAT_SHA256
    63    /// * `"sha3"` - FEAT_SHA512 & FEAT_SHA3
    64    /// * `"sm4"` - FEAT_SM3 & FEAT_SM4
    65    /// * `"sme"` - FEAT_SME
    66    /// * `"sme-b16b16"` - FEAT_SME_B16B16
    67    /// * `"sme-f16f16"` - FEAT_SME_F16F16
    68    /// * `"sme-f64f64"` - FEAT_SME_F64F64
    69    /// * `"sme-f8f16"` - FEAT_SME_F8F16
    70    /// * `"sme-f8f32"` - FEAT_SME_F8F32
    71    /// * `"sme-fa64"` - FEAT_SME_FA64
    72    /// * `"sme-i16i64"` - FEAT_SME_I16I64
    73    /// * `"sme-lutv2"` - FEAT_SME_LUTv2
    74    /// * `"sme2"` - FEAT_SME2
    75    /// * `"sme2p1"` - FEAT_SME2p1
    76    /// * `"ssbs"` - FEAT_SSBS & FEAT_SSBS2
    77    /// * `"ssve-fp8dot2"` - FEAT_SSVE_FP8DOT2
    78    /// * `"ssve-fp8dot4"` - FEAT_SSVE_FP8DOT4
    79    /// * `"ssve-fp8fma"` - FEAT_SSVE_FP8FMA
    80    /// * `"sve"` - FEAT_SVE
    81    /// * `"sve-b16b16"` - FEAT_SVE_B16B16 (SVE or SME Z-targeting instructions)
    82    /// * `"sve2"` - FEAT_SVE2
    83    /// * `"sve2-aes"` - FEAT_SVE_AES & FEAT_SVE_PMULL128 (SVE2 AES crypto)
    84    /// * `"sve2-bitperm"` - FEAT_SVE2_BitPerm
    85    /// * `"sve2-sha3"` - FEAT_SVE2_SHA3
    86    /// * `"sve2-sm4"` - FEAT_SVE2_SM4
    87    /// * `"sve2p1"` - FEAT_SVE2p1
    88    /// * `"tme"` - FEAT_TME
    89    /// * `"wfxt"` - FEAT_WFxT
    90    ///
    91    /// [docs]: https://developer.arm.com/documentation/ddi0487/latest
    92    #[stable(feature = "simd_aarch64", since = "1.60.0")]
    93    @BIND_FEATURE_NAME: "asimd"; "neon";
    94    @NO_RUNTIME_DETECTION: "ras";
    95    @NO_RUNTIME_DETECTION: "v8.1a";
    96    @NO_RUNTIME_DETECTION: "v8.2a";
    97    @NO_RUNTIME_DETECTION: "v8.3a";
    98    @NO_RUNTIME_DETECTION: "v8.4a";
    99    @NO_RUNTIME_DETECTION: "v8.5a";
    100    @NO_RUNTIME_DETECTION: "v8.6a";
    101    @NO_RUNTIME_DETECTION: "v8.7a";
    102    @NO_RUNTIME_DETECTION: "v8.8a";
    103    @NO_RUNTIME_DETECTION: "v8.9a";
    104    @NO_RUNTIME_DETECTION: "v9.1a";
    105    @NO_RUNTIME_DETECTION: "v9.2a";
    106    @NO_RUNTIME_DETECTION: "v9.3a";
    107    @NO_RUNTIME_DETECTION: "v9.4a";
    108    @NO_RUNTIME_DETECTION: "v9.5a";
    109    @NO_RUNTIME_DETECTION: "v9a";
    110    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] asimd: "neon";
    111    /// FEAT_AdvSIMD (Advanced SIMD/NEON)
    112    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] pmull: "pmull";
    113    implied by target_features: ["aes"];
    114    /// FEAT_PMULL (Polynomial Multiply) - Implied by `aes` target_feature
    115    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] fp: "fp";
    116    implied by target_features: ["neon"];
    117    /// FEAT_FP (Floating point support) - Implied by `neon` target_feature
    118    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] aes: "aes";
    119    /// FEAT_AES (AES SIMD instructions) & FEAT_PMULL (PMULL{2}, 64-bit operand variants)
    120    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] bf16: "bf16";
    121    /// FEAT_BF16 (BFloat16 type, plus MM instructions, plus ASIMD support)
    122    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] bti: "bti";
    123    /// FEAT_BTI (Branch Target Identification)
    124    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] crc: "crc";
    125    /// FEAT_CRC32 (Cyclic Redundancy Check)
    126    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] cssc: "cssc";
    127    /// FEAT_CSSC (Common Short Sequence Compression instructions)
    128    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] dit: "dit";
    129    /// FEAT_DIT (Data Independent Timing instructions)
    130    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] dpb: "dpb";
    131    /// FEAT_DPB (aka dcpop - data cache clean to point of persistence)
    132    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] dpb2: "dpb2";
    133    /// FEAT_DPB2 (aka dcpodp - data cache clean to point of deep persistence)
    134    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] dotprod: "dotprod";
    135    /// FEAT_DotProd (Vector Dot-Product - ASIMDDP)
    136    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] ecv: "ecv";
    137    /// FEAT_ECV (Enhanced Counter Virtualization)
    138    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] f32mm: "f32mm";
    139    /// FEAT_F32MM (single-precision matrix multiplication)
    140    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] f64mm: "f64mm";
    141    /// FEAT_F64MM (double-precision matrix multiplication)
    142    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] faminmax: "faminmax";
    143    /// FEAT_FAMINMAX (FAMIN and FAMAX SIMD/SVE/SME instructions)
    144    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] fcma: "fcma";
    145    /// FEAT_FCMA (float complex number operations)
    146    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] fhm: "fhm";
    147    /// FEAT_FHM (fp16 multiplication instructions)
    148    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] flagm: "flagm";
    149    /// FEAT_FLAGM (flag manipulation instructions)
    150    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] flagm2: "flagm2";
    151    /// FEAT_FLAGM2 (flag manipulation instructions)
    152    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] fp16: "fp16";
    153    /// FEAT_FP16 (Half-float support)
    154    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] fp8: "fp8";
    155    /// FEAT_FP8 (F8CVT Instructions)
    156    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] fp8dot2: "fp8dot2";
    157    /// FEAT_FP8DOT2 (F8DP2 Instructions)
    158    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] fp8dot4: "fp8dot4";
    159    /// FEAT_FP8DOT4 (F8DP4 Instructions)
    160    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] fp8fma: "fp8fma";
    161    /// FEAT_FP8FMA (F8FMA Instructions)
    162    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] fpmr: "fpmr";
    163    without cfg check: true;
    164    /// FEAT_FPMR (Special-purpose AArch64-FPMR register)
    165    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] frintts: "frintts";
    166    /// FEAT_FRINTTS (float to integer rounding instructions)
    167    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] hbc: "hbc";
    168    /// FEAT_HBC (Hinted conditional branches)
    169    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] i8mm: "i8mm";
    170    /// FEAT_I8MM (integer matrix multiplication, plus ASIMD support)
    171    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] jsconv: "jsconv";
    172    /// FEAT_JSCVT (JavaScript float conversion instructions)
    173    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] lse: "lse";
    174    /// FEAT_LSE (Large System Extension - atomics)
    175    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] lse128: "lse128";
    176    /// FEAT_LSE128 (128-bit atomics)
    177    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] lse2: "lse2";
    178    /// FEAT_LSE2 (unaligned and register-pair atomics)
    179    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] lut: "lut";
    180    /// FEAT_LUT (Lookup Table Instructions)
    181    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] mops: "mops";
    182    /// FEAT_MOPS (Standardization of memory operations)
    183    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] mte: "mte";
    184    /// FEAT_MTE & FEAT_MTE2 (Memory Tagging Extension)
    185    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] paca: "paca";
    186    /// FEAT_PAuth (address authentication)
    187    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] pacg: "pacg";
    188    /// FEAT_PAuth (generic authentication)
    189    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] pauth_lr: "pauth-lr";
    190    /// FEAT_PAuth_LR
    191    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] rand: "rand";
    192    /// FEAT_RNG (Random Number Generator)
    193    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] rcpc: "rcpc";
    194    /// FEAT_LRCPC (Release consistent Processor consistent)
    195    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] rcpc2: "rcpc2";
    196    /// FEAT_LRCPC2 (RCPC with immediate offsets)
    197    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] rcpc3: "rcpc3";
    198    /// FEAT_LRCPC3 (RCPC Instructions v3)
    199    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] rdm: "rdm";
    200    /// FEAT_RDM (Rounding Doubling Multiply - ASIMDRDM)
    201    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] sb: "sb";
    202    /// FEAT_SB (speculation barrier)
    203    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] sha2: "sha2";
    204    /// FEAT_SHA1 & FEAT_SHA256 (SHA1 & SHA2-256 instructions)
    205    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] sha3: "sha3";
    206    /// FEAT_SHA512 & FEAT_SHA3 (SHA2-512 & SHA3 instructions)
    207    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] sm4: "sm4";
    208    /// FEAT_SM3 & FEAT_SM4 (SM3 & SM4 instructions)
    209    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme: "sme";
    210    /// FEAT_SME (Scalable Matrix Extension)
    211    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme2: "sme2";
    212    /// FEAT_SME2 (SME Version 2)
    213    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme2p1: "sme2p1";
    214    /// FEAT_SME2p1 (SME Version 2.1)
    215    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme_b16b16: "sme-b16b16";
    216    /// FEAT_SME_B16B16
    217    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme_f16f16: "sme-f16f16";
    218    /// FEAT_SME_F16F16 (Non-widening half-precision FP16 to FP16 arithmetic for SME2)
    219    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme_f64f64: "sme-f64f64";
    220    /// FEAT_SME_F64F64 (Double-precision floating-point outer product instructions)
    221    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme_f8f16: "sme-f8f16";
    222    /// FEAT_SME_F8F16
    223    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme_f8f32: "sme-f8f32";
    224    /// FEAT_SME_F8F32
    225    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme_fa64: "sme-fa64";
    226    /// FEAT_SME_FA64 (Full A64 instruction set support in Streaming SVE mode)
    227    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme_i16i64: "sme-i16i64";
    228    /// FEAT_SME_I16I64 (16-bit to 64-bit integer widening outer product instructions)
    229    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sme_lutv2: "sme-lutv2";
    230    /// FEAT_SME_LUTv2 (LUTI4 Instruction)
    231    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] ssbs: "ssbs";
    232    /// FEAT_SSBS & FEAT_SSBS2 (speculative store bypass safe)
    233    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] ssve_fp8dot2: "ssve-fp8dot2";
    234    /// FEAT_SSVE_FP8DOT2
    235    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] ssve_fp8dot4: "ssve-fp8dot4";
    236    /// FEAT_SSVE_FP8DOT4
    237    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] ssve_fp8fma: "ssve-fp8fma";
    238    /// FEAT_SSVE_FP8FMA
    239    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] sve: "sve";
    240    /// FEAT_SVE (Scalable Vector Extension)
    241    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] sve2: "sve2";
    242    /// FEAT_SVE2 (Scalable Vector Extension 2)
    243    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sve2p1: "sve2p1";
    244    /// FEAT_SVE2p1 (Scalable Vector Extension 2.1)
    245    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] sve2_aes: "sve2-aes";
    246    /// FEAT_SVE_AES & FEAT_SVE_PMULL128 (SVE2 AES crypto)
    247    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] sve_b16b16: "sve-b16b16";
    248    /// FEAT_SVE_B16B16 (SVE or SME Z-targeting instructions)
    249    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] sve2_bitperm: "sve2-bitperm";
    250    /// FEAT_SVE_BitPerm (SVE2 bit permutation instructions)
    251    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] sve2_sha3: "sve2-sha3";
    252    /// FEAT_SVE_SHA3 (SVE2 SHA3 crypto)
    253    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] sve2_sm4: "sve2-sm4";
    254    /// FEAT_SVE_SM4 (SVE2 SM4 crypto)
    255    @FEATURE: #[stable(feature = "simd_aarch64", since = "1.60.0")] tme: "tme";
    256    /// FEAT_TME (Transactional Memory Extensions)
    257    @FEATURE: #[unstable(feature = "stdarch_aarch64_feature_detection", issue = "127764")] wfxt: "wfxt";
    258    /// FEAT_WFxT (WFET and WFIT Instructions)
    259}