1//! Run-time feature detection on LoongArch.
2
3features! {
4 @TARGET: loongarch;
5 @CFG: any(target_arch = "loongarch32", target_arch = "loongarch64");
6 @MACRO_NAME: is_loongarch_feature_detected;
7 @MACRO_ATTRS:
8 /// Check for the presence of a CPU feature at runtime.
9 ///
10 /// When the feature is known to be enabled at compile time (e.g. via `-Ctarget-feature`)
11 /// the macro expands to `true`.
12 ///
13 /// Supported arguments are:
14 ///
15 /// * `"32s"`
16 /// * `"f"`
17 /// * `"d"`
18 /// * `"frecipe"`
19 /// * `"div32"`
20 /// * `"lsx"`
21 /// * `"lasx"`
22 /// * `"lam-bh"`
23 /// * `"lamcas"`
24 /// * `"ld-seq-sa"`
25 /// * `"scq"`
26 /// * `"lbt"`
27 /// * `"lvz"`
28 /// * `"ual"`
29 #[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")]
30 @FEATURE: #[unstable(feature = "stdarch_loongarch_feature_detection", issue = "117425")] _32s: "32s";
31 /// 32S
32 @FEATURE: #[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")] f: "f";
33 /// F
34 @FEATURE: #[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")] d: "d";
35 /// D
36 @FEATURE: #[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")] frecipe: "frecipe";
37 /// Frecipe
38 @FEATURE: #[unstable(feature = "stdarch_loongarch_feature_detection", issue = "117425")] div32: "div32";
39 /// Div32
40 @FEATURE: #[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")] lsx: "lsx";
41 /// LSX
42 @FEATURE: #[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")] lasx: "lasx";
43 /// LASX
44 @FEATURE: #[unstable(feature = "stdarch_loongarch_feature_detection", issue = "117425")] lam_bh: "lam-bh";
45 /// LAM-BH
46 @FEATURE: #[unstable(feature = "stdarch_loongarch_feature_detection", issue = "117425")] lamcas: "lamcas";
47 /// LAM-CAS
48 @FEATURE: #[unstable(feature = "stdarch_loongarch_feature_detection", issue = "117425")] ld_seq_sa: "ld-seq-sa";
49 /// LD-SEQ-SA
50 @FEATURE: #[unstable(feature = "stdarch_loongarch_feature_detection", issue = "117425")] scq: "scq";
51 /// SCQ
52 @FEATURE: #[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")] lbt: "lbt";
53 /// LBT
54 @FEATURE: #[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")] lvz: "lvz";
55 /// LVZ
56 @FEATURE: #[unstable(feature = "stdarch_loongarch_feature_detection", issue = "117425")] ual: "ual";
57 /// UAL
58}
59