Skip to main content

target_features/database/
generated.rs

1// This file is @generated.
2
3use super::FeatureData;
4use crate::TargetFeatures;
5
6#[cfg(target_arch = "arm")]
7pub(crate) const FEATURE_WORDS: usize = 1;
8#[cfg(target_arch = "aarch64")]
9pub(crate) const FEATURE_WORDS: usize = 2;
10#[cfg(target_arch = "arm64ec")]
11pub(crate) const FEATURE_WORDS: usize = 2;
12#[cfg(target_arch = "bpf")]
13pub(crate) const FEATURE_WORDS: usize = 1;
14#[cfg(target_arch = "hexagon")]
15pub(crate) const FEATURE_WORDS: usize = 1;
16#[cfg(target_arch = "mips")]
17pub(crate) const FEATURE_WORDS: usize = 1;
18#[cfg(target_arch = "mips64")]
19pub(crate) const FEATURE_WORDS: usize = 1;
20#[cfg(target_arch = "loongarch32")]
21pub(crate) const FEATURE_WORDS: usize = 1;
22#[cfg(target_arch = "loongarch64")]
23pub(crate) const FEATURE_WORDS: usize = 1;
24#[cfg(target_arch = "nvptx64")]
25pub(crate) const FEATURE_WORDS: usize = 1;
26#[cfg(target_arch = "powerpc")]
27pub(crate) const FEATURE_WORDS: usize = 1;
28#[cfg(target_arch = "powerpc64")]
29pub(crate) const FEATURE_WORDS: usize = 1;
30#[cfg(target_arch = "riscv32")]
31pub(crate) const FEATURE_WORDS: usize = 2;
32#[cfg(target_arch = "riscv64")]
33pub(crate) const FEATURE_WORDS: usize = 2;
34#[cfg(target_arch = "s390x")]
35pub(crate) const FEATURE_WORDS: usize = 1;
36#[cfg(target_arch = "sparc")]
37pub(crate) const FEATURE_WORDS: usize = 1;
38#[cfg(target_arch = "sparc64")]
39pub(crate) const FEATURE_WORDS: usize = 1;
40#[cfg(target_arch = "wasm32")]
41pub(crate) const FEATURE_WORDS: usize = 1;
42#[cfg(target_arch = "wasm64")]
43pub(crate) const FEATURE_WORDS: usize = 1;
44#[cfg(target_arch = "x86")]
45pub(crate) const FEATURE_WORDS: usize = 2;
46#[cfg(target_arch = "x86_64")]
47pub(crate) const FEATURE_WORDS: usize = 2;
48
49#[cfg(not(any(
50    target_arch = "arm",
51    target_arch = "aarch64",
52    target_arch = "arm64ec",
53    target_arch = "bpf",
54    target_arch = "hexagon",
55    target_arch = "mips",
56    target_arch = "mips64",
57    target_arch = "loongarch32",
58    target_arch = "loongarch64",
59    target_arch = "nvptx64",
60    target_arch = "powerpc",
61    target_arch = "powerpc64",
62    target_arch = "riscv32",
63    target_arch = "riscv64",
64    target_arch = "s390x",
65    target_arch = "sparc",
66    target_arch = "sparc64",
67    target_arch = "wasm32",
68    target_arch = "wasm64",
69    target_arch = "x86",
70    target_arch = "x86_64",
71)))]
72pub(crate) const FEATURE_WORDS: usize = 0;
73
74#[cfg(any(doc, target_arch = "arm"))]
75#[rustfmt::skip]
76pub mod arm {
77    use super::*;
78
79    #[repr(u16)]
80    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
81    enum FeatureId {
82        ACLASS,
83        ACQUIRE_RELEASE,
84        AES,
85        CRC,
86        CRT_STATIC,
87        D32,
88        DOTPROD,
89        DSP,
90        FP_ARMV8,
91        FP16,
92        FP64,
93        FPREGS,
94        I8MM,
95        MCLASS,
96        MVE,
97        MVE_FP,
98        NEON,
99        RCLASS,
100        SHA2,
101        SOFT_FLOAT,
102        THUMB_MODE,
103        THUMB2,
104        TRUSTZONE,
105        V5TE,
106        V6,
107        V6K,
108        V6M,
109        V6T2,
110        V7,
111        V8,
112        V8_1M_MAIN,
113        V8M,
114        V8M_MAIN,
115        VFP2,
116        VFP2SP,
117        VFP3,
118        VFP4,
119        VIRTUALIZATION,
120    }
121
122    macro_rules! feature_set {
123        ($($feature:ident),* $(,)?) => { {
124            #[cfg(target_arch = "arm")]
125            {
126                let features = TargetFeatures::empty();
127                $(let features = features.with_bit(FeatureId::$feature as usize);)*
128                features
129            }
130            #[cfg(all(doc, not(target_arch = "arm")))]
131            {
132                TargetFeatures::empty()
133            }
134        } };
135    }
136    #[doc = "Is application profile ('A' series)."]
137    pub const ACLASS: TargetFeatures = feature_set!(ACLASS);
138
139    #[doc = "Has v8 acquire/release (lda/ldaex  etc) instructions."]
140    pub const ACQUIRE_RELEASE: TargetFeatures = feature_set!(ACQUIRE_RELEASE);
141
142    #[doc = "Enable AES support."]
143    pub const AES: TargetFeatures = feature_set!(AES, D32, FP64, FPREGS, NEON, VFP2, VFP2SP, VFP3);
144
145    #[doc = "Enable support for CRC instructions."]
146    pub const CRC: TargetFeatures = feature_set!(CRC);
147
148    #[doc = "Enables C Run-time Libraries to be statically linked."]
149    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
150
151    #[doc = "Extend FP to 32 double registers."]
152    pub const D32: TargetFeatures = feature_set!(D32);
153
154    #[doc = "Enable support for dot product instructions."]
155    pub const DOTPROD: TargetFeatures = feature_set!(D32, DOTPROD, FP64, FPREGS, NEON, VFP2, VFP2SP, VFP3);
156
157    #[doc = "Supports DSP instructions in ARM and/or Thumb2."]
158    pub const DSP: TargetFeatures = feature_set!(DSP);
159
160    #[doc = "Enable ARMv8 FP."]
161    pub const FP_ARMV8: TargetFeatures = feature_set!(D32, FP_ARMV8, FP64, FPREGS, VFP2, VFP2SP, VFP3, VFP4);
162
163    #[doc = "Enable full half-precision floating point."]
164    pub const FP16: TargetFeatures = feature_set!(D32, FP16, FP64, FPREGS, NEON, VFP2, VFP2SP, VFP3);
165
166    #[doc = "Floating point unit supports double precision."]
167    pub const FP64: TargetFeatures = feature_set!(FP64);
168
169    #[doc = "Enable FP registers."]
170    pub const FPREGS: TargetFeatures = feature_set!(FPREGS);
171
172    #[doc = "Enable Matrix Multiply Int8 Extension."]
173    pub const I8MM: TargetFeatures = feature_set!(D32, FP64, FPREGS, I8MM, NEON, VFP2, VFP2SP, VFP3);
174
175    #[doc = "Is microcontroller profile ('M' series)."]
176    pub const MCLASS: TargetFeatures = feature_set!(MCLASS);
177
178    #[doc = "Support M-Class Vector Extension with integer ops."]
179    pub const MVE: TargetFeatures = feature_set!(DSP, FPREGS, MVE, THUMB2, V5TE, V6, V6K, V6M, V6T2, V7, V8_1M_MAIN, V8M, V8M_MAIN);
180
181    #[doc = "Support M-Class Vector Extension with integer and floating ops."]
182    pub const MVE_FP: TargetFeatures = feature_set!(DSP, FPREGS, MVE, MVE_FP, THUMB2, V5TE, V6, V6K, V6M, V6T2, V7, V8_1M_MAIN, V8M, V8M_MAIN);
183
184    #[doc = "Enable NEON instructions."]
185    pub const NEON: TargetFeatures = feature_set!(D32, FP64, FPREGS, NEON, VFP2, VFP2SP, VFP3);
186
187    #[doc = "Is realtime profile ('R' series)."]
188    pub const RCLASS: TargetFeatures = feature_set!(RCLASS);
189
190    #[doc = "Enable SHA1 and SHA256 support."]
191    pub const SHA2: TargetFeatures = feature_set!(D32, FP64, FPREGS, NEON, SHA2, VFP2, VFP2SP, VFP3);
192
193    #[doc = "Use software floating point features.."]
194    pub const SOFT_FLOAT: TargetFeatures = feature_set!(SOFT_FLOAT);
195
196    #[doc = "Thumb mode."]
197    pub const THUMB_MODE: TargetFeatures = feature_set!(THUMB_MODE);
198
199    #[doc = "Enable Thumb2 instructions."]
200    pub const THUMB2: TargetFeatures = feature_set!(THUMB2);
201
202    #[doc = "Enable support for TrustZone security extensions."]
203    pub const TRUSTZONE: TargetFeatures = feature_set!(TRUSTZONE);
204
205    #[doc = "Support ARM v5TE, v5TEj, and v5TExp instructions."]
206    pub const V5TE: TargetFeatures = feature_set!(V5TE);
207
208    #[doc = "Support ARM v6 instructions."]
209    pub const V6: TargetFeatures = feature_set!(V5TE, V6);
210
211    #[doc = "Support ARM v6k instructions."]
212    pub const V6K: TargetFeatures = feature_set!(V5TE, V6, V6K);
213
214    #[doc = "Support ARM v6M instructions."]
215    pub const V6M: TargetFeatures = feature_set!(V5TE, V6, V6M);
216
217    #[doc = "Support ARM v6t2 instructions."]
218    pub const V6T2: TargetFeatures = feature_set!(THUMB2, V5TE, V6, V6K, V6M, V6T2, V8M);
219
220    #[doc = "Support ARM v7 instructions."]
221    pub const V7: TargetFeatures = feature_set!(THUMB2, V5TE, V6, V6K, V6M, V6T2, V7, V8M);
222
223    #[doc = "Support ARM v8 instructions."]
224    pub const V8: TargetFeatures = feature_set!(ACQUIRE_RELEASE, THUMB2, V5TE, V6, V6K, V6M, V6T2, V7, V8, V8M);
225
226    #[doc = "Support ARM v8-1M Mainline instructions."]
227    pub const V8_1M_MAIN: TargetFeatures = feature_set!(THUMB2, V5TE, V6, V6K, V6M, V6T2, V7, V8_1M_MAIN, V8M, V8M_MAIN);
228
229    #[doc = "Support ARM v8M Baseline instructions."]
230    pub const V8M: TargetFeatures = feature_set!(V5TE, V6, V6M, V8M);
231
232    #[doc = "Support ARM v8M Mainline instructions."]
233    pub const V8M_MAIN: TargetFeatures = feature_set!(THUMB2, V5TE, V6, V6K, V6M, V6T2, V7, V8M, V8M_MAIN);
234
235    #[doc = "Enable VFP2 instructions."]
236    pub const VFP2: TargetFeatures = feature_set!(FP64, FPREGS, VFP2, VFP2SP);
237
238    #[doc = "Enable VFP2 instructions with no double precision."]
239    pub const VFP2SP: TargetFeatures = feature_set!(FPREGS, VFP2SP);
240
241    #[doc = "Enable VFP3 instructions."]
242    pub const VFP3: TargetFeatures = feature_set!(D32, FP64, FPREGS, VFP2, VFP2SP, VFP3);
243
244    #[doc = "Enable VFP4 instructions."]
245    pub const VFP4: TargetFeatures = feature_set!(D32, FP64, FPREGS, VFP2, VFP2SP, VFP3, VFP4);
246
247    #[doc = "Supports Virtualization extension."]
248    pub const VIRTUALIZATION: TargetFeatures = feature_set!(VIRTUALIZATION);
249
250
251    #[cfg(target_arch = "arm")]
252    pub(crate) const FEATURES: &[FeatureData] = &[
253        FeatureData::new("aclass", ACLASS),
254        FeatureData::new("acquire-release", ACQUIRE_RELEASE),
255        FeatureData::new("aes", AES),
256        FeatureData::new("crc", CRC),
257        FeatureData::new("crt-static", CRT_STATIC),
258        FeatureData::new("d32", D32),
259        FeatureData::new("dotprod", DOTPROD),
260        FeatureData::new("dsp", DSP),
261        FeatureData::new("fp-armv8", FP_ARMV8),
262        FeatureData::new("fp16", FP16),
263        FeatureData::new("fp64", FP64),
264        FeatureData::new("fpregs", FPREGS),
265        FeatureData::new("i8mm", I8MM),
266        FeatureData::new("mclass", MCLASS),
267        FeatureData::new("mve", MVE),
268        FeatureData::new("mve.fp", MVE_FP),
269        FeatureData::new("neon", NEON),
270        FeatureData::new("rclass", RCLASS),
271        FeatureData::new("sha2", SHA2),
272        FeatureData::new("soft-float", SOFT_FLOAT),
273        FeatureData::new("thumb-mode", THUMB_MODE),
274        FeatureData::new("thumb2", THUMB2),
275        FeatureData::new("trustzone", TRUSTZONE),
276        FeatureData::new("v5te", V5TE),
277        FeatureData::new("v6", V6),
278        FeatureData::new("v6k", V6K),
279        FeatureData::new("v6m", V6M),
280        FeatureData::new("v6t2", V6T2),
281        FeatureData::new("v7", V7),
282        FeatureData::new("v8", V8),
283        FeatureData::new("v8.1m.main", V8_1M_MAIN),
284        FeatureData::new("v8m", V8M),
285        FeatureData::new("v8m.main", V8M_MAIN),
286        FeatureData::new("vfp2", VFP2),
287        FeatureData::new("vfp2sp", VFP2SP),
288        FeatureData::new("vfp3", VFP3),
289        FeatureData::new("vfp4", VFP4),
290        FeatureData::new("virtualization", VIRTUALIZATION),
291    ];
292
293    #[cfg(target_arch = "arm")]
294    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
295    pub(crate) const fn enabled_for_target() -> TargetFeatures {
296        let features = TargetFeatures::empty();
297        #[cfg(target_feature = "aclass")]
298        let features = features.with(ACLASS);
299        #[cfg(target_feature = "acquire-release")]
300        let features = features.with(ACQUIRE_RELEASE);
301        #[cfg(target_feature = "aes")]
302        let features = features.with(AES);
303        #[cfg(target_feature = "crc")]
304        let features = features.with(CRC);
305        #[cfg(target_feature = "crt-static")]
306        let features = features.with(CRT_STATIC);
307        #[cfg(target_feature = "d32")]
308        let features = features.with(D32);
309        #[cfg(target_feature = "dotprod")]
310        let features = features.with(DOTPROD);
311        #[cfg(target_feature = "dsp")]
312        let features = features.with(DSP);
313        #[cfg(target_feature = "fp-armv8")]
314        let features = features.with(FP_ARMV8);
315        #[cfg(target_feature = "fp16")]
316        let features = features.with(FP16);
317        #[cfg(target_feature = "fp64")]
318        let features = features.with(FP64);
319        #[cfg(target_feature = "fpregs")]
320        let features = features.with(FPREGS);
321        #[cfg(target_feature = "i8mm")]
322        let features = features.with(I8MM);
323        #[cfg(target_feature = "mclass")]
324        let features = features.with(MCLASS);
325        #[cfg(target_feature = "mve")]
326        let features = features.with(MVE);
327        #[cfg(target_feature = "mve.fp")]
328        let features = features.with(MVE_FP);
329        #[cfg(target_feature = "neon")]
330        let features = features.with(NEON);
331        #[cfg(target_feature = "rclass")]
332        let features = features.with(RCLASS);
333        #[cfg(target_feature = "sha2")]
334        let features = features.with(SHA2);
335        #[cfg(target_feature = "soft-float")]
336        let features = features.with(SOFT_FLOAT);
337        #[cfg(target_feature = "thumb-mode")]
338        let features = features.with(THUMB_MODE);
339        #[cfg(target_feature = "thumb2")]
340        let features = features.with(THUMB2);
341        #[cfg(target_feature = "trustzone")]
342        let features = features.with(TRUSTZONE);
343        #[cfg(target_feature = "v5te")]
344        let features = features.with(V5TE);
345        #[cfg(target_feature = "v6")]
346        let features = features.with(V6);
347        #[cfg(target_feature = "v6k")]
348        let features = features.with(V6K);
349        #[cfg(target_feature = "v6m")]
350        let features = features.with(V6M);
351        #[cfg(target_feature = "v6t2")]
352        let features = features.with(V6T2);
353        #[cfg(target_feature = "v7")]
354        let features = features.with(V7);
355        #[cfg(target_feature = "v8")]
356        let features = features.with(V8);
357        #[cfg(target_feature = "v8.1m.main")]
358        let features = features.with(V8_1M_MAIN);
359        #[cfg(target_feature = "v8m")]
360        let features = features.with(V8M);
361        #[cfg(target_feature = "v8m.main")]
362        let features = features.with(V8M_MAIN);
363        #[cfg(target_feature = "vfp2")]
364        let features = features.with(VFP2);
365        #[cfg(target_feature = "vfp2sp")]
366        let features = features.with(VFP2SP);
367        #[cfg(target_feature = "vfp3")]
368        let features = features.with(VFP3);
369        #[cfg(target_feature = "vfp4")]
370        let features = features.with(VFP4);
371        #[cfg(target_feature = "virtualization")]
372        let features = features.with(VIRTUALIZATION);
373        features
374    }
375
376}
377#[cfg(any(doc, target_arch = "aarch64"))]
378#[rustfmt::skip]
379pub mod aarch64 {
380    use super::*;
381
382    #[repr(u16)]
383    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
384    enum FeatureId {
385        AES,
386        BF16,
387        BTI,
388        CRC,
389        CRT_STATIC,
390        CSSC,
391        DIT,
392        DOTPROD,
393        DPB,
394        DPB2,
395        ECV,
396        F32MM,
397        F64MM,
398        FAMINMAX,
399        FCMA,
400        FHM,
401        FLAGM,
402        FLAGM2,
403        FP16,
404        FP8,
405        FP8DOT2,
406        FP8DOT4,
407        FP8FMA,
408        FRINTTS,
409        HBC,
410        I8MM,
411        JSCONV,
412        LOR,
413        LSE,
414        LSE128,
415        LSE2,
416        LUT,
417        MOPS,
418        MTE,
419        NEON,
420        OUTLINE_ATOMICS,
421        PACA,
422        PACG,
423        PAN,
424        PAUTH_LR,
425        PMUV3,
426        RAND,
427        RAS,
428        RCPC,
429        RCPC2,
430        RCPC3,
431        RDM,
432        SB,
433        SHA2,
434        SHA3,
435        SM4,
436        SME,
437        SME_B16B16,
438        SME_F16F16,
439        SME_F64F64,
440        SME_F8F16,
441        SME_F8F32,
442        SME_FA64,
443        SME_I16I64,
444        SME_LUTV2,
445        SME2,
446        SME2P1,
447        SPE,
448        SSBS,
449        SSVE_FP8DOT2,
450        SSVE_FP8DOT4,
451        SSVE_FP8FMA,
452        SVE,
453        SVE_B16B16,
454        SVE2,
455        SVE2_AES,
456        SVE2_BITPERM,
457        SVE2_SHA3,
458        SVE2_SM4,
459        SVE2P1,
460        V8_1A,
461        V8_2A,
462        V8_3A,
463        V8_4A,
464        V8_5A,
465        V8_6A,
466        V8_7A,
467        V8_8A,
468        V8_9A,
469        V9_1A,
470        V9_2A,
471        V9_3A,
472        V9_4A,
473        V9_5A,
474        V9A,
475        VH,
476        WFXT,
477    }
478
479    macro_rules! feature_set {
480        ($($feature:ident),* $(,)?) => { {
481            #[cfg(target_arch = "aarch64")]
482            {
483                let features = TargetFeatures::empty();
484                $(let features = features.with_bit(FeatureId::$feature as usize);)*
485                features
486            }
487            #[cfg(all(doc, not(target_arch = "aarch64")))]
488            {
489                TargetFeatures::empty()
490            }
491        } };
492    }
493    #[doc = "Enable AES support."]
494    pub const AES: TargetFeatures = feature_set!(AES, NEON);
495
496    #[doc = "Enable BFloat16 Extension."]
497    pub const BF16: TargetFeatures = feature_set!(BF16);
498
499    #[doc = "Enable Branch Target Identification."]
500    pub const BTI: TargetFeatures = feature_set!(BTI);
501
502    #[doc = "Enable Armv8.0-A CRC-32 checksum instructions."]
503    pub const CRC: TargetFeatures = feature_set!(CRC);
504
505    #[doc = "Enables C Run-time Libraries to be statically linked."]
506    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
507
508    #[doc = "Enable Common Short Sequence Compression (CSSC) instructions."]
509    pub const CSSC: TargetFeatures = feature_set!(CSSC);
510
511    #[doc = "Enable Armv8.4-A Data Independent Timing instructions."]
512    pub const DIT: TargetFeatures = feature_set!(DIT);
513
514    #[doc = "Enable dot product support."]
515    pub const DOTPROD: TargetFeatures = feature_set!(DOTPROD, NEON);
516
517    #[doc = "Enable Armv8.2-A data Cache Clean to Point of Persistence."]
518    pub const DPB: TargetFeatures = feature_set!(DPB);
519
520    #[doc = "Enable Armv8.5-A Cache Clean to Point of Deep Persistence."]
521    pub const DPB2: TargetFeatures = feature_set!(DPB, DPB2);
522
523    #[doc = "Enable enhanced counter virtualization extension."]
524    pub const ECV: TargetFeatures = feature_set!(ECV);
525
526    #[doc = "Enable Matrix Multiply FP32 Extension."]
527    pub const F32MM: TargetFeatures = feature_set!(F32MM, FP16, NEON, SVE);
528
529    #[doc = "Enable Matrix Multiply FP64 Extension."]
530    pub const F64MM: TargetFeatures = feature_set!(F64MM, FP16, NEON, SVE);
531
532    #[doc = "Enable FAMIN and FAMAX instructions."]
533    pub const FAMINMAX: TargetFeatures = feature_set!(FAMINMAX);
534
535    #[doc = "Enable Armv8.3-A Floating-point complex number support."]
536    pub const FCMA: TargetFeatures = feature_set!(FCMA, NEON);
537
538    #[doc = "Enable FP16 FML instructions."]
539    pub const FHM: TargetFeatures = feature_set!(FHM, FP16, NEON);
540
541    #[doc = "Enable Armv8.4-A Flag Manipulation instructions."]
542    pub const FLAGM: TargetFeatures = feature_set!(FLAGM);
543
544    #[doc = "Enable alternative NZCV format for floating point comparisons."]
545    pub const FLAGM2: TargetFeatures = feature_set!(FLAGM2);
546
547    #[doc = "Enable half-precision floating-point data processing."]
548    pub const FP16: TargetFeatures = feature_set!(FP16, NEON);
549
550    #[doc = "Enable FP8 instructions."]
551    pub const FP8: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT);
552
553    #[doc = "Enable FP8 2-way dot instructions."]
554    pub const FP8DOT2: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, FP8DOT2, FP8DOT4, FP8FMA, LUT);
555
556    #[doc = "Enable FP8 4-way dot instructions."]
557    pub const FP8DOT4: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, FP8DOT4, FP8FMA, LUT);
558
559    #[doc = "Enable Armv9.5-A FP8 multiply-add instructions."]
560    pub const FP8FMA: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, FP8FMA, LUT);
561
562    #[doc = "Enable FRInt\\[32\\|64\\]\\[Z\\|X\\] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int."]
563    pub const FRINTTS: TargetFeatures = feature_set!(FRINTTS);
564
565    #[doc = "Enable Armv8.8-A Hinted Conditional Branches Extension."]
566    pub const HBC: TargetFeatures = feature_set!(HBC);
567
568    #[doc = "Enable Matrix Multiply Int8 Extension."]
569    pub const I8MM: TargetFeatures = feature_set!(I8MM);
570
571    #[doc = "Enable Armv8.3-A JavaScript FP conversion instructions."]
572    pub const JSCONV: TargetFeatures = feature_set!(JSCONV, NEON);
573
574    #[doc = "Enable Armv8.1-A Limited Ordering Regions extension."]
575    pub const LOR: TargetFeatures = feature_set!(LOR);
576
577    #[doc = "Enable Armv8.1-A Large System Extension (LSE) atomic instructions."]
578    pub const LSE: TargetFeatures = feature_set!(LSE);
579
580    #[doc = "Enable Armv9.4-A 128-bit Atomic instructions."]
581    pub const LSE128: TargetFeatures = feature_set!(LSE, LSE128);
582
583    #[doc = "Enable Armv8.4-A Large System Extension 2 (LSE2) atomicity rules."]
584    pub const LSE2: TargetFeatures = feature_set!(LSE2);
585
586    #[doc = "Enable Lookup Table instructions."]
587    pub const LUT: TargetFeatures = feature_set!(LUT);
588
589    #[doc = "Enable Armv8.8-A memcpy and memset acceleration instructions."]
590    pub const MOPS: TargetFeatures = feature_set!(MOPS);
591
592    #[doc = "Enable Memory Tagging Extension."]
593    pub const MTE: TargetFeatures = feature_set!(MTE);
594
595    #[doc = "Enable Advanced SIMD instructions."]
596    pub const NEON: TargetFeatures = feature_set!(NEON);
597
598    #[doc = "Enable out of line atomics to support LSE instructions."]
599    pub const OUTLINE_ATOMICS: TargetFeatures = feature_set!(OUTLINE_ATOMICS);
600
601    #[doc = "Enable Armv8.3-A Pointer Authentication extension."]
602    pub const PACA: TargetFeatures = feature_set!(PACA, PACG);
603
604    #[doc = "Enable Armv8.3-A Pointer Authentication extension."]
605    pub const PACG: TargetFeatures = feature_set!(PACA, PACG);
606
607    #[doc = "Enable Armv8.1-A Privileged Access-Never extension."]
608    pub const PAN: TargetFeatures = feature_set!(PAN);
609
610    #[doc = "Enable Armv9.5-A PAC enhancements."]
611    pub const PAUTH_LR: TargetFeatures = feature_set!(PAUTH_LR);
612
613    #[doc = "Enable Armv8.0-A PMUv3 Performance Monitors extension."]
614    pub const PMUV3: TargetFeatures = feature_set!(PMUV3);
615
616    #[doc = "Enable Random Number generation instructions."]
617    pub const RAND: TargetFeatures = feature_set!(RAND);
618
619    #[doc = "Enable Armv8.0-A Reliability, Availability and Serviceability Extensions."]
620    pub const RAS: TargetFeatures = feature_set!(RAS);
621
622    #[doc = "Enable support for RCPC extension."]
623    pub const RCPC: TargetFeatures = feature_set!(RCPC);
624
625    #[doc = "Enable Armv8.4-A RCPC instructions with Immediate Offsets."]
626    pub const RCPC2: TargetFeatures = feature_set!(RCPC, RCPC2);
627
628    #[doc = "Enable Armv8.9-A RCPC instructions for A64 and Advanced SIMD and floating-point instruction set."]
629    pub const RCPC3: TargetFeatures = feature_set!(RCPC, RCPC2, RCPC3);
630
631    #[doc = "Enable Armv8.1-A Rounding Double Multiply Add/Subtract instructions."]
632    pub const RDM: TargetFeatures = feature_set!(NEON, RDM);
633
634    #[doc = "Enable Armv8.5-A Speculation Barrier."]
635    pub const SB: TargetFeatures = feature_set!(SB);
636
637    #[doc = "Enable SHA1 and SHA256 support."]
638    pub const SHA2: TargetFeatures = feature_set!(NEON, SHA2);
639
640    #[doc = "Enable SHA512 and SHA3 support."]
641    pub const SHA3: TargetFeatures = feature_set!(NEON, SHA2, SHA3);
642
643    #[doc = "Enable SM3 and SM4 support."]
644    pub const SM4: TargetFeatures = feature_set!(NEON, SM4);
645
646    #[doc = "Enable Scalable Matrix Extension (SME)."]
647    pub const SME: TargetFeatures = feature_set!(BF16, SME);
648
649    #[doc = "Enable SME2.1 ZA-targeting non-widening BFloat16 instructions."]
650    pub const SME_B16B16: TargetFeatures = feature_set!(BF16, SME, SME_B16B16, SME2, SVE_B16B16);
651
652    #[doc = "Enable SME non-widening Float16 instructions."]
653    pub const SME_F16F16: TargetFeatures = feature_set!(BF16, SME, SME_F16F16, SME2);
654
655    #[doc = "Enable Scalable Matrix Extension (SME) F64F64 instructions."]
656    pub const SME_F64F64: TargetFeatures = feature_set!(BF16, SME, SME_F64F64);
657
658    #[doc = "Enable Scalable Matrix Extension (SME) F8F16 instructions."]
659    pub const SME_F8F16: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT, SME, SME_F8F16, SME_F8F32, SME2);
660
661    #[doc = "Enable Scalable Matrix Extension (SME) F8F32 instructions."]
662    pub const SME_F8F32: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT, SME, SME_F8F32, SME2);
663
664    #[doc = "Enable the full A64 instruction set in streaming SVE mode."]
665    pub const SME_FA64: TargetFeatures = feature_set!(BF16, FP16, NEON, SME, SME_FA64, SVE, SVE2);
666
667    #[doc = "Enable Scalable Matrix Extension (SME) I16I64 instructions."]
668    pub const SME_I16I64: TargetFeatures = feature_set!(BF16, SME, SME_I16I64);
669
670    #[doc = "Enable Scalable Matrix Extension (SME) LUTv2 instructions."]
671    pub const SME_LUTV2: TargetFeatures = feature_set!(SME_LUTV2);
672
673    #[doc = "Enable Scalable Matrix Extension 2 (SME2) instructions."]
674    pub const SME2: TargetFeatures = feature_set!(BF16, SME, SME2);
675
676    #[doc = "Enable Scalable Matrix Extension 2.1 instructions."]
677    pub const SME2P1: TargetFeatures = feature_set!(BF16, SME, SME2, SME2P1);
678
679    #[doc = "Enable Statistical Profiling extension."]
680    pub const SPE: TargetFeatures = feature_set!(SPE);
681
682    #[doc = "Enable Speculative Store Bypass Safe bit."]
683    pub const SSBS: TargetFeatures = feature_set!(SSBS);
684
685    #[doc = "Enable SVE2 FP8 2-way dot product instructions."]
686    pub const SSVE_FP8DOT2: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT, SME, SME2, SSVE_FP8DOT2, SSVE_FP8DOT4, SSVE_FP8FMA);
687
688    #[doc = "Enable SVE2 FP8 4-way dot product instructions."]
689    pub const SSVE_FP8DOT4: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT, SME, SME2, SSVE_FP8DOT4, SSVE_FP8FMA);
690
691    #[doc = "Enable SVE2 FP8 multiply-add instructions."]
692    pub const SSVE_FP8FMA: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT, SME, SME2, SSVE_FP8FMA);
693
694    #[doc = "Enable Scalable Vector Extension (SVE) instructions."]
695    pub const SVE: TargetFeatures = feature_set!(FP16, NEON, SVE);
696
697    #[doc = "Enable SVE2 non-widening and SME2 Z-targeting non-widening BFloat16 instructions."]
698    pub const SVE_B16B16: TargetFeatures = feature_set!(BF16, SVE_B16B16);
699
700    #[doc = "Enable Scalable Vector Extension 2 (SVE2) instructions."]
701    pub const SVE2: TargetFeatures = feature_set!(FP16, NEON, SVE, SVE2);
702
703    #[doc = "Shorthand for +sve2+sve-aes."]
704    pub const SVE2_AES: TargetFeatures = feature_set!(AES, FP16, NEON, SVE, SVE2, SVE2_AES);
705
706    #[doc = "Shorthand for +sve2+sve-bitperm."]
707    pub const SVE2_BITPERM: TargetFeatures = feature_set!(FP16, NEON, SVE, SVE2, SVE2_BITPERM);
708
709    #[doc = "Shorthand for +sve2+sve-sha3."]
710    pub const SVE2_SHA3: TargetFeatures = feature_set!(FP16, NEON, SHA2, SHA3, SVE, SVE2, SVE2_SHA3);
711
712    #[doc = "Shorthand for +sve2+sve-sm4."]
713    pub const SVE2_SM4: TargetFeatures = feature_set!(FP16, NEON, SM4, SVE, SVE2, SVE2_SM4);
714
715    #[doc = "Enable Scalable Vector Extension 2.1 instructions."]
716    pub const SVE2P1: TargetFeatures = feature_set!(FP16, NEON, SVE, SVE2, SVE2P1);
717
718    #[doc = "Support ARM v8.1a architecture."]
719    pub const V8_1A: TargetFeatures = feature_set!(CRC, LOR, LSE, NEON, PAN, RDM, V8_1A, VH);
720
721    #[doc = "Support ARM v8.2a architecture."]
722    pub const V8_2A: TargetFeatures = feature_set!(CRC, DPB, LOR, LSE, NEON, PAN, RAS, RDM, V8_1A, V8_2A, VH);
723
724    #[doc = "Support ARM v8.3a architecture."]
725    pub const V8_3A: TargetFeatures = feature_set!(CRC, DPB, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, V8_1A, V8_2A, V8_3A, VH);
726
727    #[doc = "Support ARM v8.4a architecture."]
728    pub const V8_4A: TargetFeatures = feature_set!(CRC, DIT, DOTPROD, DPB, FLAGM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, V8_1A, V8_2A, V8_3A, V8_4A, VH);
729
730    #[doc = "Support ARM v8.5a architecture."]
731    pub const V8_5A: TargetFeatures = feature_set!(BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, VH);
732
733    #[doc = "Support ARM v8.6a architecture."]
734    pub const V8_6A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, I8MM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, VH);
735
736    #[doc = "Support ARM v8.7a architecture."]
737    pub const V8_7A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, I8MM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, VH, WFXT);
738
739    #[doc = "Support ARM v8.8a architecture."]
740    pub const V8_8A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, HBC, I8MM, JSCONV, LOR, LSE, MOPS, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V8_8A, VH, WFXT);
741
742    #[doc = "Support ARM v8.9a architecture."]
743    pub const V8_9A: TargetFeatures = feature_set!(BF16, BTI, CRC, CSSC, DIT, DOTPROD, DPB, DPB2, FLAGM, HBC, I8MM, JSCONV, LOR, LSE, MOPS, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V8_8A, V8_9A, VH, WFXT);
744
745    #[doc = "Support ARM v9.1a architecture."]
746    pub const V9_1A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, I8MM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V9_1A, V9A, VH);
747
748    #[doc = "Support ARM v9.2a architecture."]
749    pub const V9_2A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, I8MM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V9_1A, V9_2A, V9A, VH, WFXT);
750
751    #[doc = "Support ARM v9.3a architecture."]
752    pub const V9_3A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, HBC, I8MM, JSCONV, LOR, LSE, MOPS, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V8_8A, V9_1A, V9_2A, V9_3A, V9A, VH, WFXT);
753
754    #[doc = "Support ARM v9.4a architecture."]
755    pub const V9_4A: TargetFeatures = feature_set!(BF16, BTI, CRC, CSSC, DIT, DOTPROD, DPB, DPB2, FLAGM, HBC, I8MM, JSCONV, LOR, LSE, MOPS, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V8_8A, V8_9A, V9_1A, V9_2A, V9_3A, V9_4A, V9A, VH, WFXT);
756
757    #[doc = "Support ARM v9.5a architecture."]
758    pub const V9_5A: TargetFeatures = feature_set!(BF16, BTI, CRC, CSSC, DIT, DOTPROD, DPB, DPB2, FLAGM, HBC, I8MM, JSCONV, LOR, LSE, MOPS, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V8_8A, V8_9A, V9_1A, V9_2A, V9_3A, V9_4A, V9_5A, V9A, VH, WFXT);
759
760    #[doc = "Support ARM v9a architecture."]
761    pub const V9A: TargetFeatures = feature_set!(BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V9A, VH);
762
763    #[doc = "Enable Armv8.1-A Virtual Host extension."]
764    pub const VH: TargetFeatures = feature_set!(VH);
765
766    #[doc = "Enable Armv8.7-A WFET and WFIT instruction."]
767    pub const WFXT: TargetFeatures = feature_set!(WFXT);
768
769
770    #[cfg(target_arch = "aarch64")]
771    pub(crate) const FEATURES: &[FeatureData] = &[
772        FeatureData::new("aes", AES),
773        FeatureData::new("bf16", BF16),
774        FeatureData::new("bti", BTI),
775        FeatureData::new("crc", CRC),
776        FeatureData::new("crt-static", CRT_STATIC),
777        FeatureData::new("cssc", CSSC),
778        FeatureData::new("dit", DIT),
779        FeatureData::new("dotprod", DOTPROD),
780        FeatureData::new("dpb", DPB),
781        FeatureData::new("dpb2", DPB2),
782        FeatureData::new("ecv", ECV),
783        FeatureData::new("f32mm", F32MM),
784        FeatureData::new("f64mm", F64MM),
785        FeatureData::new("faminmax", FAMINMAX),
786        FeatureData::new("fcma", FCMA),
787        FeatureData::new("fhm", FHM),
788        FeatureData::new("flagm", FLAGM),
789        FeatureData::new("flagm2", FLAGM2),
790        FeatureData::new("fp16", FP16),
791        FeatureData::new("fp8", FP8),
792        FeatureData::new("fp8dot2", FP8DOT2),
793        FeatureData::new("fp8dot4", FP8DOT4),
794        FeatureData::new("fp8fma", FP8FMA),
795        FeatureData::new("frintts", FRINTTS),
796        FeatureData::new("hbc", HBC),
797        FeatureData::new("i8mm", I8MM),
798        FeatureData::new("jsconv", JSCONV),
799        FeatureData::new("lor", LOR),
800        FeatureData::new("lse", LSE),
801        FeatureData::new("lse128", LSE128),
802        FeatureData::new("lse2", LSE2),
803        FeatureData::new("lut", LUT),
804        FeatureData::new("mops", MOPS),
805        FeatureData::new("mte", MTE),
806        FeatureData::new("neon", NEON),
807        FeatureData::new("outline-atomics", OUTLINE_ATOMICS),
808        FeatureData::new("paca", PACA),
809        FeatureData::new("pacg", PACG),
810        FeatureData::new("pan", PAN),
811        FeatureData::new("pauth-lr", PAUTH_LR),
812        FeatureData::new("pmuv3", PMUV3),
813        FeatureData::new("rand", RAND),
814        FeatureData::new("ras", RAS),
815        FeatureData::new("rcpc", RCPC),
816        FeatureData::new("rcpc2", RCPC2),
817        FeatureData::new("rcpc3", RCPC3),
818        FeatureData::new("rdm", RDM),
819        FeatureData::new("sb", SB),
820        FeatureData::new("sha2", SHA2),
821        FeatureData::new("sha3", SHA3),
822        FeatureData::new("sm4", SM4),
823        FeatureData::new("sme", SME),
824        FeatureData::new("sme-b16b16", SME_B16B16),
825        FeatureData::new("sme-f16f16", SME_F16F16),
826        FeatureData::new("sme-f64f64", SME_F64F64),
827        FeatureData::new("sme-f8f16", SME_F8F16),
828        FeatureData::new("sme-f8f32", SME_F8F32),
829        FeatureData::new("sme-fa64", SME_FA64),
830        FeatureData::new("sme-i16i64", SME_I16I64),
831        FeatureData::new("sme-lutv2", SME_LUTV2),
832        FeatureData::new("sme2", SME2),
833        FeatureData::new("sme2p1", SME2P1),
834        FeatureData::new("spe", SPE),
835        FeatureData::new("ssbs", SSBS),
836        FeatureData::new("ssve-fp8dot2", SSVE_FP8DOT2),
837        FeatureData::new("ssve-fp8dot4", SSVE_FP8DOT4),
838        FeatureData::new("ssve-fp8fma", SSVE_FP8FMA),
839        FeatureData::new("sve", SVE),
840        FeatureData::new("sve-b16b16", SVE_B16B16),
841        FeatureData::new("sve2", SVE2),
842        FeatureData::new("sve2-aes", SVE2_AES),
843        FeatureData::new("sve2-bitperm", SVE2_BITPERM),
844        FeatureData::new("sve2-sha3", SVE2_SHA3),
845        FeatureData::new("sve2-sm4", SVE2_SM4),
846        FeatureData::new("sve2p1", SVE2P1),
847        FeatureData::new("v8.1a", V8_1A),
848        FeatureData::new("v8.2a", V8_2A),
849        FeatureData::new("v8.3a", V8_3A),
850        FeatureData::new("v8.4a", V8_4A),
851        FeatureData::new("v8.5a", V8_5A),
852        FeatureData::new("v8.6a", V8_6A),
853        FeatureData::new("v8.7a", V8_7A),
854        FeatureData::new("v8.8a", V8_8A),
855        FeatureData::new("v8.9a", V8_9A),
856        FeatureData::new("v9.1a", V9_1A),
857        FeatureData::new("v9.2a", V9_2A),
858        FeatureData::new("v9.3a", V9_3A),
859        FeatureData::new("v9.4a", V9_4A),
860        FeatureData::new("v9.5a", V9_5A),
861        FeatureData::new("v9a", V9A),
862        FeatureData::new("vh", VH),
863        FeatureData::new("wfxt", WFXT),
864    ];
865
866    #[cfg(target_arch = "aarch64")]
867    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
868    pub(crate) const fn enabled_for_target() -> TargetFeatures {
869        let features = TargetFeatures::empty();
870        #[cfg(target_feature = "aes")]
871        let features = features.with(AES);
872        #[cfg(target_feature = "bf16")]
873        let features = features.with(BF16);
874        #[cfg(target_feature = "bti")]
875        let features = features.with(BTI);
876        #[cfg(target_feature = "crc")]
877        let features = features.with(CRC);
878        #[cfg(target_feature = "crt-static")]
879        let features = features.with(CRT_STATIC);
880        #[cfg(target_feature = "cssc")]
881        let features = features.with(CSSC);
882        #[cfg(target_feature = "dit")]
883        let features = features.with(DIT);
884        #[cfg(target_feature = "dotprod")]
885        let features = features.with(DOTPROD);
886        #[cfg(target_feature = "dpb")]
887        let features = features.with(DPB);
888        #[cfg(target_feature = "dpb2")]
889        let features = features.with(DPB2);
890        #[cfg(target_feature = "ecv")]
891        let features = features.with(ECV);
892        #[cfg(target_feature = "f32mm")]
893        let features = features.with(F32MM);
894        #[cfg(target_feature = "f64mm")]
895        let features = features.with(F64MM);
896        #[cfg(target_feature = "faminmax")]
897        let features = features.with(FAMINMAX);
898        #[cfg(target_feature = "fcma")]
899        let features = features.with(FCMA);
900        #[cfg(target_feature = "fhm")]
901        let features = features.with(FHM);
902        #[cfg(target_feature = "flagm")]
903        let features = features.with(FLAGM);
904        #[cfg(target_feature = "flagm2")]
905        let features = features.with(FLAGM2);
906        #[cfg(target_feature = "fp16")]
907        let features = features.with(FP16);
908        #[cfg(target_feature = "fp8")]
909        let features = features.with(FP8);
910        #[cfg(target_feature = "fp8dot2")]
911        let features = features.with(FP8DOT2);
912        #[cfg(target_feature = "fp8dot4")]
913        let features = features.with(FP8DOT4);
914        #[cfg(target_feature = "fp8fma")]
915        let features = features.with(FP8FMA);
916        #[cfg(target_feature = "frintts")]
917        let features = features.with(FRINTTS);
918        #[cfg(target_feature = "hbc")]
919        let features = features.with(HBC);
920        #[cfg(target_feature = "i8mm")]
921        let features = features.with(I8MM);
922        #[cfg(target_feature = "jsconv")]
923        let features = features.with(JSCONV);
924        #[cfg(target_feature = "lor")]
925        let features = features.with(LOR);
926        #[cfg(target_feature = "lse")]
927        let features = features.with(LSE);
928        #[cfg(target_feature = "lse128")]
929        let features = features.with(LSE128);
930        #[cfg(target_feature = "lse2")]
931        let features = features.with(LSE2);
932        #[cfg(target_feature = "lut")]
933        let features = features.with(LUT);
934        #[cfg(target_feature = "mops")]
935        let features = features.with(MOPS);
936        #[cfg(target_feature = "mte")]
937        let features = features.with(MTE);
938        #[cfg(target_feature = "neon")]
939        let features = features.with(NEON);
940        #[cfg(target_feature = "outline-atomics")]
941        let features = features.with(OUTLINE_ATOMICS);
942        #[cfg(target_feature = "paca")]
943        let features = features.with(PACA);
944        #[cfg(target_feature = "pacg")]
945        let features = features.with(PACG);
946        #[cfg(target_feature = "pan")]
947        let features = features.with(PAN);
948        #[cfg(target_feature = "pauth-lr")]
949        let features = features.with(PAUTH_LR);
950        #[cfg(target_feature = "pmuv3")]
951        let features = features.with(PMUV3);
952        #[cfg(target_feature = "rand")]
953        let features = features.with(RAND);
954        #[cfg(target_feature = "ras")]
955        let features = features.with(RAS);
956        #[cfg(target_feature = "rcpc")]
957        let features = features.with(RCPC);
958        #[cfg(target_feature = "rcpc2")]
959        let features = features.with(RCPC2);
960        #[cfg(target_feature = "rcpc3")]
961        let features = features.with(RCPC3);
962        #[cfg(target_feature = "rdm")]
963        let features = features.with(RDM);
964        #[cfg(target_feature = "sb")]
965        let features = features.with(SB);
966        #[cfg(target_feature = "sha2")]
967        let features = features.with(SHA2);
968        #[cfg(target_feature = "sha3")]
969        let features = features.with(SHA3);
970        #[cfg(target_feature = "sm4")]
971        let features = features.with(SM4);
972        #[cfg(target_feature = "sme")]
973        let features = features.with(SME);
974        #[cfg(target_feature = "sme-b16b16")]
975        let features = features.with(SME_B16B16);
976        #[cfg(target_feature = "sme-f16f16")]
977        let features = features.with(SME_F16F16);
978        #[cfg(target_feature = "sme-f64f64")]
979        let features = features.with(SME_F64F64);
980        #[cfg(target_feature = "sme-f8f16")]
981        let features = features.with(SME_F8F16);
982        #[cfg(target_feature = "sme-f8f32")]
983        let features = features.with(SME_F8F32);
984        #[cfg(target_feature = "sme-fa64")]
985        let features = features.with(SME_FA64);
986        #[cfg(target_feature = "sme-i16i64")]
987        let features = features.with(SME_I16I64);
988        #[cfg(target_feature = "sme-lutv2")]
989        let features = features.with(SME_LUTV2);
990        #[cfg(target_feature = "sme2")]
991        let features = features.with(SME2);
992        #[cfg(target_feature = "sme2p1")]
993        let features = features.with(SME2P1);
994        #[cfg(target_feature = "spe")]
995        let features = features.with(SPE);
996        #[cfg(target_feature = "ssbs")]
997        let features = features.with(SSBS);
998        #[cfg(target_feature = "ssve-fp8dot2")]
999        let features = features.with(SSVE_FP8DOT2);
1000        #[cfg(target_feature = "ssve-fp8dot4")]
1001        let features = features.with(SSVE_FP8DOT4);
1002        #[cfg(target_feature = "ssve-fp8fma")]
1003        let features = features.with(SSVE_FP8FMA);
1004        #[cfg(target_feature = "sve")]
1005        let features = features.with(SVE);
1006        #[cfg(target_feature = "sve-b16b16")]
1007        let features = features.with(SVE_B16B16);
1008        #[cfg(target_feature = "sve2")]
1009        let features = features.with(SVE2);
1010        #[cfg(target_feature = "sve2-aes")]
1011        let features = features.with(SVE2_AES);
1012        #[cfg(target_feature = "sve2-bitperm")]
1013        let features = features.with(SVE2_BITPERM);
1014        #[cfg(target_feature = "sve2-sha3")]
1015        let features = features.with(SVE2_SHA3);
1016        #[cfg(target_feature = "sve2-sm4")]
1017        let features = features.with(SVE2_SM4);
1018        #[cfg(target_feature = "sve2p1")]
1019        let features = features.with(SVE2P1);
1020        #[cfg(target_feature = "v8.1a")]
1021        let features = features.with(V8_1A);
1022        #[cfg(target_feature = "v8.2a")]
1023        let features = features.with(V8_2A);
1024        #[cfg(target_feature = "v8.3a")]
1025        let features = features.with(V8_3A);
1026        #[cfg(target_feature = "v8.4a")]
1027        let features = features.with(V8_4A);
1028        #[cfg(target_feature = "v8.5a")]
1029        let features = features.with(V8_5A);
1030        #[cfg(target_feature = "v8.6a")]
1031        let features = features.with(V8_6A);
1032        #[cfg(target_feature = "v8.7a")]
1033        let features = features.with(V8_7A);
1034        #[cfg(target_feature = "v8.8a")]
1035        let features = features.with(V8_8A);
1036        #[cfg(target_feature = "v8.9a")]
1037        let features = features.with(V8_9A);
1038        #[cfg(target_feature = "v9.1a")]
1039        let features = features.with(V9_1A);
1040        #[cfg(target_feature = "v9.2a")]
1041        let features = features.with(V9_2A);
1042        #[cfg(target_feature = "v9.3a")]
1043        let features = features.with(V9_3A);
1044        #[cfg(target_feature = "v9.4a")]
1045        let features = features.with(V9_4A);
1046        #[cfg(target_feature = "v9.5a")]
1047        let features = features.with(V9_5A);
1048        #[cfg(target_feature = "v9a")]
1049        let features = features.with(V9A);
1050        #[cfg(target_feature = "vh")]
1051        let features = features.with(VH);
1052        #[cfg(target_feature = "wfxt")]
1053        let features = features.with(WFXT);
1054        features
1055    }
1056
1057}
1058#[cfg(any(doc, target_arch = "arm64ec"))]
1059#[rustfmt::skip]
1060pub mod arm64ec {
1061    use super::*;
1062
1063    #[repr(u16)]
1064    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
1065    enum FeatureId {
1066        AES,
1067        BF16,
1068        BTI,
1069        CRC,
1070        CRT_STATIC,
1071        CSSC,
1072        DIT,
1073        DOTPROD,
1074        DPB,
1075        DPB2,
1076        ECV,
1077        F32MM,
1078        F64MM,
1079        FAMINMAX,
1080        FCMA,
1081        FHM,
1082        FLAGM,
1083        FLAGM2,
1084        FP16,
1085        FP8,
1086        FP8DOT2,
1087        FP8DOT4,
1088        FP8FMA,
1089        FRINTTS,
1090        HBC,
1091        I8MM,
1092        JSCONV,
1093        LOR,
1094        LSE,
1095        LSE128,
1096        LSE2,
1097        LUT,
1098        MOPS,
1099        MTE,
1100        NEON,
1101        OUTLINE_ATOMICS,
1102        PACA,
1103        PACG,
1104        PAN,
1105        PAUTH_LR,
1106        PMUV3,
1107        RAND,
1108        RAS,
1109        RCPC,
1110        RCPC2,
1111        RCPC3,
1112        RDM,
1113        SB,
1114        SHA2,
1115        SHA3,
1116        SM4,
1117        SME,
1118        SME_B16B16,
1119        SME_F16F16,
1120        SME_F64F64,
1121        SME_F8F16,
1122        SME_F8F32,
1123        SME_FA64,
1124        SME_I16I64,
1125        SME_LUTV2,
1126        SME2,
1127        SME2P1,
1128        SPE,
1129        SSBS,
1130        SSVE_FP8DOT2,
1131        SSVE_FP8DOT4,
1132        SSVE_FP8FMA,
1133        SVE,
1134        SVE_B16B16,
1135        SVE2,
1136        SVE2_AES,
1137        SVE2_BITPERM,
1138        SVE2_SHA3,
1139        SVE2_SM4,
1140        SVE2P1,
1141        V8_1A,
1142        V8_2A,
1143        V8_3A,
1144        V8_4A,
1145        V8_5A,
1146        V8_6A,
1147        V8_7A,
1148        V8_8A,
1149        V8_9A,
1150        V9_1A,
1151        V9_2A,
1152        V9_3A,
1153        V9_4A,
1154        V9_5A,
1155        V9A,
1156        VH,
1157        WFXT,
1158    }
1159
1160    macro_rules! feature_set {
1161        ($($feature:ident),* $(,)?) => { {
1162            #[cfg(target_arch = "arm64ec")]
1163            {
1164                let features = TargetFeatures::empty();
1165                $(let features = features.with_bit(FeatureId::$feature as usize);)*
1166                features
1167            }
1168            #[cfg(all(doc, not(target_arch = "arm64ec")))]
1169            {
1170                TargetFeatures::empty()
1171            }
1172        } };
1173    }
1174    #[doc = "Enable AES support."]
1175    pub const AES: TargetFeatures = feature_set!(AES, NEON);
1176
1177    #[doc = "Enable BFloat16 Extension."]
1178    pub const BF16: TargetFeatures = feature_set!(BF16);
1179
1180    #[doc = "Enable Branch Target Identification."]
1181    pub const BTI: TargetFeatures = feature_set!(BTI);
1182
1183    #[doc = "Enable Armv8.0-A CRC-32 checksum instructions."]
1184    pub const CRC: TargetFeatures = feature_set!(CRC);
1185
1186    #[doc = "Enables C Run-time Libraries to be statically linked."]
1187    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
1188
1189    #[doc = "Enable Common Short Sequence Compression (CSSC) instructions."]
1190    pub const CSSC: TargetFeatures = feature_set!(CSSC);
1191
1192    #[doc = "Enable Armv8.4-A Data Independent Timing instructions."]
1193    pub const DIT: TargetFeatures = feature_set!(DIT);
1194
1195    #[doc = "Enable dot product support."]
1196    pub const DOTPROD: TargetFeatures = feature_set!(DOTPROD, NEON);
1197
1198    #[doc = "Enable Armv8.2-A data Cache Clean to Point of Persistence."]
1199    pub const DPB: TargetFeatures = feature_set!(DPB);
1200
1201    #[doc = "Enable Armv8.5-A Cache Clean to Point of Deep Persistence."]
1202    pub const DPB2: TargetFeatures = feature_set!(DPB, DPB2);
1203
1204    #[doc = "Enable enhanced counter virtualization extension."]
1205    pub const ECV: TargetFeatures = feature_set!(ECV);
1206
1207    #[doc = "Enable Matrix Multiply FP32 Extension."]
1208    pub const F32MM: TargetFeatures = feature_set!(F32MM, FP16, NEON, SVE);
1209
1210    #[doc = "Enable Matrix Multiply FP64 Extension."]
1211    pub const F64MM: TargetFeatures = feature_set!(F64MM, FP16, NEON, SVE);
1212
1213    #[doc = "Enable FAMIN and FAMAX instructions."]
1214    pub const FAMINMAX: TargetFeatures = feature_set!(FAMINMAX);
1215
1216    #[doc = "Enable Armv8.3-A Floating-point complex number support."]
1217    pub const FCMA: TargetFeatures = feature_set!(FCMA, NEON);
1218
1219    #[doc = "Enable FP16 FML instructions."]
1220    pub const FHM: TargetFeatures = feature_set!(FHM, FP16, NEON);
1221
1222    #[doc = "Enable Armv8.4-A Flag Manipulation instructions."]
1223    pub const FLAGM: TargetFeatures = feature_set!(FLAGM);
1224
1225    #[doc = "Enable alternative NZCV format for floating point comparisons."]
1226    pub const FLAGM2: TargetFeatures = feature_set!(FLAGM2);
1227
1228    #[doc = "Enable half-precision floating-point data processing."]
1229    pub const FP16: TargetFeatures = feature_set!(FP16, NEON);
1230
1231    #[doc = "Enable FP8 instructions."]
1232    pub const FP8: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT);
1233
1234    #[doc = "Enable FP8 2-way dot instructions."]
1235    pub const FP8DOT2: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, FP8DOT2, FP8DOT4, FP8FMA, LUT);
1236
1237    #[doc = "Enable FP8 4-way dot instructions."]
1238    pub const FP8DOT4: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, FP8DOT4, FP8FMA, LUT);
1239
1240    #[doc = "Enable Armv9.5-A FP8 multiply-add instructions."]
1241    pub const FP8FMA: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, FP8FMA, LUT);
1242
1243    #[doc = "Enable FRInt\\[32\\|64\\]\\[Z\\|X\\] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int."]
1244    pub const FRINTTS: TargetFeatures = feature_set!(FRINTTS);
1245
1246    #[doc = "Enable Armv8.8-A Hinted Conditional Branches Extension."]
1247    pub const HBC: TargetFeatures = feature_set!(HBC);
1248
1249    #[doc = "Enable Matrix Multiply Int8 Extension."]
1250    pub const I8MM: TargetFeatures = feature_set!(I8MM);
1251
1252    #[doc = "Enable Armv8.3-A JavaScript FP conversion instructions."]
1253    pub const JSCONV: TargetFeatures = feature_set!(JSCONV, NEON);
1254
1255    #[doc = "Enable Armv8.1-A Limited Ordering Regions extension."]
1256    pub const LOR: TargetFeatures = feature_set!(LOR);
1257
1258    #[doc = "Enable Armv8.1-A Large System Extension (LSE) atomic instructions."]
1259    pub const LSE: TargetFeatures = feature_set!(LSE);
1260
1261    #[doc = "Enable Armv9.4-A 128-bit Atomic instructions."]
1262    pub const LSE128: TargetFeatures = feature_set!(LSE, LSE128);
1263
1264    #[doc = "Enable Armv8.4-A Large System Extension 2 (LSE2) atomicity rules."]
1265    pub const LSE2: TargetFeatures = feature_set!(LSE2);
1266
1267    #[doc = "Enable Lookup Table instructions."]
1268    pub const LUT: TargetFeatures = feature_set!(LUT);
1269
1270    #[doc = "Enable Armv8.8-A memcpy and memset acceleration instructions."]
1271    pub const MOPS: TargetFeatures = feature_set!(MOPS);
1272
1273    #[doc = "Enable Memory Tagging Extension."]
1274    pub const MTE: TargetFeatures = feature_set!(MTE);
1275
1276    #[doc = "Enable Advanced SIMD instructions."]
1277    pub const NEON: TargetFeatures = feature_set!(NEON);
1278
1279    #[doc = "Enable out of line atomics to support LSE instructions."]
1280    pub const OUTLINE_ATOMICS: TargetFeatures = feature_set!(OUTLINE_ATOMICS);
1281
1282    #[doc = "Enable Armv8.3-A Pointer Authentication extension."]
1283    pub const PACA: TargetFeatures = feature_set!(PACA, PACG);
1284
1285    #[doc = "Enable Armv8.3-A Pointer Authentication extension."]
1286    pub const PACG: TargetFeatures = feature_set!(PACA, PACG);
1287
1288    #[doc = "Enable Armv8.1-A Privileged Access-Never extension."]
1289    pub const PAN: TargetFeatures = feature_set!(PAN);
1290
1291    #[doc = "Enable Armv9.5-A PAC enhancements."]
1292    pub const PAUTH_LR: TargetFeatures = feature_set!(PAUTH_LR);
1293
1294    #[doc = "Enable Armv8.0-A PMUv3 Performance Monitors extension."]
1295    pub const PMUV3: TargetFeatures = feature_set!(PMUV3);
1296
1297    #[doc = "Enable Random Number generation instructions."]
1298    pub const RAND: TargetFeatures = feature_set!(RAND);
1299
1300    #[doc = "Enable Armv8.0-A Reliability, Availability and Serviceability Extensions."]
1301    pub const RAS: TargetFeatures = feature_set!(RAS);
1302
1303    #[doc = "Enable support for RCPC extension."]
1304    pub const RCPC: TargetFeatures = feature_set!(RCPC);
1305
1306    #[doc = "Enable Armv8.4-A RCPC instructions with Immediate Offsets."]
1307    pub const RCPC2: TargetFeatures = feature_set!(RCPC, RCPC2);
1308
1309    #[doc = "Enable Armv8.9-A RCPC instructions for A64 and Advanced SIMD and floating-point instruction set."]
1310    pub const RCPC3: TargetFeatures = feature_set!(RCPC, RCPC2, RCPC3);
1311
1312    #[doc = "Enable Armv8.1-A Rounding Double Multiply Add/Subtract instructions."]
1313    pub const RDM: TargetFeatures = feature_set!(NEON, RDM);
1314
1315    #[doc = "Enable Armv8.5-A Speculation Barrier."]
1316    pub const SB: TargetFeatures = feature_set!(SB);
1317
1318    #[doc = "Enable SHA1 and SHA256 support."]
1319    pub const SHA2: TargetFeatures = feature_set!(NEON, SHA2);
1320
1321    #[doc = "Enable SHA512 and SHA3 support."]
1322    pub const SHA3: TargetFeatures = feature_set!(NEON, SHA2, SHA3);
1323
1324    #[doc = "Enable SM3 and SM4 support."]
1325    pub const SM4: TargetFeatures = feature_set!(NEON, SM4);
1326
1327    #[doc = "Enable Scalable Matrix Extension (SME)."]
1328    pub const SME: TargetFeatures = feature_set!(BF16, SME);
1329
1330    #[doc = "Enable SME2.1 ZA-targeting non-widening BFloat16 instructions."]
1331    pub const SME_B16B16: TargetFeatures = feature_set!(BF16, SME, SME_B16B16, SME2, SVE_B16B16);
1332
1333    #[doc = "Enable SME non-widening Float16 instructions."]
1334    pub const SME_F16F16: TargetFeatures = feature_set!(BF16, SME, SME_F16F16, SME2);
1335
1336    #[doc = "Enable Scalable Matrix Extension (SME) F64F64 instructions."]
1337    pub const SME_F64F64: TargetFeatures = feature_set!(BF16, SME, SME_F64F64);
1338
1339    #[doc = "Enable Scalable Matrix Extension (SME) F8F16 instructions."]
1340    pub const SME_F8F16: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT, SME, SME_F8F16, SME_F8F32, SME2);
1341
1342    #[doc = "Enable Scalable Matrix Extension (SME) F8F32 instructions."]
1343    pub const SME_F8F32: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT, SME, SME_F8F32, SME2);
1344
1345    #[doc = "Enable the full A64 instruction set in streaming SVE mode."]
1346    pub const SME_FA64: TargetFeatures = feature_set!(BF16, FP16, NEON, SME, SME_FA64, SVE, SVE2);
1347
1348    #[doc = "Enable Scalable Matrix Extension (SME) I16I64 instructions."]
1349    pub const SME_I16I64: TargetFeatures = feature_set!(BF16, SME, SME_I16I64);
1350
1351    #[doc = "Enable Scalable Matrix Extension (SME) LUTv2 instructions."]
1352    pub const SME_LUTV2: TargetFeatures = feature_set!(SME_LUTV2);
1353
1354    #[doc = "Enable Scalable Matrix Extension 2 (SME2) instructions."]
1355    pub const SME2: TargetFeatures = feature_set!(BF16, SME, SME2);
1356
1357    #[doc = "Enable Scalable Matrix Extension 2.1 instructions."]
1358    pub const SME2P1: TargetFeatures = feature_set!(BF16, SME, SME2, SME2P1);
1359
1360    #[doc = "Enable Statistical Profiling extension."]
1361    pub const SPE: TargetFeatures = feature_set!(SPE);
1362
1363    #[doc = "Enable Speculative Store Bypass Safe bit."]
1364    pub const SSBS: TargetFeatures = feature_set!(SSBS);
1365
1366    #[doc = "Enable SVE2 FP8 2-way dot product instructions."]
1367    pub const SSVE_FP8DOT2: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT, SME, SME2, SSVE_FP8DOT2, SSVE_FP8DOT4, SSVE_FP8FMA);
1368
1369    #[doc = "Enable SVE2 FP8 4-way dot product instructions."]
1370    pub const SSVE_FP8DOT4: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT, SME, SME2, SSVE_FP8DOT4, SSVE_FP8FMA);
1371
1372    #[doc = "Enable SVE2 FP8 multiply-add instructions."]
1373    pub const SSVE_FP8FMA: TargetFeatures = feature_set!(BF16, FAMINMAX, FP8, LUT, SME, SME2, SSVE_FP8FMA);
1374
1375    #[doc = "Enable Scalable Vector Extension (SVE) instructions."]
1376    pub const SVE: TargetFeatures = feature_set!(FP16, NEON, SVE);
1377
1378    #[doc = "Enable SVE2 non-widening and SME2 Z-targeting non-widening BFloat16 instructions."]
1379    pub const SVE_B16B16: TargetFeatures = feature_set!(BF16, SVE_B16B16);
1380
1381    #[doc = "Enable Scalable Vector Extension 2 (SVE2) instructions."]
1382    pub const SVE2: TargetFeatures = feature_set!(FP16, NEON, SVE, SVE2);
1383
1384    #[doc = "Shorthand for +sve2+sve-aes."]
1385    pub const SVE2_AES: TargetFeatures = feature_set!(AES, FP16, NEON, SVE, SVE2, SVE2_AES);
1386
1387    #[doc = "Shorthand for +sve2+sve-bitperm."]
1388    pub const SVE2_BITPERM: TargetFeatures = feature_set!(FP16, NEON, SVE, SVE2, SVE2_BITPERM);
1389
1390    #[doc = "Shorthand for +sve2+sve-sha3."]
1391    pub const SVE2_SHA3: TargetFeatures = feature_set!(FP16, NEON, SHA2, SHA3, SVE, SVE2, SVE2_SHA3);
1392
1393    #[doc = "Shorthand for +sve2+sve-sm4."]
1394    pub const SVE2_SM4: TargetFeatures = feature_set!(FP16, NEON, SM4, SVE, SVE2, SVE2_SM4);
1395
1396    #[doc = "Enable Scalable Vector Extension 2.1 instructions."]
1397    pub const SVE2P1: TargetFeatures = feature_set!(FP16, NEON, SVE, SVE2, SVE2P1);
1398
1399    #[doc = "Support ARM v8.1a architecture."]
1400    pub const V8_1A: TargetFeatures = feature_set!(CRC, LOR, LSE, NEON, PAN, RDM, V8_1A, VH);
1401
1402    #[doc = "Support ARM v8.2a architecture."]
1403    pub const V8_2A: TargetFeatures = feature_set!(CRC, DPB, LOR, LSE, NEON, PAN, RAS, RDM, V8_1A, V8_2A, VH);
1404
1405    #[doc = "Support ARM v8.3a architecture."]
1406    pub const V8_3A: TargetFeatures = feature_set!(CRC, DPB, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, V8_1A, V8_2A, V8_3A, VH);
1407
1408    #[doc = "Support ARM v8.4a architecture."]
1409    pub const V8_4A: TargetFeatures = feature_set!(CRC, DIT, DOTPROD, DPB, FLAGM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, V8_1A, V8_2A, V8_3A, V8_4A, VH);
1410
1411    #[doc = "Support ARM v8.5a architecture."]
1412    pub const V8_5A: TargetFeatures = feature_set!(BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, VH);
1413
1414    #[doc = "Support ARM v8.6a architecture."]
1415    pub const V8_6A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, I8MM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, VH);
1416
1417    #[doc = "Support ARM v8.7a architecture."]
1418    pub const V8_7A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, I8MM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, VH, WFXT);
1419
1420    #[doc = "Support ARM v8.8a architecture."]
1421    pub const V8_8A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, HBC, I8MM, JSCONV, LOR, LSE, MOPS, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V8_8A, VH, WFXT);
1422
1423    #[doc = "Support ARM v8.9a architecture."]
1424    pub const V8_9A: TargetFeatures = feature_set!(BF16, BTI, CRC, CSSC, DIT, DOTPROD, DPB, DPB2, FLAGM, HBC, I8MM, JSCONV, LOR, LSE, MOPS, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V8_8A, V8_9A, VH, WFXT);
1425
1426    #[doc = "Support ARM v9.1a architecture."]
1427    pub const V9_1A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, I8MM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V9_1A, V9A, VH);
1428
1429    #[doc = "Support ARM v9.2a architecture."]
1430    pub const V9_2A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, I8MM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V9_1A, V9_2A, V9A, VH, WFXT);
1431
1432    #[doc = "Support ARM v9.3a architecture."]
1433    pub const V9_3A: TargetFeatures = feature_set!(BF16, BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, HBC, I8MM, JSCONV, LOR, LSE, MOPS, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V8_8A, V9_1A, V9_2A, V9_3A, V9A, VH, WFXT);
1434
1435    #[doc = "Support ARM v9.4a architecture."]
1436    pub const V9_4A: TargetFeatures = feature_set!(BF16, BTI, CRC, CSSC, DIT, DOTPROD, DPB, DPB2, FLAGM, HBC, I8MM, JSCONV, LOR, LSE, MOPS, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V8_8A, V8_9A, V9_1A, V9_2A, V9_3A, V9_4A, V9A, VH, WFXT);
1437
1438    #[doc = "Support ARM v9.5a architecture."]
1439    pub const V9_5A: TargetFeatures = feature_set!(BF16, BTI, CRC, CSSC, DIT, DOTPROD, DPB, DPB2, FLAGM, HBC, I8MM, JSCONV, LOR, LSE, MOPS, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V8_6A, V8_7A, V8_8A, V8_9A, V9_1A, V9_2A, V9_3A, V9_4A, V9_5A, V9A, VH, WFXT);
1440
1441    #[doc = "Support ARM v9a architecture."]
1442    pub const V9A: TargetFeatures = feature_set!(BTI, CRC, DIT, DOTPROD, DPB, DPB2, FLAGM, JSCONV, LOR, LSE, NEON, PACA, PACG, PAN, RAS, RCPC, RDM, SB, SSBS, V8_1A, V8_2A, V8_3A, V8_4A, V8_5A, V9A, VH);
1443
1444    #[doc = "Enable Armv8.1-A Virtual Host extension."]
1445    pub const VH: TargetFeatures = feature_set!(VH);
1446
1447    #[doc = "Enable Armv8.7-A WFET and WFIT instruction."]
1448    pub const WFXT: TargetFeatures = feature_set!(WFXT);
1449
1450
1451    #[cfg(target_arch = "arm64ec")]
1452    pub(crate) const FEATURES: &[FeatureData] = &[
1453        FeatureData::new("aes", AES),
1454        FeatureData::new("bf16", BF16),
1455        FeatureData::new("bti", BTI),
1456        FeatureData::new("crc", CRC),
1457        FeatureData::new("crt-static", CRT_STATIC),
1458        FeatureData::new("cssc", CSSC),
1459        FeatureData::new("dit", DIT),
1460        FeatureData::new("dotprod", DOTPROD),
1461        FeatureData::new("dpb", DPB),
1462        FeatureData::new("dpb2", DPB2),
1463        FeatureData::new("ecv", ECV),
1464        FeatureData::new("f32mm", F32MM),
1465        FeatureData::new("f64mm", F64MM),
1466        FeatureData::new("faminmax", FAMINMAX),
1467        FeatureData::new("fcma", FCMA),
1468        FeatureData::new("fhm", FHM),
1469        FeatureData::new("flagm", FLAGM),
1470        FeatureData::new("flagm2", FLAGM2),
1471        FeatureData::new("fp16", FP16),
1472        FeatureData::new("fp8", FP8),
1473        FeatureData::new("fp8dot2", FP8DOT2),
1474        FeatureData::new("fp8dot4", FP8DOT4),
1475        FeatureData::new("fp8fma", FP8FMA),
1476        FeatureData::new("frintts", FRINTTS),
1477        FeatureData::new("hbc", HBC),
1478        FeatureData::new("i8mm", I8MM),
1479        FeatureData::new("jsconv", JSCONV),
1480        FeatureData::new("lor", LOR),
1481        FeatureData::new("lse", LSE),
1482        FeatureData::new("lse128", LSE128),
1483        FeatureData::new("lse2", LSE2),
1484        FeatureData::new("lut", LUT),
1485        FeatureData::new("mops", MOPS),
1486        FeatureData::new("mte", MTE),
1487        FeatureData::new("neon", NEON),
1488        FeatureData::new("outline-atomics", OUTLINE_ATOMICS),
1489        FeatureData::new("paca", PACA),
1490        FeatureData::new("pacg", PACG),
1491        FeatureData::new("pan", PAN),
1492        FeatureData::new("pauth-lr", PAUTH_LR),
1493        FeatureData::new("pmuv3", PMUV3),
1494        FeatureData::new("rand", RAND),
1495        FeatureData::new("ras", RAS),
1496        FeatureData::new("rcpc", RCPC),
1497        FeatureData::new("rcpc2", RCPC2),
1498        FeatureData::new("rcpc3", RCPC3),
1499        FeatureData::new("rdm", RDM),
1500        FeatureData::new("sb", SB),
1501        FeatureData::new("sha2", SHA2),
1502        FeatureData::new("sha3", SHA3),
1503        FeatureData::new("sm4", SM4),
1504        FeatureData::new("sme", SME),
1505        FeatureData::new("sme-b16b16", SME_B16B16),
1506        FeatureData::new("sme-f16f16", SME_F16F16),
1507        FeatureData::new("sme-f64f64", SME_F64F64),
1508        FeatureData::new("sme-f8f16", SME_F8F16),
1509        FeatureData::new("sme-f8f32", SME_F8F32),
1510        FeatureData::new("sme-fa64", SME_FA64),
1511        FeatureData::new("sme-i16i64", SME_I16I64),
1512        FeatureData::new("sme-lutv2", SME_LUTV2),
1513        FeatureData::new("sme2", SME2),
1514        FeatureData::new("sme2p1", SME2P1),
1515        FeatureData::new("spe", SPE),
1516        FeatureData::new("ssbs", SSBS),
1517        FeatureData::new("ssve-fp8dot2", SSVE_FP8DOT2),
1518        FeatureData::new("ssve-fp8dot4", SSVE_FP8DOT4),
1519        FeatureData::new("ssve-fp8fma", SSVE_FP8FMA),
1520        FeatureData::new("sve", SVE),
1521        FeatureData::new("sve-b16b16", SVE_B16B16),
1522        FeatureData::new("sve2", SVE2),
1523        FeatureData::new("sve2-aes", SVE2_AES),
1524        FeatureData::new("sve2-bitperm", SVE2_BITPERM),
1525        FeatureData::new("sve2-sha3", SVE2_SHA3),
1526        FeatureData::new("sve2-sm4", SVE2_SM4),
1527        FeatureData::new("sve2p1", SVE2P1),
1528        FeatureData::new("v8.1a", V8_1A),
1529        FeatureData::new("v8.2a", V8_2A),
1530        FeatureData::new("v8.3a", V8_3A),
1531        FeatureData::new("v8.4a", V8_4A),
1532        FeatureData::new("v8.5a", V8_5A),
1533        FeatureData::new("v8.6a", V8_6A),
1534        FeatureData::new("v8.7a", V8_7A),
1535        FeatureData::new("v8.8a", V8_8A),
1536        FeatureData::new("v8.9a", V8_9A),
1537        FeatureData::new("v9.1a", V9_1A),
1538        FeatureData::new("v9.2a", V9_2A),
1539        FeatureData::new("v9.3a", V9_3A),
1540        FeatureData::new("v9.4a", V9_4A),
1541        FeatureData::new("v9.5a", V9_5A),
1542        FeatureData::new("v9a", V9A),
1543        FeatureData::new("vh", VH),
1544        FeatureData::new("wfxt", WFXT),
1545    ];
1546
1547    #[cfg(target_arch = "arm64ec")]
1548    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
1549    pub(crate) const fn enabled_for_target() -> TargetFeatures {
1550        let features = TargetFeatures::empty();
1551        #[cfg(target_feature = "aes")]
1552        let features = features.with(AES);
1553        #[cfg(target_feature = "bf16")]
1554        let features = features.with(BF16);
1555        #[cfg(target_feature = "bti")]
1556        let features = features.with(BTI);
1557        #[cfg(target_feature = "crc")]
1558        let features = features.with(CRC);
1559        #[cfg(target_feature = "crt-static")]
1560        let features = features.with(CRT_STATIC);
1561        #[cfg(target_feature = "cssc")]
1562        let features = features.with(CSSC);
1563        #[cfg(target_feature = "dit")]
1564        let features = features.with(DIT);
1565        #[cfg(target_feature = "dotprod")]
1566        let features = features.with(DOTPROD);
1567        #[cfg(target_feature = "dpb")]
1568        let features = features.with(DPB);
1569        #[cfg(target_feature = "dpb2")]
1570        let features = features.with(DPB2);
1571        #[cfg(target_feature = "ecv")]
1572        let features = features.with(ECV);
1573        #[cfg(target_feature = "f32mm")]
1574        let features = features.with(F32MM);
1575        #[cfg(target_feature = "f64mm")]
1576        let features = features.with(F64MM);
1577        #[cfg(target_feature = "faminmax")]
1578        let features = features.with(FAMINMAX);
1579        #[cfg(target_feature = "fcma")]
1580        let features = features.with(FCMA);
1581        #[cfg(target_feature = "fhm")]
1582        let features = features.with(FHM);
1583        #[cfg(target_feature = "flagm")]
1584        let features = features.with(FLAGM);
1585        #[cfg(target_feature = "flagm2")]
1586        let features = features.with(FLAGM2);
1587        #[cfg(target_feature = "fp16")]
1588        let features = features.with(FP16);
1589        #[cfg(target_feature = "fp8")]
1590        let features = features.with(FP8);
1591        #[cfg(target_feature = "fp8dot2")]
1592        let features = features.with(FP8DOT2);
1593        #[cfg(target_feature = "fp8dot4")]
1594        let features = features.with(FP8DOT4);
1595        #[cfg(target_feature = "fp8fma")]
1596        let features = features.with(FP8FMA);
1597        #[cfg(target_feature = "frintts")]
1598        let features = features.with(FRINTTS);
1599        #[cfg(target_feature = "hbc")]
1600        let features = features.with(HBC);
1601        #[cfg(target_feature = "i8mm")]
1602        let features = features.with(I8MM);
1603        #[cfg(target_feature = "jsconv")]
1604        let features = features.with(JSCONV);
1605        #[cfg(target_feature = "lor")]
1606        let features = features.with(LOR);
1607        #[cfg(target_feature = "lse")]
1608        let features = features.with(LSE);
1609        #[cfg(target_feature = "lse128")]
1610        let features = features.with(LSE128);
1611        #[cfg(target_feature = "lse2")]
1612        let features = features.with(LSE2);
1613        #[cfg(target_feature = "lut")]
1614        let features = features.with(LUT);
1615        #[cfg(target_feature = "mops")]
1616        let features = features.with(MOPS);
1617        #[cfg(target_feature = "mte")]
1618        let features = features.with(MTE);
1619        #[cfg(target_feature = "neon")]
1620        let features = features.with(NEON);
1621        #[cfg(target_feature = "outline-atomics")]
1622        let features = features.with(OUTLINE_ATOMICS);
1623        #[cfg(target_feature = "paca")]
1624        let features = features.with(PACA);
1625        #[cfg(target_feature = "pacg")]
1626        let features = features.with(PACG);
1627        #[cfg(target_feature = "pan")]
1628        let features = features.with(PAN);
1629        #[cfg(target_feature = "pauth-lr")]
1630        let features = features.with(PAUTH_LR);
1631        #[cfg(target_feature = "pmuv3")]
1632        let features = features.with(PMUV3);
1633        #[cfg(target_feature = "rand")]
1634        let features = features.with(RAND);
1635        #[cfg(target_feature = "ras")]
1636        let features = features.with(RAS);
1637        #[cfg(target_feature = "rcpc")]
1638        let features = features.with(RCPC);
1639        #[cfg(target_feature = "rcpc2")]
1640        let features = features.with(RCPC2);
1641        #[cfg(target_feature = "rcpc3")]
1642        let features = features.with(RCPC3);
1643        #[cfg(target_feature = "rdm")]
1644        let features = features.with(RDM);
1645        #[cfg(target_feature = "sb")]
1646        let features = features.with(SB);
1647        #[cfg(target_feature = "sha2")]
1648        let features = features.with(SHA2);
1649        #[cfg(target_feature = "sha3")]
1650        let features = features.with(SHA3);
1651        #[cfg(target_feature = "sm4")]
1652        let features = features.with(SM4);
1653        #[cfg(target_feature = "sme")]
1654        let features = features.with(SME);
1655        #[cfg(target_feature = "sme-b16b16")]
1656        let features = features.with(SME_B16B16);
1657        #[cfg(target_feature = "sme-f16f16")]
1658        let features = features.with(SME_F16F16);
1659        #[cfg(target_feature = "sme-f64f64")]
1660        let features = features.with(SME_F64F64);
1661        #[cfg(target_feature = "sme-f8f16")]
1662        let features = features.with(SME_F8F16);
1663        #[cfg(target_feature = "sme-f8f32")]
1664        let features = features.with(SME_F8F32);
1665        #[cfg(target_feature = "sme-fa64")]
1666        let features = features.with(SME_FA64);
1667        #[cfg(target_feature = "sme-i16i64")]
1668        let features = features.with(SME_I16I64);
1669        #[cfg(target_feature = "sme-lutv2")]
1670        let features = features.with(SME_LUTV2);
1671        #[cfg(target_feature = "sme2")]
1672        let features = features.with(SME2);
1673        #[cfg(target_feature = "sme2p1")]
1674        let features = features.with(SME2P1);
1675        #[cfg(target_feature = "spe")]
1676        let features = features.with(SPE);
1677        #[cfg(target_feature = "ssbs")]
1678        let features = features.with(SSBS);
1679        #[cfg(target_feature = "ssve-fp8dot2")]
1680        let features = features.with(SSVE_FP8DOT2);
1681        #[cfg(target_feature = "ssve-fp8dot4")]
1682        let features = features.with(SSVE_FP8DOT4);
1683        #[cfg(target_feature = "ssve-fp8fma")]
1684        let features = features.with(SSVE_FP8FMA);
1685        #[cfg(target_feature = "sve")]
1686        let features = features.with(SVE);
1687        #[cfg(target_feature = "sve-b16b16")]
1688        let features = features.with(SVE_B16B16);
1689        #[cfg(target_feature = "sve2")]
1690        let features = features.with(SVE2);
1691        #[cfg(target_feature = "sve2-aes")]
1692        let features = features.with(SVE2_AES);
1693        #[cfg(target_feature = "sve2-bitperm")]
1694        let features = features.with(SVE2_BITPERM);
1695        #[cfg(target_feature = "sve2-sha3")]
1696        let features = features.with(SVE2_SHA3);
1697        #[cfg(target_feature = "sve2-sm4")]
1698        let features = features.with(SVE2_SM4);
1699        #[cfg(target_feature = "sve2p1")]
1700        let features = features.with(SVE2P1);
1701        #[cfg(target_feature = "v8.1a")]
1702        let features = features.with(V8_1A);
1703        #[cfg(target_feature = "v8.2a")]
1704        let features = features.with(V8_2A);
1705        #[cfg(target_feature = "v8.3a")]
1706        let features = features.with(V8_3A);
1707        #[cfg(target_feature = "v8.4a")]
1708        let features = features.with(V8_4A);
1709        #[cfg(target_feature = "v8.5a")]
1710        let features = features.with(V8_5A);
1711        #[cfg(target_feature = "v8.6a")]
1712        let features = features.with(V8_6A);
1713        #[cfg(target_feature = "v8.7a")]
1714        let features = features.with(V8_7A);
1715        #[cfg(target_feature = "v8.8a")]
1716        let features = features.with(V8_8A);
1717        #[cfg(target_feature = "v8.9a")]
1718        let features = features.with(V8_9A);
1719        #[cfg(target_feature = "v9.1a")]
1720        let features = features.with(V9_1A);
1721        #[cfg(target_feature = "v9.2a")]
1722        let features = features.with(V9_2A);
1723        #[cfg(target_feature = "v9.3a")]
1724        let features = features.with(V9_3A);
1725        #[cfg(target_feature = "v9.4a")]
1726        let features = features.with(V9_4A);
1727        #[cfg(target_feature = "v9.5a")]
1728        let features = features.with(V9_5A);
1729        #[cfg(target_feature = "v9a")]
1730        let features = features.with(V9A);
1731        #[cfg(target_feature = "vh")]
1732        let features = features.with(VH);
1733        #[cfg(target_feature = "wfxt")]
1734        let features = features.with(WFXT);
1735        features
1736    }
1737
1738}
1739#[cfg(any(doc, target_arch = "bpf"))]
1740#[rustfmt::skip]
1741pub mod bpf {
1742    use super::*;
1743
1744    #[repr(u16)]
1745    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
1746    enum FeatureId {
1747        ALLOWS_MISALIGNED_MEM_ACCESS,
1748        ALU32,
1749        CRT_STATIC,
1750    }
1751
1752    macro_rules! feature_set {
1753        ($($feature:ident),* $(,)?) => { {
1754            #[cfg(target_arch = "bpf")]
1755            {
1756                let features = TargetFeatures::empty();
1757                $(let features = features.with_bit(FeatureId::$feature as usize);)*
1758                features
1759            }
1760            #[cfg(all(doc, not(target_arch = "bpf")))]
1761            {
1762                TargetFeatures::empty()
1763            }
1764        } };
1765    }
1766    #[doc = "Allows misaligned memory access."]
1767    pub const ALLOWS_MISALIGNED_MEM_ACCESS: TargetFeatures = feature_set!(ALLOWS_MISALIGNED_MEM_ACCESS);
1768
1769    #[doc = "Enable ALU32 instructions."]
1770    pub const ALU32: TargetFeatures = feature_set!(ALU32);
1771
1772    #[doc = "Enables C Run-time Libraries to be statically linked."]
1773    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
1774
1775
1776    #[cfg(target_arch = "bpf")]
1777    pub(crate) const FEATURES: &[FeatureData] = &[
1778        FeatureData::new("allows-misaligned-mem-access", ALLOWS_MISALIGNED_MEM_ACCESS),
1779        FeatureData::new("alu32", ALU32),
1780        FeatureData::new("crt-static", CRT_STATIC),
1781    ];
1782
1783    #[cfg(target_arch = "bpf")]
1784    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
1785    pub(crate) const fn enabled_for_target() -> TargetFeatures {
1786        let features = TargetFeatures::empty();
1787        #[cfg(target_feature = "allows-misaligned-mem-access")]
1788        let features = features.with(ALLOWS_MISALIGNED_MEM_ACCESS);
1789        #[cfg(target_feature = "alu32")]
1790        let features = features.with(ALU32);
1791        #[cfg(target_feature = "crt-static")]
1792        let features = features.with(CRT_STATIC);
1793        features
1794    }
1795
1796}
1797#[cfg(any(doc, target_arch = "hexagon"))]
1798#[rustfmt::skip]
1799pub mod hexagon {
1800    use super::*;
1801
1802    #[repr(u16)]
1803    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
1804    enum FeatureId {
1805        AUDIO,
1806        CRT_STATIC,
1807        HVX,
1808        HVX_IEEE_FP,
1809        HVX_LENGTH128B,
1810        HVX_LENGTH64B,
1811        HVX_QFLOAT,
1812        HVXV60,
1813        HVXV62,
1814        HVXV65,
1815        HVXV66,
1816        HVXV67,
1817        HVXV68,
1818        HVXV69,
1819        HVXV71,
1820        HVXV73,
1821        HVXV75,
1822        HVXV79,
1823        V60,
1824        V62,
1825        V65,
1826        V66,
1827        V67,
1828        V68,
1829        V69,
1830        V71,
1831        V73,
1832        V75,
1833        V79,
1834        ZREG,
1835    }
1836
1837    macro_rules! feature_set {
1838        ($($feature:ident),* $(,)?) => { {
1839            #[cfg(target_arch = "hexagon")]
1840            {
1841                let features = TargetFeatures::empty();
1842                $(let features = features.with_bit(FeatureId::$feature as usize);)*
1843                features
1844            }
1845            #[cfg(all(doc, not(target_arch = "hexagon")))]
1846            {
1847                TargetFeatures::empty()
1848            }
1849        } };
1850    }
1851    #[doc = "Hexagon Audio extension instructions."]
1852    pub const AUDIO: TargetFeatures = feature_set!(AUDIO);
1853
1854    #[doc = "Enables C Run-time Libraries to be statically linked."]
1855    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
1856
1857    #[doc = "Hexagon HVX instructions."]
1858    pub const HVX: TargetFeatures = feature_set!(HVX);
1859
1860    #[doc = "Hexagon HVX IEEE floating point instructions."]
1861    pub const HVX_IEEE_FP: TargetFeatures = feature_set!(HVX, HVX_IEEE_FP);
1862
1863    #[doc = "Hexagon HVX 128B instructions."]
1864    pub const HVX_LENGTH128B: TargetFeatures = feature_set!(HVX, HVX_LENGTH128B);
1865
1866    #[doc = "Hexagon HVX 64B instructions."]
1867    pub const HVX_LENGTH64B: TargetFeatures = feature_set!(HVX, HVX_LENGTH64B);
1868
1869    #[doc = "Hexagon HVX QFloating point instructions."]
1870    pub const HVX_QFLOAT: TargetFeatures = feature_set!(HVX, HVX_QFLOAT);
1871
1872    #[doc = "Hexagon HVX instructions."]
1873    pub const HVXV60: TargetFeatures = feature_set!(HVX, HVXV60);
1874
1875    #[doc = "Hexagon HVX instructions."]
1876    pub const HVXV62: TargetFeatures = feature_set!(HVX, HVXV60, HVXV62);
1877
1878    #[doc = "Hexagon HVX instructions."]
1879    pub const HVXV65: TargetFeatures = feature_set!(HVX, HVXV60, HVXV62, HVXV65);
1880
1881    #[doc = "Hexagon HVX instructions."]
1882    pub const HVXV66: TargetFeatures = feature_set!(HVX, HVXV60, HVXV62, HVXV65, HVXV66, ZREG);
1883
1884    #[doc = "Hexagon HVX instructions."]
1885    pub const HVXV67: TargetFeatures = feature_set!(HVX, HVXV60, HVXV62, HVXV65, HVXV66, HVXV67, ZREG);
1886
1887    #[doc = "Hexagon HVX instructions."]
1888    pub const HVXV68: TargetFeatures = feature_set!(HVX, HVXV60, HVXV62, HVXV65, HVXV66, HVXV67, HVXV68, ZREG);
1889
1890    #[doc = "Hexagon HVX instructions."]
1891    pub const HVXV69: TargetFeatures = feature_set!(HVX, HVXV60, HVXV62, HVXV65, HVXV66, HVXV67, HVXV68, HVXV69, ZREG);
1892
1893    #[doc = "Hexagon HVX instructions."]
1894    pub const HVXV71: TargetFeatures = feature_set!(HVX, HVXV60, HVXV62, HVXV65, HVXV66, HVXV67, HVXV68, HVXV69, HVXV71, ZREG);
1895
1896    #[doc = "Hexagon HVX instructions."]
1897    pub const HVXV73: TargetFeatures = feature_set!(HVX, HVXV60, HVXV62, HVXV65, HVXV66, HVXV67, HVXV68, HVXV69, HVXV71, HVXV73, ZREG);
1898
1899    #[doc = "Hexagon HVX instructions."]
1900    pub const HVXV75: TargetFeatures = feature_set!(HVX, HVXV60, HVXV62, HVXV65, HVXV66, HVXV67, HVXV68, HVXV69, HVXV71, HVXV73, HVXV75, ZREG);
1901
1902    #[doc = "Hexagon HVX instructions."]
1903    pub const HVXV79: TargetFeatures = feature_set!(HVX, HVXV60, HVXV62, HVXV65, HVXV66, HVXV67, HVXV68, HVXV69, HVXV71, HVXV73, HVXV75, HVXV79, ZREG);
1904
1905    #[doc = "Enable Hexagon V60 architecture."]
1906    pub const V60: TargetFeatures = feature_set!(V60);
1907
1908    #[doc = "Enable Hexagon V62 architecture."]
1909    pub const V62: TargetFeatures = feature_set!(V60, V62);
1910
1911    #[doc = "Enable Hexagon V65 architecture."]
1912    pub const V65: TargetFeatures = feature_set!(V60, V62, V65);
1913
1914    #[doc = "Enable Hexagon V66 architecture."]
1915    pub const V66: TargetFeatures = feature_set!(V60, V62, V65, V66);
1916
1917    #[doc = "Enable Hexagon V67 architecture."]
1918    pub const V67: TargetFeatures = feature_set!(V60, V62, V65, V66, V67);
1919
1920    #[doc = "Enable Hexagon V68 architecture."]
1921    pub const V68: TargetFeatures = feature_set!(V60, V62, V65, V66, V67, V68);
1922
1923    #[doc = "Enable Hexagon V69 architecture."]
1924    pub const V69: TargetFeatures = feature_set!(V60, V62, V65, V66, V67, V68, V69);
1925
1926    #[doc = "Enable Hexagon V71 architecture."]
1927    pub const V71: TargetFeatures = feature_set!(V60, V62, V65, V66, V67, V68, V69, V71);
1928
1929    #[doc = "Enable Hexagon V73 architecture."]
1930    pub const V73: TargetFeatures = feature_set!(V60, V62, V65, V66, V67, V68, V69, V71, V73);
1931
1932    #[doc = "Enable Hexagon V75 architecture."]
1933    pub const V75: TargetFeatures = feature_set!(V60, V62, V65, V66, V67, V68, V69, V71, V73, V75);
1934
1935    #[doc = "Enable Hexagon V79 architecture."]
1936    pub const V79: TargetFeatures = feature_set!(V60, V62, V65, V66, V67, V68, V69, V71, V73, V75, V79);
1937
1938    #[doc = "Hexagon ZReg extension instructions."]
1939    pub const ZREG: TargetFeatures = feature_set!(ZREG);
1940
1941
1942    #[cfg(target_arch = "hexagon")]
1943    pub(crate) const FEATURES: &[FeatureData] = &[
1944        FeatureData::new("audio", AUDIO),
1945        FeatureData::new("crt-static", CRT_STATIC),
1946        FeatureData::new("hvx", HVX),
1947        FeatureData::new("hvx-ieee-fp", HVX_IEEE_FP),
1948        FeatureData::new("hvx-length128b", HVX_LENGTH128B),
1949        FeatureData::new("hvx-length64b", HVX_LENGTH64B),
1950        FeatureData::new("hvx-qfloat", HVX_QFLOAT),
1951        FeatureData::new("hvxv60", HVXV60),
1952        FeatureData::new("hvxv62", HVXV62),
1953        FeatureData::new("hvxv65", HVXV65),
1954        FeatureData::new("hvxv66", HVXV66),
1955        FeatureData::new("hvxv67", HVXV67),
1956        FeatureData::new("hvxv68", HVXV68),
1957        FeatureData::new("hvxv69", HVXV69),
1958        FeatureData::new("hvxv71", HVXV71),
1959        FeatureData::new("hvxv73", HVXV73),
1960        FeatureData::new("hvxv75", HVXV75),
1961        FeatureData::new("hvxv79", HVXV79),
1962        FeatureData::new("v60", V60),
1963        FeatureData::new("v62", V62),
1964        FeatureData::new("v65", V65),
1965        FeatureData::new("v66", V66),
1966        FeatureData::new("v67", V67),
1967        FeatureData::new("v68", V68),
1968        FeatureData::new("v69", V69),
1969        FeatureData::new("v71", V71),
1970        FeatureData::new("v73", V73),
1971        FeatureData::new("v75", V75),
1972        FeatureData::new("v79", V79),
1973        FeatureData::new("zreg", ZREG),
1974    ];
1975
1976    #[cfg(target_arch = "hexagon")]
1977    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
1978    pub(crate) const fn enabled_for_target() -> TargetFeatures {
1979        let features = TargetFeatures::empty();
1980        #[cfg(target_feature = "audio")]
1981        let features = features.with(AUDIO);
1982        #[cfg(target_feature = "crt-static")]
1983        let features = features.with(CRT_STATIC);
1984        #[cfg(target_feature = "hvx")]
1985        let features = features.with(HVX);
1986        #[cfg(target_feature = "hvx-ieee-fp")]
1987        let features = features.with(HVX_IEEE_FP);
1988        #[cfg(target_feature = "hvx-length128b")]
1989        let features = features.with(HVX_LENGTH128B);
1990        #[cfg(target_feature = "hvx-length64b")]
1991        let features = features.with(HVX_LENGTH64B);
1992        #[cfg(target_feature = "hvx-qfloat")]
1993        let features = features.with(HVX_QFLOAT);
1994        #[cfg(target_feature = "hvxv60")]
1995        let features = features.with(HVXV60);
1996        #[cfg(target_feature = "hvxv62")]
1997        let features = features.with(HVXV62);
1998        #[cfg(target_feature = "hvxv65")]
1999        let features = features.with(HVXV65);
2000        #[cfg(target_feature = "hvxv66")]
2001        let features = features.with(HVXV66);
2002        #[cfg(target_feature = "hvxv67")]
2003        let features = features.with(HVXV67);
2004        #[cfg(target_feature = "hvxv68")]
2005        let features = features.with(HVXV68);
2006        #[cfg(target_feature = "hvxv69")]
2007        let features = features.with(HVXV69);
2008        #[cfg(target_feature = "hvxv71")]
2009        let features = features.with(HVXV71);
2010        #[cfg(target_feature = "hvxv73")]
2011        let features = features.with(HVXV73);
2012        #[cfg(target_feature = "hvxv75")]
2013        let features = features.with(HVXV75);
2014        #[cfg(target_feature = "hvxv79")]
2015        let features = features.with(HVXV79);
2016        #[cfg(target_feature = "v60")]
2017        let features = features.with(V60);
2018        #[cfg(target_feature = "v62")]
2019        let features = features.with(V62);
2020        #[cfg(target_feature = "v65")]
2021        let features = features.with(V65);
2022        #[cfg(target_feature = "v66")]
2023        let features = features.with(V66);
2024        #[cfg(target_feature = "v67")]
2025        let features = features.with(V67);
2026        #[cfg(target_feature = "v68")]
2027        let features = features.with(V68);
2028        #[cfg(target_feature = "v69")]
2029        let features = features.with(V69);
2030        #[cfg(target_feature = "v71")]
2031        let features = features.with(V71);
2032        #[cfg(target_feature = "v73")]
2033        let features = features.with(V73);
2034        #[cfg(target_feature = "v75")]
2035        let features = features.with(V75);
2036        #[cfg(target_feature = "v79")]
2037        let features = features.with(V79);
2038        #[cfg(target_feature = "zreg")]
2039        let features = features.with(ZREG);
2040        features
2041    }
2042
2043}
2044#[cfg(any(doc, target_arch = "mips"))]
2045#[rustfmt::skip]
2046pub mod mips {
2047    use super::*;
2048
2049    #[repr(u16)]
2050    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
2051    enum FeatureId {
2052        CRT_STATIC,
2053        FP64,
2054        MSA,
2055        VIRT,
2056    }
2057
2058    macro_rules! feature_set {
2059        ($($feature:ident),* $(,)?) => { {
2060            #[cfg(target_arch = "mips")]
2061            {
2062                let features = TargetFeatures::empty();
2063                $(let features = features.with_bit(FeatureId::$feature as usize);)*
2064                features
2065            }
2066            #[cfg(all(doc, not(target_arch = "mips")))]
2067            {
2068                TargetFeatures::empty()
2069            }
2070        } };
2071    }
2072    #[doc = "Enables C Run-time Libraries to be statically linked."]
2073    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
2074
2075    #[doc = "Support 64-bit FP registers."]
2076    pub const FP64: TargetFeatures = feature_set!(FP64);
2077
2078    #[doc = "Mips MSA ASE."]
2079    pub const MSA: TargetFeatures = feature_set!(MSA);
2080
2081    #[doc = "Mips Virtualization ASE."]
2082    pub const VIRT: TargetFeatures = feature_set!(VIRT);
2083
2084
2085    #[cfg(target_arch = "mips")]
2086    pub(crate) const FEATURES: &[FeatureData] = &[
2087        FeatureData::new("crt-static", CRT_STATIC),
2088        FeatureData::new("fp64", FP64),
2089        FeatureData::new("msa", MSA),
2090        FeatureData::new("virt", VIRT),
2091    ];
2092
2093    #[cfg(target_arch = "mips")]
2094    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
2095    pub(crate) const fn enabled_for_target() -> TargetFeatures {
2096        let features = TargetFeatures::empty();
2097        #[cfg(target_feature = "crt-static")]
2098        let features = features.with(CRT_STATIC);
2099        #[cfg(target_feature = "fp64")]
2100        let features = features.with(FP64);
2101        #[cfg(target_feature = "msa")]
2102        let features = features.with(MSA);
2103        #[cfg(target_feature = "virt")]
2104        let features = features.with(VIRT);
2105        features
2106    }
2107
2108}
2109#[cfg(any(doc, target_arch = "mips64"))]
2110#[rustfmt::skip]
2111pub mod mips64 {
2112    use super::*;
2113
2114    #[repr(u16)]
2115    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
2116    enum FeatureId {
2117        CRT_STATIC,
2118        FP64,
2119        MSA,
2120        VIRT,
2121    }
2122
2123    macro_rules! feature_set {
2124        ($($feature:ident),* $(,)?) => { {
2125            #[cfg(target_arch = "mips64")]
2126            {
2127                let features = TargetFeatures::empty();
2128                $(let features = features.with_bit(FeatureId::$feature as usize);)*
2129                features
2130            }
2131            #[cfg(all(doc, not(target_arch = "mips64")))]
2132            {
2133                TargetFeatures::empty()
2134            }
2135        } };
2136    }
2137    #[doc = "Enables C Run-time Libraries to be statically linked."]
2138    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
2139
2140    #[doc = "Support 64-bit FP registers."]
2141    pub const FP64: TargetFeatures = feature_set!(FP64);
2142
2143    #[doc = "Mips MSA ASE."]
2144    pub const MSA: TargetFeatures = feature_set!(MSA);
2145
2146    #[doc = "Mips Virtualization ASE."]
2147    pub const VIRT: TargetFeatures = feature_set!(VIRT);
2148
2149
2150    #[cfg(target_arch = "mips64")]
2151    pub(crate) const FEATURES: &[FeatureData] = &[
2152        FeatureData::new("crt-static", CRT_STATIC),
2153        FeatureData::new("fp64", FP64),
2154        FeatureData::new("msa", MSA),
2155        FeatureData::new("virt", VIRT),
2156    ];
2157
2158    #[cfg(target_arch = "mips64")]
2159    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
2160    pub(crate) const fn enabled_for_target() -> TargetFeatures {
2161        let features = TargetFeatures::empty();
2162        #[cfg(target_feature = "crt-static")]
2163        let features = features.with(CRT_STATIC);
2164        #[cfg(target_feature = "fp64")]
2165        let features = features.with(FP64);
2166        #[cfg(target_feature = "msa")]
2167        let features = features.with(MSA);
2168        #[cfg(target_feature = "virt")]
2169        let features = features.with(VIRT);
2170        features
2171    }
2172
2173}
2174#[cfg(any(doc, target_arch = "loongarch32"))]
2175#[rustfmt::skip]
2176pub mod loongarch32 {
2177    use super::*;
2178
2179    #[repr(u16)]
2180    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
2181    enum FeatureId {
2182        F_32S,
2183        CRT_STATIC,
2184        D,
2185        DIV32,
2186        F,
2187        FRECIPE,
2188        LAM_BH,
2189        LAMCAS,
2190        LASX,
2191        LBT,
2192        LD_SEQ_SA,
2193        LSX,
2194        LVZ,
2195        RELAX,
2196        SCQ,
2197        UAL,
2198    }
2199
2200    macro_rules! feature_set {
2201        ($($feature:ident),* $(,)?) => { {
2202            #[cfg(target_arch = "loongarch32")]
2203            {
2204                let features = TargetFeatures::empty();
2205                $(let features = features.with_bit(FeatureId::$feature as usize);)*
2206                features
2207            }
2208            #[cfg(all(doc, not(target_arch = "loongarch32")))]
2209            {
2210                TargetFeatures::empty()
2211            }
2212        } };
2213    }
2214    #[doc = "LA32 Standard Basic Instruction Extension."]
2215    pub const F_32S: TargetFeatures = feature_set!(F_32S);
2216
2217    #[doc = "Enables C Run-time Libraries to be statically linked."]
2218    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
2219
2220    #[doc = "'D' (Double-Precision Floating-Point)."]
2221    pub const D: TargetFeatures = feature_set!(D, F);
2222
2223    #[doc = "Assume div.w\\[u\\] and mod.w\\[u\\] can handle inputs that are not sign-extended."]
2224    pub const DIV32: TargetFeatures = feature_set!(DIV32);
2225
2226    #[doc = "'F' (Single-Precision Floating-Point)."]
2227    pub const F: TargetFeatures = feature_set!(F);
2228
2229    #[doc = "Support frecipe.{s/d} and frsqrte.{s/d} instructions."]
2230    pub const FRECIPE: TargetFeatures = feature_set!(FRECIPE);
2231
2232    #[doc = "Support amswap\\[_db\\].{b/h} and amadd\\[_db\\].{b/h} instructions."]
2233    pub const LAM_BH: TargetFeatures = feature_set!(LAM_BH);
2234
2235    #[doc = "Support amcas\\[_db\\].{b/h/w/d}."]
2236    pub const LAMCAS: TargetFeatures = feature_set!(LAMCAS);
2237
2238    #[doc = "'LASX' (Loongson Advanced SIMD Extension)."]
2239    pub const LASX: TargetFeatures = feature_set!(D, F, LASX, LSX);
2240
2241    #[doc = "'LBT' (Loongson Binary Translation Extension)."]
2242    pub const LBT: TargetFeatures = feature_set!(LBT);
2243
2244    #[doc = "Don't use a same-address load-load barrier (dbar 0x700)."]
2245    pub const LD_SEQ_SA: TargetFeatures = feature_set!(LD_SEQ_SA);
2246
2247    #[doc = "'LSX' (Loongson SIMD Extension)."]
2248    pub const LSX: TargetFeatures = feature_set!(D, F, LSX);
2249
2250    #[doc = "'LVZ' (Loongson Virtualization Extension)."]
2251    pub const LVZ: TargetFeatures = feature_set!(LVZ);
2252
2253    #[doc = "Enable Linker relaxation."]
2254    pub const RELAX: TargetFeatures = feature_set!(RELAX);
2255
2256    #[doc = "Support sc.q instruction."]
2257    pub const SCQ: TargetFeatures = feature_set!(SCQ);
2258
2259    #[doc = "Allow memory accesses to be unaligned."]
2260    pub const UAL: TargetFeatures = feature_set!(UAL);
2261
2262
2263    #[cfg(target_arch = "loongarch32")]
2264    pub(crate) const FEATURES: &[FeatureData] = &[
2265        FeatureData::new("32s", F_32S),
2266        FeatureData::new("crt-static", CRT_STATIC),
2267        FeatureData::new("d", D),
2268        FeatureData::new("div32", DIV32),
2269        FeatureData::new("f", F),
2270        FeatureData::new("frecipe", FRECIPE),
2271        FeatureData::new("lam-bh", LAM_BH),
2272        FeatureData::new("lamcas", LAMCAS),
2273        FeatureData::new("lasx", LASX),
2274        FeatureData::new("lbt", LBT),
2275        FeatureData::new("ld-seq-sa", LD_SEQ_SA),
2276        FeatureData::new("lsx", LSX),
2277        FeatureData::new("lvz", LVZ),
2278        FeatureData::new("relax", RELAX),
2279        FeatureData::new("scq", SCQ),
2280        FeatureData::new("ual", UAL),
2281    ];
2282
2283    #[cfg(target_arch = "loongarch32")]
2284    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
2285    pub(crate) const fn enabled_for_target() -> TargetFeatures {
2286        let features = TargetFeatures::empty();
2287        #[cfg(target_feature = "32s")]
2288        let features = features.with(F_32S);
2289        #[cfg(target_feature = "crt-static")]
2290        let features = features.with(CRT_STATIC);
2291        #[cfg(target_feature = "d")]
2292        let features = features.with(D);
2293        #[cfg(target_feature = "div32")]
2294        let features = features.with(DIV32);
2295        #[cfg(target_feature = "f")]
2296        let features = features.with(F);
2297        #[cfg(target_feature = "frecipe")]
2298        let features = features.with(FRECIPE);
2299        #[cfg(target_feature = "lam-bh")]
2300        let features = features.with(LAM_BH);
2301        #[cfg(target_feature = "lamcas")]
2302        let features = features.with(LAMCAS);
2303        #[cfg(target_feature = "lasx")]
2304        let features = features.with(LASX);
2305        #[cfg(target_feature = "lbt")]
2306        let features = features.with(LBT);
2307        #[cfg(target_feature = "ld-seq-sa")]
2308        let features = features.with(LD_SEQ_SA);
2309        #[cfg(target_feature = "lsx")]
2310        let features = features.with(LSX);
2311        #[cfg(target_feature = "lvz")]
2312        let features = features.with(LVZ);
2313        #[cfg(target_feature = "relax")]
2314        let features = features.with(RELAX);
2315        #[cfg(target_feature = "scq")]
2316        let features = features.with(SCQ);
2317        #[cfg(target_feature = "ual")]
2318        let features = features.with(UAL);
2319        features
2320    }
2321
2322}
2323#[cfg(any(doc, target_arch = "loongarch64"))]
2324#[rustfmt::skip]
2325pub mod loongarch64 {
2326    use super::*;
2327
2328    #[repr(u16)]
2329    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
2330    enum FeatureId {
2331        F_32S,
2332        CRT_STATIC,
2333        D,
2334        DIV32,
2335        F,
2336        FRECIPE,
2337        LAM_BH,
2338        LAMCAS,
2339        LASX,
2340        LBT,
2341        LD_SEQ_SA,
2342        LSX,
2343        LVZ,
2344        RELAX,
2345        SCQ,
2346        UAL,
2347    }
2348
2349    macro_rules! feature_set {
2350        ($($feature:ident),* $(,)?) => { {
2351            #[cfg(target_arch = "loongarch64")]
2352            {
2353                let features = TargetFeatures::empty();
2354                $(let features = features.with_bit(FeatureId::$feature as usize);)*
2355                features
2356            }
2357            #[cfg(all(doc, not(target_arch = "loongarch64")))]
2358            {
2359                TargetFeatures::empty()
2360            }
2361        } };
2362    }
2363    #[doc = "LA32 Standard Basic Instruction Extension."]
2364    pub const F_32S: TargetFeatures = feature_set!(F_32S);
2365
2366    #[doc = "Enables C Run-time Libraries to be statically linked."]
2367    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
2368
2369    #[doc = "'D' (Double-Precision Floating-Point)."]
2370    pub const D: TargetFeatures = feature_set!(D, F);
2371
2372    #[doc = "Assume div.w\\[u\\] and mod.w\\[u\\] can handle inputs that are not sign-extended."]
2373    pub const DIV32: TargetFeatures = feature_set!(DIV32);
2374
2375    #[doc = "'F' (Single-Precision Floating-Point)."]
2376    pub const F: TargetFeatures = feature_set!(F);
2377
2378    #[doc = "Support frecipe.{s/d} and frsqrte.{s/d} instructions."]
2379    pub const FRECIPE: TargetFeatures = feature_set!(FRECIPE);
2380
2381    #[doc = "Support amswap\\[_db\\].{b/h} and amadd\\[_db\\].{b/h} instructions."]
2382    pub const LAM_BH: TargetFeatures = feature_set!(LAM_BH);
2383
2384    #[doc = "Support amcas\\[_db\\].{b/h/w/d}."]
2385    pub const LAMCAS: TargetFeatures = feature_set!(LAMCAS);
2386
2387    #[doc = "'LASX' (Loongson Advanced SIMD Extension)."]
2388    pub const LASX: TargetFeatures = feature_set!(D, F, LASX, LSX);
2389
2390    #[doc = "'LBT' (Loongson Binary Translation Extension)."]
2391    pub const LBT: TargetFeatures = feature_set!(LBT);
2392
2393    #[doc = "Don't use a same-address load-load barrier (dbar 0x700)."]
2394    pub const LD_SEQ_SA: TargetFeatures = feature_set!(LD_SEQ_SA);
2395
2396    #[doc = "'LSX' (Loongson SIMD Extension)."]
2397    pub const LSX: TargetFeatures = feature_set!(D, F, LSX);
2398
2399    #[doc = "'LVZ' (Loongson Virtualization Extension)."]
2400    pub const LVZ: TargetFeatures = feature_set!(LVZ);
2401
2402    #[doc = "Enable Linker relaxation."]
2403    pub const RELAX: TargetFeatures = feature_set!(RELAX);
2404
2405    #[doc = "Support sc.q instruction."]
2406    pub const SCQ: TargetFeatures = feature_set!(SCQ);
2407
2408    #[doc = "Allow memory accesses to be unaligned."]
2409    pub const UAL: TargetFeatures = feature_set!(UAL);
2410
2411
2412    #[cfg(target_arch = "loongarch64")]
2413    pub(crate) const FEATURES: &[FeatureData] = &[
2414        FeatureData::new("32s", F_32S),
2415        FeatureData::new("crt-static", CRT_STATIC),
2416        FeatureData::new("d", D),
2417        FeatureData::new("div32", DIV32),
2418        FeatureData::new("f", F),
2419        FeatureData::new("frecipe", FRECIPE),
2420        FeatureData::new("lam-bh", LAM_BH),
2421        FeatureData::new("lamcas", LAMCAS),
2422        FeatureData::new("lasx", LASX),
2423        FeatureData::new("lbt", LBT),
2424        FeatureData::new("ld-seq-sa", LD_SEQ_SA),
2425        FeatureData::new("lsx", LSX),
2426        FeatureData::new("lvz", LVZ),
2427        FeatureData::new("relax", RELAX),
2428        FeatureData::new("scq", SCQ),
2429        FeatureData::new("ual", UAL),
2430    ];
2431
2432    #[cfg(target_arch = "loongarch64")]
2433    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
2434    pub(crate) const fn enabled_for_target() -> TargetFeatures {
2435        let features = TargetFeatures::empty();
2436        #[cfg(target_feature = "32s")]
2437        let features = features.with(F_32S);
2438        #[cfg(target_feature = "crt-static")]
2439        let features = features.with(CRT_STATIC);
2440        #[cfg(target_feature = "d")]
2441        let features = features.with(D);
2442        #[cfg(target_feature = "div32")]
2443        let features = features.with(DIV32);
2444        #[cfg(target_feature = "f")]
2445        let features = features.with(F);
2446        #[cfg(target_feature = "frecipe")]
2447        let features = features.with(FRECIPE);
2448        #[cfg(target_feature = "lam-bh")]
2449        let features = features.with(LAM_BH);
2450        #[cfg(target_feature = "lamcas")]
2451        let features = features.with(LAMCAS);
2452        #[cfg(target_feature = "lasx")]
2453        let features = features.with(LASX);
2454        #[cfg(target_feature = "lbt")]
2455        let features = features.with(LBT);
2456        #[cfg(target_feature = "ld-seq-sa")]
2457        let features = features.with(LD_SEQ_SA);
2458        #[cfg(target_feature = "lsx")]
2459        let features = features.with(LSX);
2460        #[cfg(target_feature = "lvz")]
2461        let features = features.with(LVZ);
2462        #[cfg(target_feature = "relax")]
2463        let features = features.with(RELAX);
2464        #[cfg(target_feature = "scq")]
2465        let features = features.with(SCQ);
2466        #[cfg(target_feature = "ual")]
2467        let features = features.with(UAL);
2468        features
2469    }
2470
2471}
2472#[cfg(any(doc, target_arch = "nvptx64"))]
2473#[rustfmt::skip]
2474pub mod nvptx64 {
2475    use super::*;
2476
2477    #[repr(u16)]
2478    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
2479    enum FeatureId {
2480        CRT_STATIC,
2481        PTX70,
2482        PTX71,
2483        PTX72,
2484        PTX73,
2485        PTX74,
2486        PTX75,
2487        PTX76,
2488        PTX77,
2489        PTX78,
2490        PTX80,
2491        PTX81,
2492        PTX82,
2493        PTX83,
2494        PTX84,
2495        PTX85,
2496        PTX86,
2497        PTX87,
2498        SM_100,
2499        SM_100A,
2500        SM_101,
2501        SM_101A,
2502        SM_120,
2503        SM_120A,
2504        SM_70,
2505        SM_72,
2506        SM_75,
2507        SM_80,
2508        SM_86,
2509        SM_87,
2510        SM_89,
2511        SM_90,
2512        SM_90A,
2513    }
2514
2515    macro_rules! feature_set {
2516        ($($feature:ident),* $(,)?) => { {
2517            #[cfg(target_arch = "nvptx64")]
2518            {
2519                let features = TargetFeatures::empty();
2520                $(let features = features.with_bit(FeatureId::$feature as usize);)*
2521                features
2522            }
2523            #[cfg(all(doc, not(target_arch = "nvptx64")))]
2524            {
2525                TargetFeatures::empty()
2526            }
2527        } };
2528    }
2529    #[doc = "Enables C Run-time Libraries to be statically linked."]
2530    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
2531
2532    #[doc = "Use PTX version 70."]
2533    pub const PTX70: TargetFeatures = feature_set!(PTX70);
2534
2535    #[doc = "Use PTX version 71."]
2536    pub const PTX71: TargetFeatures = feature_set!(PTX70, PTX71);
2537
2538    #[doc = "Use PTX version 72."]
2539    pub const PTX72: TargetFeatures = feature_set!(PTX70, PTX71, PTX72);
2540
2541    #[doc = "Use PTX version 73."]
2542    pub const PTX73: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73);
2543
2544    #[doc = "Use PTX version 74."]
2545    pub const PTX74: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74);
2546
2547    #[doc = "Use PTX version 75."]
2548    pub const PTX75: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75);
2549
2550    #[doc = "Use PTX version 76."]
2551    pub const PTX76: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76);
2552
2553    #[doc = "Use PTX version 77."]
2554    pub const PTX77: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76, PTX77);
2555
2556    #[doc = "Use PTX version 78."]
2557    pub const PTX78: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76, PTX77, PTX78);
2558
2559    #[doc = "Use PTX version 80."]
2560    pub const PTX80: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76, PTX77, PTX78, PTX80);
2561
2562    #[doc = "Use PTX version 81."]
2563    pub const PTX81: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76, PTX77, PTX78, PTX80, PTX81);
2564
2565    #[doc = "Use PTX version 82."]
2566    pub const PTX82: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76, PTX77, PTX78, PTX80, PTX81, PTX82);
2567
2568    #[doc = "Use PTX version 83."]
2569    pub const PTX83: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76, PTX77, PTX78, PTX80, PTX81, PTX82, PTX83);
2570
2571    #[doc = "Use PTX version 84."]
2572    pub const PTX84: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76, PTX77, PTX78, PTX80, PTX81, PTX82, PTX83, PTX84);
2573
2574    #[doc = "Use PTX version 85."]
2575    pub const PTX85: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76, PTX77, PTX78, PTX80, PTX81, PTX82, PTX83, PTX84, PTX85);
2576
2577    #[doc = "Use PTX version 86."]
2578    pub const PTX86: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76, PTX77, PTX78, PTX80, PTX81, PTX82, PTX83, PTX84, PTX85, PTX86);
2579
2580    #[doc = "Use PTX version 87."]
2581    pub const PTX87: TargetFeatures = feature_set!(PTX70, PTX71, PTX72, PTX73, PTX74, PTX75, PTX76, PTX77, PTX78, PTX80, PTX81, PTX82, PTX83, PTX84, PTX85, PTX86, PTX87);
2582
2583    #[doc = "Target SM 100."]
2584    pub const SM_100: TargetFeatures = feature_set!(SM_100, SM_70, SM_72, SM_75, SM_80, SM_86, SM_87, SM_89, SM_90);
2585
2586    #[doc = "Target SM 100a."]
2587    pub const SM_100A: TargetFeatures = feature_set!(SM_100, SM_100A, SM_70, SM_72, SM_75, SM_80, SM_86, SM_87, SM_89, SM_90);
2588
2589    #[doc = "Target SM 101."]
2590    pub const SM_101: TargetFeatures = feature_set!(SM_100, SM_101, SM_70, SM_72, SM_75, SM_80, SM_86, SM_87, SM_89, SM_90);
2591
2592    #[doc = "Target SM 101a."]
2593    pub const SM_101A: TargetFeatures = feature_set!(SM_100, SM_101, SM_101A, SM_70, SM_72, SM_75, SM_80, SM_86, SM_87, SM_89, SM_90);
2594
2595    #[doc = "Target SM 120."]
2596    pub const SM_120: TargetFeatures = feature_set!(SM_100, SM_101, SM_120, SM_70, SM_72, SM_75, SM_80, SM_86, SM_87, SM_89, SM_90);
2597
2598    #[doc = "Target SM 120a."]
2599    pub const SM_120A: TargetFeatures = feature_set!(SM_100, SM_101, SM_120, SM_120A, SM_70, SM_72, SM_75, SM_80, SM_86, SM_87, SM_89, SM_90);
2600
2601    #[doc = "Target SM 70."]
2602    pub const SM_70: TargetFeatures = feature_set!(SM_70);
2603
2604    #[doc = "Target SM 72."]
2605    pub const SM_72: TargetFeatures = feature_set!(SM_70, SM_72);
2606
2607    #[doc = "Target SM 75."]
2608    pub const SM_75: TargetFeatures = feature_set!(SM_70, SM_72, SM_75);
2609
2610    #[doc = "Target SM 80."]
2611    pub const SM_80: TargetFeatures = feature_set!(SM_70, SM_72, SM_75, SM_80);
2612
2613    #[doc = "Target SM 86."]
2614    pub const SM_86: TargetFeatures = feature_set!(SM_70, SM_72, SM_75, SM_80, SM_86);
2615
2616    #[doc = "Target SM 87."]
2617    pub const SM_87: TargetFeatures = feature_set!(SM_70, SM_72, SM_75, SM_80, SM_86, SM_87);
2618
2619    #[doc = "Target SM 89."]
2620    pub const SM_89: TargetFeatures = feature_set!(SM_70, SM_72, SM_75, SM_80, SM_86, SM_87, SM_89);
2621
2622    #[doc = "Target SM 90."]
2623    pub const SM_90: TargetFeatures = feature_set!(SM_70, SM_72, SM_75, SM_80, SM_86, SM_87, SM_89, SM_90);
2624
2625    #[doc = "Target SM 90a."]
2626    pub const SM_90A: TargetFeatures = feature_set!(SM_70, SM_72, SM_75, SM_80, SM_86, SM_87, SM_89, SM_90, SM_90A);
2627
2628
2629    #[cfg(target_arch = "nvptx64")]
2630    pub(crate) const FEATURES: &[FeatureData] = &[
2631        FeatureData::new("crt-static", CRT_STATIC),
2632        FeatureData::new("ptx70", PTX70),
2633        FeatureData::new("ptx71", PTX71),
2634        FeatureData::new("ptx72", PTX72),
2635        FeatureData::new("ptx73", PTX73),
2636        FeatureData::new("ptx74", PTX74),
2637        FeatureData::new("ptx75", PTX75),
2638        FeatureData::new("ptx76", PTX76),
2639        FeatureData::new("ptx77", PTX77),
2640        FeatureData::new("ptx78", PTX78),
2641        FeatureData::new("ptx80", PTX80),
2642        FeatureData::new("ptx81", PTX81),
2643        FeatureData::new("ptx82", PTX82),
2644        FeatureData::new("ptx83", PTX83),
2645        FeatureData::new("ptx84", PTX84),
2646        FeatureData::new("ptx85", PTX85),
2647        FeatureData::new("ptx86", PTX86),
2648        FeatureData::new("ptx87", PTX87),
2649        FeatureData::new("sm_100", SM_100),
2650        FeatureData::new("sm_100a", SM_100A),
2651        FeatureData::new("sm_101", SM_101),
2652        FeatureData::new("sm_101a", SM_101A),
2653        FeatureData::new("sm_120", SM_120),
2654        FeatureData::new("sm_120a", SM_120A),
2655        FeatureData::new("sm_70", SM_70),
2656        FeatureData::new("sm_72", SM_72),
2657        FeatureData::new("sm_75", SM_75),
2658        FeatureData::new("sm_80", SM_80),
2659        FeatureData::new("sm_86", SM_86),
2660        FeatureData::new("sm_87", SM_87),
2661        FeatureData::new("sm_89", SM_89),
2662        FeatureData::new("sm_90", SM_90),
2663        FeatureData::new("sm_90a", SM_90A),
2664    ];
2665
2666    #[cfg(target_arch = "nvptx64")]
2667    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
2668    pub(crate) const fn enabled_for_target() -> TargetFeatures {
2669        let features = TargetFeatures::empty();
2670        #[cfg(target_feature = "crt-static")]
2671        let features = features.with(CRT_STATIC);
2672        #[cfg(target_feature = "ptx70")]
2673        let features = features.with(PTX70);
2674        #[cfg(target_feature = "ptx71")]
2675        let features = features.with(PTX71);
2676        #[cfg(target_feature = "ptx72")]
2677        let features = features.with(PTX72);
2678        #[cfg(target_feature = "ptx73")]
2679        let features = features.with(PTX73);
2680        #[cfg(target_feature = "ptx74")]
2681        let features = features.with(PTX74);
2682        #[cfg(target_feature = "ptx75")]
2683        let features = features.with(PTX75);
2684        #[cfg(target_feature = "ptx76")]
2685        let features = features.with(PTX76);
2686        #[cfg(target_feature = "ptx77")]
2687        let features = features.with(PTX77);
2688        #[cfg(target_feature = "ptx78")]
2689        let features = features.with(PTX78);
2690        #[cfg(target_feature = "ptx80")]
2691        let features = features.with(PTX80);
2692        #[cfg(target_feature = "ptx81")]
2693        let features = features.with(PTX81);
2694        #[cfg(target_feature = "ptx82")]
2695        let features = features.with(PTX82);
2696        #[cfg(target_feature = "ptx83")]
2697        let features = features.with(PTX83);
2698        #[cfg(target_feature = "ptx84")]
2699        let features = features.with(PTX84);
2700        #[cfg(target_feature = "ptx85")]
2701        let features = features.with(PTX85);
2702        #[cfg(target_feature = "ptx86")]
2703        let features = features.with(PTX86);
2704        #[cfg(target_feature = "ptx87")]
2705        let features = features.with(PTX87);
2706        #[cfg(target_feature = "sm_100")]
2707        let features = features.with(SM_100);
2708        #[cfg(target_feature = "sm_100a")]
2709        let features = features.with(SM_100A);
2710        #[cfg(target_feature = "sm_101")]
2711        let features = features.with(SM_101);
2712        #[cfg(target_feature = "sm_101a")]
2713        let features = features.with(SM_101A);
2714        #[cfg(target_feature = "sm_120")]
2715        let features = features.with(SM_120);
2716        #[cfg(target_feature = "sm_120a")]
2717        let features = features.with(SM_120A);
2718        #[cfg(target_feature = "sm_70")]
2719        let features = features.with(SM_70);
2720        #[cfg(target_feature = "sm_72")]
2721        let features = features.with(SM_72);
2722        #[cfg(target_feature = "sm_75")]
2723        let features = features.with(SM_75);
2724        #[cfg(target_feature = "sm_80")]
2725        let features = features.with(SM_80);
2726        #[cfg(target_feature = "sm_86")]
2727        let features = features.with(SM_86);
2728        #[cfg(target_feature = "sm_87")]
2729        let features = features.with(SM_87);
2730        #[cfg(target_feature = "sm_89")]
2731        let features = features.with(SM_89);
2732        #[cfg(target_feature = "sm_90")]
2733        let features = features.with(SM_90);
2734        #[cfg(target_feature = "sm_90a")]
2735        let features = features.with(SM_90A);
2736        features
2737    }
2738
2739}
2740#[cfg(any(doc, target_arch = "powerpc"))]
2741#[rustfmt::skip]
2742pub mod powerpc {
2743    use super::*;
2744
2745    #[repr(u16)]
2746    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
2747    enum FeatureId {
2748        ALTIVEC,
2749        CRT_STATIC,
2750        MSYNC,
2751        PARTWORD_ATOMICS,
2752        POWER10_VECTOR,
2753        POWER8_ALTIVEC,
2754        POWER8_CRYPTO,
2755        POWER8_VECTOR,
2756        POWER9_ALTIVEC,
2757        POWER9_VECTOR,
2758        QUADWORD_ATOMICS,
2759        VSX,
2760    }
2761
2762    macro_rules! feature_set {
2763        ($($feature:ident),* $(,)?) => { {
2764            #[cfg(target_arch = "powerpc")]
2765            {
2766                let features = TargetFeatures::empty();
2767                $(let features = features.with_bit(FeatureId::$feature as usize);)*
2768                features
2769            }
2770            #[cfg(all(doc, not(target_arch = "powerpc")))]
2771            {
2772                TargetFeatures::empty()
2773            }
2774        } };
2775    }
2776    #[doc = "Enable Altivec instructions."]
2777    pub const ALTIVEC: TargetFeatures = feature_set!(ALTIVEC);
2778
2779    #[doc = "Enables C Run-time Libraries to be statically linked."]
2780    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
2781
2782    #[doc = "Has only the msync instruction instead of sync."]
2783    pub const MSYNC: TargetFeatures = feature_set!(MSYNC);
2784
2785    #[doc = "Enable l\\[bh\\]arx and st\\[bh\\]cx.."]
2786    pub const PARTWORD_ATOMICS: TargetFeatures = feature_set!(PARTWORD_ATOMICS);
2787
2788    #[doc = "Enable POWER10 vector instructions."]
2789    pub const POWER10_VECTOR: TargetFeatures = feature_set!(ALTIVEC, POWER10_VECTOR, POWER8_ALTIVEC, POWER8_VECTOR, POWER9_ALTIVEC, POWER9_VECTOR, VSX);
2790
2791    #[doc = "Enable POWER8 Altivec instructions."]
2792    pub const POWER8_ALTIVEC: TargetFeatures = feature_set!(ALTIVEC, POWER8_ALTIVEC);
2793
2794    #[doc = "Enable POWER8 Crypto instructions."]
2795    pub const POWER8_CRYPTO: TargetFeatures = feature_set!(ALTIVEC, POWER8_ALTIVEC, POWER8_CRYPTO);
2796
2797    #[doc = "Enable POWER8 vector instructions."]
2798    pub const POWER8_VECTOR: TargetFeatures = feature_set!(ALTIVEC, POWER8_ALTIVEC, POWER8_VECTOR, VSX);
2799
2800    #[doc = "Enable POWER9 Altivec instructions."]
2801    pub const POWER9_ALTIVEC: TargetFeatures = feature_set!(ALTIVEC, POWER8_ALTIVEC, POWER9_ALTIVEC);
2802
2803    #[doc = "Enable POWER9 vector instructions."]
2804    pub const POWER9_VECTOR: TargetFeatures = feature_set!(ALTIVEC, POWER8_ALTIVEC, POWER8_VECTOR, POWER9_ALTIVEC, POWER9_VECTOR, VSX);
2805
2806    #[doc = "Enable lqarx and stqcx.."]
2807    pub const QUADWORD_ATOMICS: TargetFeatures = feature_set!(QUADWORD_ATOMICS);
2808
2809    #[doc = "Enable VSX instructions."]
2810    pub const VSX: TargetFeatures = feature_set!(ALTIVEC, VSX);
2811
2812
2813    #[cfg(target_arch = "powerpc")]
2814    pub(crate) const FEATURES: &[FeatureData] = &[
2815        FeatureData::new("altivec", ALTIVEC),
2816        FeatureData::new("crt-static", CRT_STATIC),
2817        FeatureData::new("msync", MSYNC),
2818        FeatureData::new("partword-atomics", PARTWORD_ATOMICS),
2819        FeatureData::new("power10-vector", POWER10_VECTOR),
2820        FeatureData::new("power8-altivec", POWER8_ALTIVEC),
2821        FeatureData::new("power8-crypto", POWER8_CRYPTO),
2822        FeatureData::new("power8-vector", POWER8_VECTOR),
2823        FeatureData::new("power9-altivec", POWER9_ALTIVEC),
2824        FeatureData::new("power9-vector", POWER9_VECTOR),
2825        FeatureData::new("quadword-atomics", QUADWORD_ATOMICS),
2826        FeatureData::new("vsx", VSX),
2827    ];
2828
2829    #[cfg(target_arch = "powerpc")]
2830    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
2831    pub(crate) const fn enabled_for_target() -> TargetFeatures {
2832        let features = TargetFeatures::empty();
2833        #[cfg(target_feature = "altivec")]
2834        let features = features.with(ALTIVEC);
2835        #[cfg(target_feature = "crt-static")]
2836        let features = features.with(CRT_STATIC);
2837        #[cfg(target_feature = "msync")]
2838        let features = features.with(MSYNC);
2839        #[cfg(target_feature = "partword-atomics")]
2840        let features = features.with(PARTWORD_ATOMICS);
2841        #[cfg(target_feature = "power10-vector")]
2842        let features = features.with(POWER10_VECTOR);
2843        #[cfg(target_feature = "power8-altivec")]
2844        let features = features.with(POWER8_ALTIVEC);
2845        #[cfg(target_feature = "power8-crypto")]
2846        let features = features.with(POWER8_CRYPTO);
2847        #[cfg(target_feature = "power8-vector")]
2848        let features = features.with(POWER8_VECTOR);
2849        #[cfg(target_feature = "power9-altivec")]
2850        let features = features.with(POWER9_ALTIVEC);
2851        #[cfg(target_feature = "power9-vector")]
2852        let features = features.with(POWER9_VECTOR);
2853        #[cfg(target_feature = "quadword-atomics")]
2854        let features = features.with(QUADWORD_ATOMICS);
2855        #[cfg(target_feature = "vsx")]
2856        let features = features.with(VSX);
2857        features
2858    }
2859
2860}
2861#[cfg(any(doc, target_arch = "powerpc64"))]
2862#[rustfmt::skip]
2863pub mod powerpc64 {
2864    use super::*;
2865
2866    #[repr(u16)]
2867    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
2868    enum FeatureId {
2869        ALTIVEC,
2870        CRT_STATIC,
2871        MSYNC,
2872        PARTWORD_ATOMICS,
2873        POWER10_VECTOR,
2874        POWER8_ALTIVEC,
2875        POWER8_CRYPTO,
2876        POWER8_VECTOR,
2877        POWER9_ALTIVEC,
2878        POWER9_VECTOR,
2879        QUADWORD_ATOMICS,
2880        VSX,
2881    }
2882
2883    macro_rules! feature_set {
2884        ($($feature:ident),* $(,)?) => { {
2885            #[cfg(target_arch = "powerpc64")]
2886            {
2887                let features = TargetFeatures::empty();
2888                $(let features = features.with_bit(FeatureId::$feature as usize);)*
2889                features
2890            }
2891            #[cfg(all(doc, not(target_arch = "powerpc64")))]
2892            {
2893                TargetFeatures::empty()
2894            }
2895        } };
2896    }
2897    #[doc = "Enable Altivec instructions."]
2898    pub const ALTIVEC: TargetFeatures = feature_set!(ALTIVEC);
2899
2900    #[doc = "Enables C Run-time Libraries to be statically linked."]
2901    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
2902
2903    #[doc = "Has only the msync instruction instead of sync."]
2904    pub const MSYNC: TargetFeatures = feature_set!(MSYNC);
2905
2906    #[doc = "Enable l\\[bh\\]arx and st\\[bh\\]cx.."]
2907    pub const PARTWORD_ATOMICS: TargetFeatures = feature_set!(PARTWORD_ATOMICS);
2908
2909    #[doc = "Enable POWER10 vector instructions."]
2910    pub const POWER10_VECTOR: TargetFeatures = feature_set!(ALTIVEC, POWER10_VECTOR, POWER8_ALTIVEC, POWER8_VECTOR, POWER9_ALTIVEC, POWER9_VECTOR, VSX);
2911
2912    #[doc = "Enable POWER8 Altivec instructions."]
2913    pub const POWER8_ALTIVEC: TargetFeatures = feature_set!(ALTIVEC, POWER8_ALTIVEC);
2914
2915    #[doc = "Enable POWER8 Crypto instructions."]
2916    pub const POWER8_CRYPTO: TargetFeatures = feature_set!(ALTIVEC, POWER8_ALTIVEC, POWER8_CRYPTO);
2917
2918    #[doc = "Enable POWER8 vector instructions."]
2919    pub const POWER8_VECTOR: TargetFeatures = feature_set!(ALTIVEC, POWER8_ALTIVEC, POWER8_VECTOR, VSX);
2920
2921    #[doc = "Enable POWER9 Altivec instructions."]
2922    pub const POWER9_ALTIVEC: TargetFeatures = feature_set!(ALTIVEC, POWER8_ALTIVEC, POWER9_ALTIVEC);
2923
2924    #[doc = "Enable POWER9 vector instructions."]
2925    pub const POWER9_VECTOR: TargetFeatures = feature_set!(ALTIVEC, POWER8_ALTIVEC, POWER8_VECTOR, POWER9_ALTIVEC, POWER9_VECTOR, VSX);
2926
2927    #[doc = "Enable lqarx and stqcx.."]
2928    pub const QUADWORD_ATOMICS: TargetFeatures = feature_set!(QUADWORD_ATOMICS);
2929
2930    #[doc = "Enable VSX instructions."]
2931    pub const VSX: TargetFeatures = feature_set!(ALTIVEC, VSX);
2932
2933
2934    #[cfg(target_arch = "powerpc64")]
2935    pub(crate) const FEATURES: &[FeatureData] = &[
2936        FeatureData::new("altivec", ALTIVEC),
2937        FeatureData::new("crt-static", CRT_STATIC),
2938        FeatureData::new("msync", MSYNC),
2939        FeatureData::new("partword-atomics", PARTWORD_ATOMICS),
2940        FeatureData::new("power10-vector", POWER10_VECTOR),
2941        FeatureData::new("power8-altivec", POWER8_ALTIVEC),
2942        FeatureData::new("power8-crypto", POWER8_CRYPTO),
2943        FeatureData::new("power8-vector", POWER8_VECTOR),
2944        FeatureData::new("power9-altivec", POWER9_ALTIVEC),
2945        FeatureData::new("power9-vector", POWER9_VECTOR),
2946        FeatureData::new("quadword-atomics", QUADWORD_ATOMICS),
2947        FeatureData::new("vsx", VSX),
2948    ];
2949
2950    #[cfg(target_arch = "powerpc64")]
2951    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
2952    pub(crate) const fn enabled_for_target() -> TargetFeatures {
2953        let features = TargetFeatures::empty();
2954        #[cfg(target_feature = "altivec")]
2955        let features = features.with(ALTIVEC);
2956        #[cfg(target_feature = "crt-static")]
2957        let features = features.with(CRT_STATIC);
2958        #[cfg(target_feature = "msync")]
2959        let features = features.with(MSYNC);
2960        #[cfg(target_feature = "partword-atomics")]
2961        let features = features.with(PARTWORD_ATOMICS);
2962        #[cfg(target_feature = "power10-vector")]
2963        let features = features.with(POWER10_VECTOR);
2964        #[cfg(target_feature = "power8-altivec")]
2965        let features = features.with(POWER8_ALTIVEC);
2966        #[cfg(target_feature = "power8-crypto")]
2967        let features = features.with(POWER8_CRYPTO);
2968        #[cfg(target_feature = "power8-vector")]
2969        let features = features.with(POWER8_VECTOR);
2970        #[cfg(target_feature = "power9-altivec")]
2971        let features = features.with(POWER9_ALTIVEC);
2972        #[cfg(target_feature = "power9-vector")]
2973        let features = features.with(POWER9_VECTOR);
2974        #[cfg(target_feature = "quadword-atomics")]
2975        let features = features.with(QUADWORD_ATOMICS);
2976        #[cfg(target_feature = "vsx")]
2977        let features = features.with(VSX);
2978        features
2979    }
2980
2981}
2982#[cfg(any(doc, target_arch = "riscv32"))]
2983#[rustfmt::skip]
2984pub mod riscv32 {
2985    use super::*;
2986
2987    #[repr(u16)]
2988    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
2989    enum FeatureId {
2990        A,
2991        B,
2992        C,
2993        CRT_STATIC,
2994        D,
2995        E,
2996        F,
2997        M,
2998        RELAX,
2999        RVA23U64,
3000        SUPM,
3001        UNALIGNED_SCALAR_MEM,
3002        UNALIGNED_VECTOR_MEM,
3003        V,
3004        ZA128RS,
3005        ZA64RS,
3006        ZAAMO,
3007        ZABHA,
3008        ZACAS,
3009        ZALRSC,
3010        ZAMA16B,
3011        ZAWRS,
3012        ZBA,
3013        ZBB,
3014        ZBC,
3015        ZBKB,
3016        ZBKC,
3017        ZBKX,
3018        ZBS,
3019        ZCA,
3020        ZCB,
3021        ZCMOP,
3022        ZDINX,
3023        ZFA,
3024        ZFBFMIN,
3025        ZFH,
3026        ZFHMIN,
3027        ZFINX,
3028        ZHINX,
3029        ZHINXMIN,
3030        ZIC64B,
3031        ZICBOM,
3032        ZICBOP,
3033        ZICBOZ,
3034        ZICCAMOA,
3035        ZICCIF,
3036        ZICCLSM,
3037        ZICCRSE,
3038        ZICNTR,
3039        ZICOND,
3040        ZICSR,
3041        ZIFENCEI,
3042        ZIHINTNTL,
3043        ZIHINTPAUSE,
3044        ZIHPM,
3045        ZIMOP,
3046        ZK,
3047        ZKN,
3048        ZKND,
3049        ZKNE,
3050        ZKNH,
3051        ZKR,
3052        ZKS,
3053        ZKSED,
3054        ZKSH,
3055        ZKT,
3056        ZTSO,
3057        ZVBB,
3058        ZVBC,
3059        ZVE32F,
3060        ZVE32X,
3061        ZVE64D,
3062        ZVE64F,
3063        ZVE64X,
3064        ZVFBFMIN,
3065        ZVFBFWMA,
3066        ZVFH,
3067        ZVFHMIN,
3068        ZVKB,
3069        ZVKG,
3070        ZVKN,
3071        ZVKNC,
3072        ZVKNED,
3073        ZVKNG,
3074        ZVKNHA,
3075        ZVKNHB,
3076        ZVKS,
3077        ZVKSC,
3078        ZVKSED,
3079        ZVKSG,
3080        ZVKSH,
3081        ZVKT,
3082        ZVL1024B,
3083        ZVL128B,
3084        ZVL16384B,
3085        ZVL2048B,
3086        ZVL256B,
3087        ZVL32768B,
3088        ZVL32B,
3089        ZVL4096B,
3090        ZVL512B,
3091        ZVL64B,
3092        ZVL65536B,
3093        ZVL8192B,
3094    }
3095
3096    macro_rules! feature_set {
3097        ($($feature:ident),* $(,)?) => { {
3098            #[cfg(target_arch = "riscv32")]
3099            {
3100                let features = TargetFeatures::empty();
3101                $(let features = features.with_bit(FeatureId::$feature as usize);)*
3102                features
3103            }
3104            #[cfg(all(doc, not(target_arch = "riscv32")))]
3105            {
3106                TargetFeatures::empty()
3107            }
3108        } };
3109    }
3110    #[doc = "'A' (Atomic Instructions)."]
3111    pub const A: TargetFeatures = feature_set!(A, ZAAMO, ZALRSC);
3112
3113    #[doc = "'B' (the collection of the Zba, Zbb, Zbs extensions)."]
3114    pub const B: TargetFeatures = feature_set!(B, ZBA, ZBB, ZBS);
3115
3116    #[doc = "'C' (Compressed Instructions)."]
3117    pub const C: TargetFeatures = feature_set!(C, ZCA);
3118
3119    #[doc = "Enables C Run-time Libraries to be statically linked."]
3120    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
3121
3122    #[doc = "'D' (Double-Precision Floating-Point)."]
3123    pub const D: TargetFeatures = feature_set!(D, F, ZICSR);
3124
3125    #[doc = "'E' (Embedded Instruction Set with 16 GPRs)."]
3126    pub const E: TargetFeatures = feature_set!(E);
3127
3128    #[doc = "'F' (Single-Precision Floating-Point)."]
3129    pub const F: TargetFeatures = feature_set!(F, ZICSR);
3130
3131    #[doc = "'M' (Integer Multiplication and Division)."]
3132    pub const M: TargetFeatures = feature_set!(M);
3133
3134    #[doc = "Enable Linker relaxation."]
3135    pub const RELAX: TargetFeatures = feature_set!(RELAX);
3136
3137    #[doc = "RISC-V rva23u64 profile."]
3138    pub const RVA23U64: TargetFeatures = feature_set!(A, B, C, D, F, M, RVA23U64, SUPM, V, ZA128RS, ZA64RS, ZAAMO, ZALRSC, ZAWRS, ZBA, ZBB, ZBS, ZCA, ZCB, ZCMOP, ZFA, ZFHMIN, ZIC64B, ZICBOM, ZICBOP, ZICBOZ, ZICCAMOA, ZICCIF, ZICCLSM, ZICCRSE, ZICNTR, ZICOND, ZICSR, ZIHINTNTL, ZIHINTPAUSE, ZIHPM, ZIMOP, ZKT, ZVBB, ZVE32F, ZVE32X, ZVE64D, ZVE64F, ZVE64X, ZVFHMIN, ZVKB, ZVKT, ZVL128B, ZVL32B, ZVL64B);
3139
3140    #[doc = "'Supm' (Indicates User-mode Pointer Masking)."]
3141    pub const SUPM: TargetFeatures = feature_set!(SUPM);
3142
3143    #[doc = "Has reasonably performant unaligned scalar loads and stores."]
3144    pub const UNALIGNED_SCALAR_MEM: TargetFeatures = feature_set!(UNALIGNED_SCALAR_MEM);
3145
3146    #[doc = "Has reasonably performant unaligned vector loads and stores."]
3147    pub const UNALIGNED_VECTOR_MEM: TargetFeatures = feature_set!(UNALIGNED_VECTOR_MEM);
3148
3149    #[doc = "'V' (Vector Extension for Application Processors)."]
3150    pub const V: TargetFeatures = feature_set!(D, F, V, ZICSR, ZVE32F, ZVE32X, ZVE64D, ZVE64F, ZVE64X, ZVL128B, ZVL32B, ZVL64B);
3151
3152    #[doc = "'Za128rs' (Reservation Set Size of at Most 128 Bytes)."]
3153    pub const ZA128RS: TargetFeatures = feature_set!(ZA128RS);
3154
3155    #[doc = "'Za64rs' (Reservation Set Size of at Most 64 Bytes)."]
3156    pub const ZA64RS: TargetFeatures = feature_set!(ZA128RS, ZA64RS);
3157
3158    #[doc = "'Zaamo' (Atomic Memory Operations)."]
3159    pub const ZAAMO: TargetFeatures = feature_set!(ZAAMO);
3160
3161    #[doc = "'Zabha' (Byte and Halfword Atomic Memory Operations)."]
3162    pub const ZABHA: TargetFeatures = feature_set!(ZAAMO, ZABHA);
3163
3164    #[doc = "'Zacas' (Atomic Compare-And-Swap Instructions)."]
3165    pub const ZACAS: TargetFeatures = feature_set!(ZAAMO, ZACAS);
3166
3167    #[doc = "'Zalrsc' (Load-Reserved/Store-Conditional)."]
3168    pub const ZALRSC: TargetFeatures = feature_set!(ZALRSC);
3169
3170    #[doc = "'Zama16b' (Atomic 16-byte misaligned loads, stores and AMOs)."]
3171    pub const ZAMA16B: TargetFeatures = feature_set!(ZAMA16B);
3172
3173    #[doc = "'Zawrs' (Wait on Reservation Set)."]
3174    pub const ZAWRS: TargetFeatures = feature_set!(ZAWRS);
3175
3176    #[doc = "'Zba' (Address Generation Instructions)."]
3177    pub const ZBA: TargetFeatures = feature_set!(ZBA);
3178
3179    #[doc = "'Zbb' (Basic Bit-Manipulation)."]
3180    pub const ZBB: TargetFeatures = feature_set!(ZBB);
3181
3182    #[doc = "'Zbc' (Carry-Less Multiplication)."]
3183    pub const ZBC: TargetFeatures = feature_set!(ZBC, ZBKC);
3184
3185    #[doc = "'Zbkb' (Bitmanip instructions for Cryptography)."]
3186    pub const ZBKB: TargetFeatures = feature_set!(ZBKB);
3187
3188    #[doc = "'Zbkc' (Carry-less multiply instructions for Cryptography)."]
3189    pub const ZBKC: TargetFeatures = feature_set!(ZBKC);
3190
3191    #[doc = "'Zbkx' (Crossbar permutation instructions)."]
3192    pub const ZBKX: TargetFeatures = feature_set!(ZBKX);
3193
3194    #[doc = "'Zbs' (Single-Bit Instructions)."]
3195    pub const ZBS: TargetFeatures = feature_set!(ZBS);
3196
3197    #[doc = "'Zca' (part of the C extension, excluding compressed floating point loads/stores)."]
3198    pub const ZCA: TargetFeatures = feature_set!(ZCA);
3199
3200    #[doc = "'Zcb' (Compressed basic bit manipulation instructions)."]
3201    pub const ZCB: TargetFeatures = feature_set!(ZCA, ZCB);
3202
3203    #[doc = "'Zcmop' (Compressed May-Be-Operations)."]
3204    pub const ZCMOP: TargetFeatures = feature_set!(ZCA, ZCMOP);
3205
3206    #[doc = "'Zdinx' (Double in Integer)."]
3207    pub const ZDINX: TargetFeatures = feature_set!(ZDINX, ZFINX, ZICSR);
3208
3209    #[doc = "'Zfa' (Additional Floating-Point)."]
3210    pub const ZFA: TargetFeatures = feature_set!(F, ZFA, ZICSR);
3211
3212    #[doc = "'Zfbfmin' (Scalar BF16 Converts)."]
3213    pub const ZFBFMIN: TargetFeatures = feature_set!(F, ZFBFMIN, ZICSR);
3214
3215    #[doc = "'Zfh' (Half-Precision Floating-Point)."]
3216    pub const ZFH: TargetFeatures = feature_set!(F, ZFH, ZFHMIN, ZICSR);
3217
3218    #[doc = "'Zfhmin' (Half-Precision Floating-Point Minimal)."]
3219    pub const ZFHMIN: TargetFeatures = feature_set!(F, ZFHMIN, ZICSR);
3220
3221    #[doc = "'Zfinx' (Float in Integer)."]
3222    pub const ZFINX: TargetFeatures = feature_set!(ZFINX, ZICSR);
3223
3224    #[doc = "'Zhinx' (Half Float in Integer)."]
3225    pub const ZHINX: TargetFeatures = feature_set!(ZFINX, ZHINX, ZHINXMIN, ZICSR);
3226
3227    #[doc = "'Zhinxmin' (Half Float in Integer Minimal)."]
3228    pub const ZHINXMIN: TargetFeatures = feature_set!(ZFINX, ZHINXMIN, ZICSR);
3229
3230    #[doc = "'Zic64b' (Cache Block Size Is 64 Bytes)."]
3231    pub const ZIC64B: TargetFeatures = feature_set!(ZIC64B);
3232
3233    #[doc = "'Zicbom' (Cache-Block Management Instructions)."]
3234    pub const ZICBOM: TargetFeatures = feature_set!(ZICBOM);
3235
3236    #[doc = "'Zicbop' (Cache-Block Prefetch Instructions)."]
3237    pub const ZICBOP: TargetFeatures = feature_set!(ZICBOP);
3238
3239    #[doc = "'Zicboz' (Cache-Block Zero Instructions)."]
3240    pub const ZICBOZ: TargetFeatures = feature_set!(ZICBOZ);
3241
3242    #[doc = "'Ziccamoa' (Main Memory Supports All Atomics in A)."]
3243    pub const ZICCAMOA: TargetFeatures = feature_set!(ZICCAMOA);
3244
3245    #[doc = "'Ziccif' (Main Memory Supports Instruction Fetch with Atomicity Requirement)."]
3246    pub const ZICCIF: TargetFeatures = feature_set!(ZICCIF);
3247
3248    #[doc = "'Zicclsm' (Main Memory Supports Misaligned Loads/Stores)."]
3249    pub const ZICCLSM: TargetFeatures = feature_set!(ZICCLSM);
3250
3251    #[doc = "'Ziccrse' (Main Memory Supports Forward Progress on LR/SC Sequences)."]
3252    pub const ZICCRSE: TargetFeatures = feature_set!(ZICCRSE);
3253
3254    #[doc = "'Zicntr' (Base Counters and Timers)."]
3255    pub const ZICNTR: TargetFeatures = feature_set!(ZICNTR, ZICSR);
3256
3257    #[doc = "'Zicond' (Integer Conditional Operations)."]
3258    pub const ZICOND: TargetFeatures = feature_set!(ZICOND);
3259
3260    #[doc = "'Zicsr' (CSRs)."]
3261    pub const ZICSR: TargetFeatures = feature_set!(ZICSR);
3262
3263    #[doc = "'Zifencei' (fence.i)."]
3264    pub const ZIFENCEI: TargetFeatures = feature_set!(ZIFENCEI);
3265
3266    #[doc = "'Zihintntl' (Non-Temporal Locality Hints)."]
3267    pub const ZIHINTNTL: TargetFeatures = feature_set!(ZIHINTNTL);
3268
3269    #[doc = "'Zihintpause' (Pause Hint)."]
3270    pub const ZIHINTPAUSE: TargetFeatures = feature_set!(ZIHINTPAUSE);
3271
3272    #[doc = "'Zihpm' (Hardware Performance Counters)."]
3273    pub const ZIHPM: TargetFeatures = feature_set!(ZICSR, ZIHPM);
3274
3275    #[doc = "'Zimop' (May-Be-Operations)."]
3276    pub const ZIMOP: TargetFeatures = feature_set!(ZIMOP);
3277
3278    #[doc = "'Zk' (Standard scalar cryptography extension)."]
3279    pub const ZK: TargetFeatures = feature_set!(ZBKB, ZBKC, ZBKX, ZK, ZKN, ZKND, ZKNE, ZKNH, ZKR, ZKT);
3280
3281    #[doc = "'Zkn' (NIST Algorithm Suite)."]
3282    pub const ZKN: TargetFeatures = feature_set!(ZBKB, ZBKC, ZBKX, ZKN, ZKND, ZKNE, ZKNH);
3283
3284    #[doc = "'Zknd' (NIST Suite: AES Decryption)."]
3285    pub const ZKND: TargetFeatures = feature_set!(ZKND);
3286
3287    #[doc = "'Zkne' (NIST Suite: AES Encryption)."]
3288    pub const ZKNE: TargetFeatures = feature_set!(ZKNE);
3289
3290    #[doc = "'Zknh' (NIST Suite: Hash Function Instructions)."]
3291    pub const ZKNH: TargetFeatures = feature_set!(ZKNH);
3292
3293    #[doc = "'Zkr' (Entropy Source Extension)."]
3294    pub const ZKR: TargetFeatures = feature_set!(ZKR);
3295
3296    #[doc = "'Zks' (ShangMi Algorithm Suite)."]
3297    pub const ZKS: TargetFeatures = feature_set!(ZBKB, ZBKC, ZBKX, ZKS, ZKSED, ZKSH);
3298
3299    #[doc = "'Zksed' (ShangMi Suite: SM4 Block Cipher Instructions)."]
3300    pub const ZKSED: TargetFeatures = feature_set!(ZKSED);
3301
3302    #[doc = "'Zksh' (ShangMi Suite: SM3 Hash Function Instructions)."]
3303    pub const ZKSH: TargetFeatures = feature_set!(ZKSH);
3304
3305    #[doc = "'Zkt' (Data Independent Execution Latency)."]
3306    pub const ZKT: TargetFeatures = feature_set!(ZKT);
3307
3308    #[doc = "'Ztso' (Memory Model"]
3309    pub const ZTSO: TargetFeatures = feature_set!(ZTSO);
3310
3311    #[doc = "'Zvbb' (Vector basic bit-manipulation instructions)."]
3312    pub const ZVBB: TargetFeatures = feature_set!(ZICSR, ZVBB, ZVE32X, ZVKB, ZVL32B);
3313
3314    #[doc = "'Zvbc' (Vector Carryless Multiplication)."]
3315    pub const ZVBC: TargetFeatures = feature_set!(ZICSR, ZVBC, ZVE32X, ZVE64X, ZVL32B, ZVL64B);
3316
3317    #[doc = "'Zve32f' (Vector Extensions for Embedded Processors with maximal 32 EEW and F extension)."]
3318    pub const ZVE32F: TargetFeatures = feature_set!(F, ZICSR, ZVE32F, ZVE32X, ZVL32B);
3319
3320    #[doc = "'Zve32x' (Vector Extensions for Embedded Processors with maximal 32 EEW)."]
3321    pub const ZVE32X: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVL32B);
3322
3323    #[doc = "'Zve64d' (Vector Extensions for Embedded Processors with maximal 64 EEW, F and D extension)."]
3324    pub const ZVE64D: TargetFeatures = feature_set!(D, F, ZICSR, ZVE32F, ZVE32X, ZVE64D, ZVE64F, ZVE64X, ZVL32B, ZVL64B);
3325
3326    #[doc = "'Zve64f' (Vector Extensions for Embedded Processors with maximal 64 EEW and F extension)."]
3327    pub const ZVE64F: TargetFeatures = feature_set!(F, ZICSR, ZVE32F, ZVE32X, ZVE64F, ZVE64X, ZVL32B, ZVL64B);
3328
3329    #[doc = "'Zve64x' (Vector Extensions for Embedded Processors with maximal 64 EEW)."]
3330    pub const ZVE64X: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVE64X, ZVL32B, ZVL64B);
3331
3332    #[doc = "'Zvfbfmin' (Vector BF16 Converts)."]
3333    pub const ZVFBFMIN: TargetFeatures = feature_set!(F, ZICSR, ZVE32F, ZVE32X, ZVFBFMIN, ZVL32B);
3334
3335    #[doc = "'Zvfbfwma' (Vector BF16 widening mul-add)."]
3336    pub const ZVFBFWMA: TargetFeatures = feature_set!(F, ZFBFMIN, ZICSR, ZVE32F, ZVE32X, ZVFBFMIN, ZVFBFWMA, ZVL32B);
3337
3338    #[doc = "'Zvfh' (Vector Half-Precision Floating-Point)."]
3339    pub const ZVFH: TargetFeatures = feature_set!(F, ZFHMIN, ZICSR, ZVE32F, ZVE32X, ZVFH, ZVFHMIN, ZVL32B);
3340
3341    #[doc = "'Zvfhmin' (Vector Half-Precision Floating-Point Minimal)."]
3342    pub const ZVFHMIN: TargetFeatures = feature_set!(F, ZICSR, ZVE32F, ZVE32X, ZVFHMIN, ZVL32B);
3343
3344    #[doc = "'Zvkb' (Vector Bit-manipulation used in Cryptography)."]
3345    pub const ZVKB: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKB, ZVL32B);
3346
3347    #[doc = "'Zvkg' (Vector GCM instructions for Cryptography)."]
3348    pub const ZVKG: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKG, ZVL32B);
3349
3350    #[doc = "'Zvkn' (shorthand for 'Zvkned', 'Zvknhb', 'Zvkb', and 'Zvkt')."]
3351    pub const ZVKN: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVE64X, ZVKB, ZVKN, ZVKNED, ZVKNHA, ZVKNHB, ZVKT, ZVL32B, ZVL64B);
3352
3353    #[doc = "'Zvknc' (shorthand for 'Zvknc' and 'Zvbc')."]
3354    pub const ZVKNC: TargetFeatures = feature_set!(ZICSR, ZVBC, ZVE32X, ZVE64X, ZVKB, ZVKN, ZVKNC, ZVKNED, ZVKNHA, ZVKNHB, ZVKT, ZVL32B, ZVL64B);
3355
3356    #[doc = "'Zvkned' (Vector AES Encryption & Decryption (Single Round))."]
3357    pub const ZVKNED: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKNED, ZVL32B);
3358
3359    #[doc = "'Zvkng' (shorthand for 'Zvkn' and 'Zvkg')."]
3360    pub const ZVKNG: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVE64X, ZVKB, ZVKG, ZVKN, ZVKNED, ZVKNG, ZVKNHA, ZVKNHB, ZVKT, ZVL32B, ZVL64B);
3361
3362    #[doc = "'Zvknha' (Vector SHA-2 (SHA-256 only))."]
3363    pub const ZVKNHA: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKNHA, ZVL32B);
3364
3365    #[doc = "'Zvknhb' (Vector SHA-2 (SHA-256 and SHA-512))."]
3366    pub const ZVKNHB: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVE64X, ZVKNHA, ZVKNHB, ZVL32B, ZVL64B);
3367
3368    #[doc = "'Zvks' (shorthand for 'Zvksed', 'Zvksh', 'Zvkb', and 'Zvkt')."]
3369    pub const ZVKS: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKB, ZVKS, ZVKSED, ZVKSH, ZVKT, ZVL32B);
3370
3371    #[doc = "'Zvksc' (shorthand for 'Zvks' and 'Zvbc')."]
3372    pub const ZVKSC: TargetFeatures = feature_set!(ZICSR, ZVBC, ZVE32X, ZVE64X, ZVKB, ZVKS, ZVKSC, ZVKSED, ZVKSH, ZVKT, ZVL32B, ZVL64B);
3373
3374    #[doc = "'Zvksed' (SM4 Block Cipher Instructions)."]
3375    pub const ZVKSED: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKSED, ZVL32B);
3376
3377    #[doc = "'Zvksg' (shorthand for 'Zvks' and 'Zvkg')."]
3378    pub const ZVKSG: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKB, ZVKG, ZVKS, ZVKSED, ZVKSG, ZVKSH, ZVKT, ZVL32B);
3379
3380    #[doc = "'Zvksh' (SM3 Hash Function Instructions)."]
3381    pub const ZVKSH: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKSH, ZVL32B);
3382
3383    #[doc = "'Zvkt' (Vector Data-Independent Execution Latency)."]
3384    pub const ZVKT: TargetFeatures = feature_set!(ZVKT);
3385
3386    #[doc = "'Zvl1024b' (Minimum Vector Length 1024)."]
3387    pub const ZVL1024B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL256B, ZVL32B, ZVL512B, ZVL64B);
3388
3389    #[doc = "'Zvl128b' (Minimum Vector Length 128)."]
3390    pub const ZVL128B: TargetFeatures = feature_set!(ZVL128B, ZVL32B, ZVL64B);
3391
3392    #[doc = "'Zvl16384b' (Minimum Vector Length 16384)."]
3393    pub const ZVL16384B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL16384B, ZVL2048B, ZVL256B, ZVL32B, ZVL4096B, ZVL512B, ZVL64B, ZVL8192B);
3394
3395    #[doc = "'Zvl2048b' (Minimum Vector Length 2048)."]
3396    pub const ZVL2048B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL2048B, ZVL256B, ZVL32B, ZVL512B, ZVL64B);
3397
3398    #[doc = "'Zvl256b' (Minimum Vector Length 256)."]
3399    pub const ZVL256B: TargetFeatures = feature_set!(ZVL128B, ZVL256B, ZVL32B, ZVL64B);
3400
3401    #[doc = "'Zvl32768b' (Minimum Vector Length 32768)."]
3402    pub const ZVL32768B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL16384B, ZVL2048B, ZVL256B, ZVL32768B, ZVL32B, ZVL4096B, ZVL512B, ZVL64B, ZVL8192B);
3403
3404    #[doc = "'Zvl32b' (Minimum Vector Length 32)."]
3405    pub const ZVL32B: TargetFeatures = feature_set!(ZVL32B);
3406
3407    #[doc = "'Zvl4096b' (Minimum Vector Length 4096)."]
3408    pub const ZVL4096B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL2048B, ZVL256B, ZVL32B, ZVL4096B, ZVL512B, ZVL64B);
3409
3410    #[doc = "'Zvl512b' (Minimum Vector Length 512)."]
3411    pub const ZVL512B: TargetFeatures = feature_set!(ZVL128B, ZVL256B, ZVL32B, ZVL512B, ZVL64B);
3412
3413    #[doc = "'Zvl64b' (Minimum Vector Length 64)."]
3414    pub const ZVL64B: TargetFeatures = feature_set!(ZVL32B, ZVL64B);
3415
3416    #[doc = "'Zvl65536b' (Minimum Vector Length 65536)."]
3417    pub const ZVL65536B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL16384B, ZVL2048B, ZVL256B, ZVL32768B, ZVL32B, ZVL4096B, ZVL512B, ZVL64B, ZVL65536B, ZVL8192B);
3418
3419    #[doc = "'Zvl8192b' (Minimum Vector Length 8192)."]
3420    pub const ZVL8192B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL2048B, ZVL256B, ZVL32B, ZVL4096B, ZVL512B, ZVL64B, ZVL8192B);
3421
3422
3423    #[cfg(target_arch = "riscv32")]
3424    pub(crate) const FEATURES: &[FeatureData] = &[
3425        FeatureData::new("a", A),
3426        FeatureData::new("b", B),
3427        FeatureData::new("c", C),
3428        FeatureData::new("crt-static", CRT_STATIC),
3429        FeatureData::new("d", D),
3430        FeatureData::new("e", E),
3431        FeatureData::new("f", F),
3432        FeatureData::new("m", M),
3433        FeatureData::new("relax", RELAX),
3434        FeatureData::new("rva23u64", RVA23U64),
3435        FeatureData::new("supm", SUPM),
3436        FeatureData::new("unaligned-scalar-mem", UNALIGNED_SCALAR_MEM),
3437        FeatureData::new("unaligned-vector-mem", UNALIGNED_VECTOR_MEM),
3438        FeatureData::new("v", V),
3439        FeatureData::new("za128rs", ZA128RS),
3440        FeatureData::new("za64rs", ZA64RS),
3441        FeatureData::new("zaamo", ZAAMO),
3442        FeatureData::new("zabha", ZABHA),
3443        FeatureData::new("zacas", ZACAS),
3444        FeatureData::new("zalrsc", ZALRSC),
3445        FeatureData::new("zama16b", ZAMA16B),
3446        FeatureData::new("zawrs", ZAWRS),
3447        FeatureData::new("zba", ZBA),
3448        FeatureData::new("zbb", ZBB),
3449        FeatureData::new("zbc", ZBC),
3450        FeatureData::new("zbkb", ZBKB),
3451        FeatureData::new("zbkc", ZBKC),
3452        FeatureData::new("zbkx", ZBKX),
3453        FeatureData::new("zbs", ZBS),
3454        FeatureData::new("zca", ZCA),
3455        FeatureData::new("zcb", ZCB),
3456        FeatureData::new("zcmop", ZCMOP),
3457        FeatureData::new("zdinx", ZDINX),
3458        FeatureData::new("zfa", ZFA),
3459        FeatureData::new("zfbfmin", ZFBFMIN),
3460        FeatureData::new("zfh", ZFH),
3461        FeatureData::new("zfhmin", ZFHMIN),
3462        FeatureData::new("zfinx", ZFINX),
3463        FeatureData::new("zhinx", ZHINX),
3464        FeatureData::new("zhinxmin", ZHINXMIN),
3465        FeatureData::new("zic64b", ZIC64B),
3466        FeatureData::new("zicbom", ZICBOM),
3467        FeatureData::new("zicbop", ZICBOP),
3468        FeatureData::new("zicboz", ZICBOZ),
3469        FeatureData::new("ziccamoa", ZICCAMOA),
3470        FeatureData::new("ziccif", ZICCIF),
3471        FeatureData::new("zicclsm", ZICCLSM),
3472        FeatureData::new("ziccrse", ZICCRSE),
3473        FeatureData::new("zicntr", ZICNTR),
3474        FeatureData::new("zicond", ZICOND),
3475        FeatureData::new("zicsr", ZICSR),
3476        FeatureData::new("zifencei", ZIFENCEI),
3477        FeatureData::new("zihintntl", ZIHINTNTL),
3478        FeatureData::new("zihintpause", ZIHINTPAUSE),
3479        FeatureData::new("zihpm", ZIHPM),
3480        FeatureData::new("zimop", ZIMOP),
3481        FeatureData::new("zk", ZK),
3482        FeatureData::new("zkn", ZKN),
3483        FeatureData::new("zknd", ZKND),
3484        FeatureData::new("zkne", ZKNE),
3485        FeatureData::new("zknh", ZKNH),
3486        FeatureData::new("zkr", ZKR),
3487        FeatureData::new("zks", ZKS),
3488        FeatureData::new("zksed", ZKSED),
3489        FeatureData::new("zksh", ZKSH),
3490        FeatureData::new("zkt", ZKT),
3491        FeatureData::new("ztso", ZTSO),
3492        FeatureData::new("zvbb", ZVBB),
3493        FeatureData::new("zvbc", ZVBC),
3494        FeatureData::new("zve32f", ZVE32F),
3495        FeatureData::new("zve32x", ZVE32X),
3496        FeatureData::new("zve64d", ZVE64D),
3497        FeatureData::new("zve64f", ZVE64F),
3498        FeatureData::new("zve64x", ZVE64X),
3499        FeatureData::new("zvfbfmin", ZVFBFMIN),
3500        FeatureData::new("zvfbfwma", ZVFBFWMA),
3501        FeatureData::new("zvfh", ZVFH),
3502        FeatureData::new("zvfhmin", ZVFHMIN),
3503        FeatureData::new("zvkb", ZVKB),
3504        FeatureData::new("zvkg", ZVKG),
3505        FeatureData::new("zvkn", ZVKN),
3506        FeatureData::new("zvknc", ZVKNC),
3507        FeatureData::new("zvkned", ZVKNED),
3508        FeatureData::new("zvkng", ZVKNG),
3509        FeatureData::new("zvknha", ZVKNHA),
3510        FeatureData::new("zvknhb", ZVKNHB),
3511        FeatureData::new("zvks", ZVKS),
3512        FeatureData::new("zvksc", ZVKSC),
3513        FeatureData::new("zvksed", ZVKSED),
3514        FeatureData::new("zvksg", ZVKSG),
3515        FeatureData::new("zvksh", ZVKSH),
3516        FeatureData::new("zvkt", ZVKT),
3517        FeatureData::new("zvl1024b", ZVL1024B),
3518        FeatureData::new("zvl128b", ZVL128B),
3519        FeatureData::new("zvl16384b", ZVL16384B),
3520        FeatureData::new("zvl2048b", ZVL2048B),
3521        FeatureData::new("zvl256b", ZVL256B),
3522        FeatureData::new("zvl32768b", ZVL32768B),
3523        FeatureData::new("zvl32b", ZVL32B),
3524        FeatureData::new("zvl4096b", ZVL4096B),
3525        FeatureData::new("zvl512b", ZVL512B),
3526        FeatureData::new("zvl64b", ZVL64B),
3527        FeatureData::new("zvl65536b", ZVL65536B),
3528        FeatureData::new("zvl8192b", ZVL8192B),
3529    ];
3530
3531    #[cfg(target_arch = "riscv32")]
3532    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
3533    pub(crate) const fn enabled_for_target() -> TargetFeatures {
3534        let features = TargetFeatures::empty();
3535        #[cfg(target_feature = "a")]
3536        let features = features.with(A);
3537        #[cfg(target_feature = "b")]
3538        let features = features.with(B);
3539        #[cfg(target_feature = "c")]
3540        let features = features.with(C);
3541        #[cfg(target_feature = "crt-static")]
3542        let features = features.with(CRT_STATIC);
3543        #[cfg(target_feature = "d")]
3544        let features = features.with(D);
3545        #[cfg(target_feature = "e")]
3546        let features = features.with(E);
3547        #[cfg(target_feature = "f")]
3548        let features = features.with(F);
3549        #[cfg(target_feature = "m")]
3550        let features = features.with(M);
3551        #[cfg(target_feature = "relax")]
3552        let features = features.with(RELAX);
3553        #[cfg(target_feature = "rva23u64")]
3554        let features = features.with(RVA23U64);
3555        #[cfg(target_feature = "supm")]
3556        let features = features.with(SUPM);
3557        #[cfg(target_feature = "unaligned-scalar-mem")]
3558        let features = features.with(UNALIGNED_SCALAR_MEM);
3559        #[cfg(target_feature = "unaligned-vector-mem")]
3560        let features = features.with(UNALIGNED_VECTOR_MEM);
3561        #[cfg(target_feature = "v")]
3562        let features = features.with(V);
3563        #[cfg(target_feature = "za128rs")]
3564        let features = features.with(ZA128RS);
3565        #[cfg(target_feature = "za64rs")]
3566        let features = features.with(ZA64RS);
3567        #[cfg(target_feature = "zaamo")]
3568        let features = features.with(ZAAMO);
3569        #[cfg(target_feature = "zabha")]
3570        let features = features.with(ZABHA);
3571        #[cfg(target_feature = "zacas")]
3572        let features = features.with(ZACAS);
3573        #[cfg(target_feature = "zalrsc")]
3574        let features = features.with(ZALRSC);
3575        #[cfg(target_feature = "zama16b")]
3576        let features = features.with(ZAMA16B);
3577        #[cfg(target_feature = "zawrs")]
3578        let features = features.with(ZAWRS);
3579        #[cfg(target_feature = "zba")]
3580        let features = features.with(ZBA);
3581        #[cfg(target_feature = "zbb")]
3582        let features = features.with(ZBB);
3583        #[cfg(target_feature = "zbc")]
3584        let features = features.with(ZBC);
3585        #[cfg(target_feature = "zbkb")]
3586        let features = features.with(ZBKB);
3587        #[cfg(target_feature = "zbkc")]
3588        let features = features.with(ZBKC);
3589        #[cfg(target_feature = "zbkx")]
3590        let features = features.with(ZBKX);
3591        #[cfg(target_feature = "zbs")]
3592        let features = features.with(ZBS);
3593        #[cfg(target_feature = "zca")]
3594        let features = features.with(ZCA);
3595        #[cfg(target_feature = "zcb")]
3596        let features = features.with(ZCB);
3597        #[cfg(target_feature = "zcmop")]
3598        let features = features.with(ZCMOP);
3599        #[cfg(target_feature = "zdinx")]
3600        let features = features.with(ZDINX);
3601        #[cfg(target_feature = "zfa")]
3602        let features = features.with(ZFA);
3603        #[cfg(target_feature = "zfbfmin")]
3604        let features = features.with(ZFBFMIN);
3605        #[cfg(target_feature = "zfh")]
3606        let features = features.with(ZFH);
3607        #[cfg(target_feature = "zfhmin")]
3608        let features = features.with(ZFHMIN);
3609        #[cfg(target_feature = "zfinx")]
3610        let features = features.with(ZFINX);
3611        #[cfg(target_feature = "zhinx")]
3612        let features = features.with(ZHINX);
3613        #[cfg(target_feature = "zhinxmin")]
3614        let features = features.with(ZHINXMIN);
3615        #[cfg(target_feature = "zic64b")]
3616        let features = features.with(ZIC64B);
3617        #[cfg(target_feature = "zicbom")]
3618        let features = features.with(ZICBOM);
3619        #[cfg(target_feature = "zicbop")]
3620        let features = features.with(ZICBOP);
3621        #[cfg(target_feature = "zicboz")]
3622        let features = features.with(ZICBOZ);
3623        #[cfg(target_feature = "ziccamoa")]
3624        let features = features.with(ZICCAMOA);
3625        #[cfg(target_feature = "ziccif")]
3626        let features = features.with(ZICCIF);
3627        #[cfg(target_feature = "zicclsm")]
3628        let features = features.with(ZICCLSM);
3629        #[cfg(target_feature = "ziccrse")]
3630        let features = features.with(ZICCRSE);
3631        #[cfg(target_feature = "zicntr")]
3632        let features = features.with(ZICNTR);
3633        #[cfg(target_feature = "zicond")]
3634        let features = features.with(ZICOND);
3635        #[cfg(target_feature = "zicsr")]
3636        let features = features.with(ZICSR);
3637        #[cfg(target_feature = "zifencei")]
3638        let features = features.with(ZIFENCEI);
3639        #[cfg(target_feature = "zihintntl")]
3640        let features = features.with(ZIHINTNTL);
3641        #[cfg(target_feature = "zihintpause")]
3642        let features = features.with(ZIHINTPAUSE);
3643        #[cfg(target_feature = "zihpm")]
3644        let features = features.with(ZIHPM);
3645        #[cfg(target_feature = "zimop")]
3646        let features = features.with(ZIMOP);
3647        #[cfg(target_feature = "zk")]
3648        let features = features.with(ZK);
3649        #[cfg(target_feature = "zkn")]
3650        let features = features.with(ZKN);
3651        #[cfg(target_feature = "zknd")]
3652        let features = features.with(ZKND);
3653        #[cfg(target_feature = "zkne")]
3654        let features = features.with(ZKNE);
3655        #[cfg(target_feature = "zknh")]
3656        let features = features.with(ZKNH);
3657        #[cfg(target_feature = "zkr")]
3658        let features = features.with(ZKR);
3659        #[cfg(target_feature = "zks")]
3660        let features = features.with(ZKS);
3661        #[cfg(target_feature = "zksed")]
3662        let features = features.with(ZKSED);
3663        #[cfg(target_feature = "zksh")]
3664        let features = features.with(ZKSH);
3665        #[cfg(target_feature = "zkt")]
3666        let features = features.with(ZKT);
3667        #[cfg(target_feature = "ztso")]
3668        let features = features.with(ZTSO);
3669        #[cfg(target_feature = "zvbb")]
3670        let features = features.with(ZVBB);
3671        #[cfg(target_feature = "zvbc")]
3672        let features = features.with(ZVBC);
3673        #[cfg(target_feature = "zve32f")]
3674        let features = features.with(ZVE32F);
3675        #[cfg(target_feature = "zve32x")]
3676        let features = features.with(ZVE32X);
3677        #[cfg(target_feature = "zve64d")]
3678        let features = features.with(ZVE64D);
3679        #[cfg(target_feature = "zve64f")]
3680        let features = features.with(ZVE64F);
3681        #[cfg(target_feature = "zve64x")]
3682        let features = features.with(ZVE64X);
3683        #[cfg(target_feature = "zvfbfmin")]
3684        let features = features.with(ZVFBFMIN);
3685        #[cfg(target_feature = "zvfbfwma")]
3686        let features = features.with(ZVFBFWMA);
3687        #[cfg(target_feature = "zvfh")]
3688        let features = features.with(ZVFH);
3689        #[cfg(target_feature = "zvfhmin")]
3690        let features = features.with(ZVFHMIN);
3691        #[cfg(target_feature = "zvkb")]
3692        let features = features.with(ZVKB);
3693        #[cfg(target_feature = "zvkg")]
3694        let features = features.with(ZVKG);
3695        #[cfg(target_feature = "zvkn")]
3696        let features = features.with(ZVKN);
3697        #[cfg(target_feature = "zvknc")]
3698        let features = features.with(ZVKNC);
3699        #[cfg(target_feature = "zvkned")]
3700        let features = features.with(ZVKNED);
3701        #[cfg(target_feature = "zvkng")]
3702        let features = features.with(ZVKNG);
3703        #[cfg(target_feature = "zvknha")]
3704        let features = features.with(ZVKNHA);
3705        #[cfg(target_feature = "zvknhb")]
3706        let features = features.with(ZVKNHB);
3707        #[cfg(target_feature = "zvks")]
3708        let features = features.with(ZVKS);
3709        #[cfg(target_feature = "zvksc")]
3710        let features = features.with(ZVKSC);
3711        #[cfg(target_feature = "zvksed")]
3712        let features = features.with(ZVKSED);
3713        #[cfg(target_feature = "zvksg")]
3714        let features = features.with(ZVKSG);
3715        #[cfg(target_feature = "zvksh")]
3716        let features = features.with(ZVKSH);
3717        #[cfg(target_feature = "zvkt")]
3718        let features = features.with(ZVKT);
3719        #[cfg(target_feature = "zvl1024b")]
3720        let features = features.with(ZVL1024B);
3721        #[cfg(target_feature = "zvl128b")]
3722        let features = features.with(ZVL128B);
3723        #[cfg(target_feature = "zvl16384b")]
3724        let features = features.with(ZVL16384B);
3725        #[cfg(target_feature = "zvl2048b")]
3726        let features = features.with(ZVL2048B);
3727        #[cfg(target_feature = "zvl256b")]
3728        let features = features.with(ZVL256B);
3729        #[cfg(target_feature = "zvl32768b")]
3730        let features = features.with(ZVL32768B);
3731        #[cfg(target_feature = "zvl32b")]
3732        let features = features.with(ZVL32B);
3733        #[cfg(target_feature = "zvl4096b")]
3734        let features = features.with(ZVL4096B);
3735        #[cfg(target_feature = "zvl512b")]
3736        let features = features.with(ZVL512B);
3737        #[cfg(target_feature = "zvl64b")]
3738        let features = features.with(ZVL64B);
3739        #[cfg(target_feature = "zvl65536b")]
3740        let features = features.with(ZVL65536B);
3741        #[cfg(target_feature = "zvl8192b")]
3742        let features = features.with(ZVL8192B);
3743        features
3744    }
3745
3746}
3747#[cfg(any(doc, target_arch = "riscv64"))]
3748#[rustfmt::skip]
3749pub mod riscv64 {
3750    use super::*;
3751
3752    #[repr(u16)]
3753    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
3754    enum FeatureId {
3755        A,
3756        B,
3757        C,
3758        CRT_STATIC,
3759        D,
3760        E,
3761        F,
3762        M,
3763        RELAX,
3764        RVA23U64,
3765        SUPM,
3766        UNALIGNED_SCALAR_MEM,
3767        UNALIGNED_VECTOR_MEM,
3768        V,
3769        ZA128RS,
3770        ZA64RS,
3771        ZAAMO,
3772        ZABHA,
3773        ZACAS,
3774        ZALRSC,
3775        ZAMA16B,
3776        ZAWRS,
3777        ZBA,
3778        ZBB,
3779        ZBC,
3780        ZBKB,
3781        ZBKC,
3782        ZBKX,
3783        ZBS,
3784        ZCA,
3785        ZCB,
3786        ZCMOP,
3787        ZDINX,
3788        ZFA,
3789        ZFBFMIN,
3790        ZFH,
3791        ZFHMIN,
3792        ZFINX,
3793        ZHINX,
3794        ZHINXMIN,
3795        ZIC64B,
3796        ZICBOM,
3797        ZICBOP,
3798        ZICBOZ,
3799        ZICCAMOA,
3800        ZICCIF,
3801        ZICCLSM,
3802        ZICCRSE,
3803        ZICNTR,
3804        ZICOND,
3805        ZICSR,
3806        ZIFENCEI,
3807        ZIHINTNTL,
3808        ZIHINTPAUSE,
3809        ZIHPM,
3810        ZIMOP,
3811        ZK,
3812        ZKN,
3813        ZKND,
3814        ZKNE,
3815        ZKNH,
3816        ZKR,
3817        ZKS,
3818        ZKSED,
3819        ZKSH,
3820        ZKT,
3821        ZTSO,
3822        ZVBB,
3823        ZVBC,
3824        ZVE32F,
3825        ZVE32X,
3826        ZVE64D,
3827        ZVE64F,
3828        ZVE64X,
3829        ZVFBFMIN,
3830        ZVFBFWMA,
3831        ZVFH,
3832        ZVFHMIN,
3833        ZVKB,
3834        ZVKG,
3835        ZVKN,
3836        ZVKNC,
3837        ZVKNED,
3838        ZVKNG,
3839        ZVKNHA,
3840        ZVKNHB,
3841        ZVKS,
3842        ZVKSC,
3843        ZVKSED,
3844        ZVKSG,
3845        ZVKSH,
3846        ZVKT,
3847        ZVL1024B,
3848        ZVL128B,
3849        ZVL16384B,
3850        ZVL2048B,
3851        ZVL256B,
3852        ZVL32768B,
3853        ZVL32B,
3854        ZVL4096B,
3855        ZVL512B,
3856        ZVL64B,
3857        ZVL65536B,
3858        ZVL8192B,
3859    }
3860
3861    macro_rules! feature_set {
3862        ($($feature:ident),* $(,)?) => { {
3863            #[cfg(target_arch = "riscv64")]
3864            {
3865                let features = TargetFeatures::empty();
3866                $(let features = features.with_bit(FeatureId::$feature as usize);)*
3867                features
3868            }
3869            #[cfg(all(doc, not(target_arch = "riscv64")))]
3870            {
3871                TargetFeatures::empty()
3872            }
3873        } };
3874    }
3875    #[doc = "'A' (Atomic Instructions)."]
3876    pub const A: TargetFeatures = feature_set!(A, ZAAMO, ZALRSC);
3877
3878    #[doc = "'B' (the collection of the Zba, Zbb, Zbs extensions)."]
3879    pub const B: TargetFeatures = feature_set!(B, ZBA, ZBB, ZBS);
3880
3881    #[doc = "'C' (Compressed Instructions)."]
3882    pub const C: TargetFeatures = feature_set!(C, ZCA);
3883
3884    #[doc = "Enables C Run-time Libraries to be statically linked."]
3885    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
3886
3887    #[doc = "'D' (Double-Precision Floating-Point)."]
3888    pub const D: TargetFeatures = feature_set!(D, F, ZICSR);
3889
3890    #[doc = "'E' (Embedded Instruction Set with 16 GPRs)."]
3891    pub const E: TargetFeatures = feature_set!(E);
3892
3893    #[doc = "'F' (Single-Precision Floating-Point)."]
3894    pub const F: TargetFeatures = feature_set!(F, ZICSR);
3895
3896    #[doc = "'M' (Integer Multiplication and Division)."]
3897    pub const M: TargetFeatures = feature_set!(M);
3898
3899    #[doc = "Enable Linker relaxation."]
3900    pub const RELAX: TargetFeatures = feature_set!(RELAX);
3901
3902    #[doc = "RISC-V rva23u64 profile."]
3903    pub const RVA23U64: TargetFeatures = feature_set!(A, B, C, D, F, M, RVA23U64, SUPM, V, ZA128RS, ZA64RS, ZAAMO, ZALRSC, ZAWRS, ZBA, ZBB, ZBS, ZCA, ZCB, ZCMOP, ZFA, ZFHMIN, ZIC64B, ZICBOM, ZICBOP, ZICBOZ, ZICCAMOA, ZICCIF, ZICCLSM, ZICCRSE, ZICNTR, ZICOND, ZICSR, ZIHINTNTL, ZIHINTPAUSE, ZIHPM, ZIMOP, ZKT, ZVBB, ZVE32F, ZVE32X, ZVE64D, ZVE64F, ZVE64X, ZVFHMIN, ZVKB, ZVKT, ZVL128B, ZVL32B, ZVL64B);
3904
3905    #[doc = "'Supm' (Indicates User-mode Pointer Masking)."]
3906    pub const SUPM: TargetFeatures = feature_set!(SUPM);
3907
3908    #[doc = "Has reasonably performant unaligned scalar loads and stores."]
3909    pub const UNALIGNED_SCALAR_MEM: TargetFeatures = feature_set!(UNALIGNED_SCALAR_MEM);
3910
3911    #[doc = "Has reasonably performant unaligned vector loads and stores."]
3912    pub const UNALIGNED_VECTOR_MEM: TargetFeatures = feature_set!(UNALIGNED_VECTOR_MEM);
3913
3914    #[doc = "'V' (Vector Extension for Application Processors)."]
3915    pub const V: TargetFeatures = feature_set!(D, F, V, ZICSR, ZVE32F, ZVE32X, ZVE64D, ZVE64F, ZVE64X, ZVL128B, ZVL32B, ZVL64B);
3916
3917    #[doc = "'Za128rs' (Reservation Set Size of at Most 128 Bytes)."]
3918    pub const ZA128RS: TargetFeatures = feature_set!(ZA128RS);
3919
3920    #[doc = "'Za64rs' (Reservation Set Size of at Most 64 Bytes)."]
3921    pub const ZA64RS: TargetFeatures = feature_set!(ZA128RS, ZA64RS);
3922
3923    #[doc = "'Zaamo' (Atomic Memory Operations)."]
3924    pub const ZAAMO: TargetFeatures = feature_set!(ZAAMO);
3925
3926    #[doc = "'Zabha' (Byte and Halfword Atomic Memory Operations)."]
3927    pub const ZABHA: TargetFeatures = feature_set!(ZAAMO, ZABHA);
3928
3929    #[doc = "'Zacas' (Atomic Compare-And-Swap Instructions)."]
3930    pub const ZACAS: TargetFeatures = feature_set!(ZAAMO, ZACAS);
3931
3932    #[doc = "'Zalrsc' (Load-Reserved/Store-Conditional)."]
3933    pub const ZALRSC: TargetFeatures = feature_set!(ZALRSC);
3934
3935    #[doc = "'Zama16b' (Atomic 16-byte misaligned loads, stores and AMOs)."]
3936    pub const ZAMA16B: TargetFeatures = feature_set!(ZAMA16B);
3937
3938    #[doc = "'Zawrs' (Wait on Reservation Set)."]
3939    pub const ZAWRS: TargetFeatures = feature_set!(ZAWRS);
3940
3941    #[doc = "'Zba' (Address Generation Instructions)."]
3942    pub const ZBA: TargetFeatures = feature_set!(ZBA);
3943
3944    #[doc = "'Zbb' (Basic Bit-Manipulation)."]
3945    pub const ZBB: TargetFeatures = feature_set!(ZBB);
3946
3947    #[doc = "'Zbc' (Carry-Less Multiplication)."]
3948    pub const ZBC: TargetFeatures = feature_set!(ZBC, ZBKC);
3949
3950    #[doc = "'Zbkb' (Bitmanip instructions for Cryptography)."]
3951    pub const ZBKB: TargetFeatures = feature_set!(ZBKB);
3952
3953    #[doc = "'Zbkc' (Carry-less multiply instructions for Cryptography)."]
3954    pub const ZBKC: TargetFeatures = feature_set!(ZBKC);
3955
3956    #[doc = "'Zbkx' (Crossbar permutation instructions)."]
3957    pub const ZBKX: TargetFeatures = feature_set!(ZBKX);
3958
3959    #[doc = "'Zbs' (Single-Bit Instructions)."]
3960    pub const ZBS: TargetFeatures = feature_set!(ZBS);
3961
3962    #[doc = "'Zca' (part of the C extension, excluding compressed floating point loads/stores)."]
3963    pub const ZCA: TargetFeatures = feature_set!(ZCA);
3964
3965    #[doc = "'Zcb' (Compressed basic bit manipulation instructions)."]
3966    pub const ZCB: TargetFeatures = feature_set!(ZCA, ZCB);
3967
3968    #[doc = "'Zcmop' (Compressed May-Be-Operations)."]
3969    pub const ZCMOP: TargetFeatures = feature_set!(ZCA, ZCMOP);
3970
3971    #[doc = "'Zdinx' (Double in Integer)."]
3972    pub const ZDINX: TargetFeatures = feature_set!(ZDINX, ZFINX, ZICSR);
3973
3974    #[doc = "'Zfa' (Additional Floating-Point)."]
3975    pub const ZFA: TargetFeatures = feature_set!(F, ZFA, ZICSR);
3976
3977    #[doc = "'Zfbfmin' (Scalar BF16 Converts)."]
3978    pub const ZFBFMIN: TargetFeatures = feature_set!(F, ZFBFMIN, ZICSR);
3979
3980    #[doc = "'Zfh' (Half-Precision Floating-Point)."]
3981    pub const ZFH: TargetFeatures = feature_set!(F, ZFH, ZFHMIN, ZICSR);
3982
3983    #[doc = "'Zfhmin' (Half-Precision Floating-Point Minimal)."]
3984    pub const ZFHMIN: TargetFeatures = feature_set!(F, ZFHMIN, ZICSR);
3985
3986    #[doc = "'Zfinx' (Float in Integer)."]
3987    pub const ZFINX: TargetFeatures = feature_set!(ZFINX, ZICSR);
3988
3989    #[doc = "'Zhinx' (Half Float in Integer)."]
3990    pub const ZHINX: TargetFeatures = feature_set!(ZFINX, ZHINX, ZHINXMIN, ZICSR);
3991
3992    #[doc = "'Zhinxmin' (Half Float in Integer Minimal)."]
3993    pub const ZHINXMIN: TargetFeatures = feature_set!(ZFINX, ZHINXMIN, ZICSR);
3994
3995    #[doc = "'Zic64b' (Cache Block Size Is 64 Bytes)."]
3996    pub const ZIC64B: TargetFeatures = feature_set!(ZIC64B);
3997
3998    #[doc = "'Zicbom' (Cache-Block Management Instructions)."]
3999    pub const ZICBOM: TargetFeatures = feature_set!(ZICBOM);
4000
4001    #[doc = "'Zicbop' (Cache-Block Prefetch Instructions)."]
4002    pub const ZICBOP: TargetFeatures = feature_set!(ZICBOP);
4003
4004    #[doc = "'Zicboz' (Cache-Block Zero Instructions)."]
4005    pub const ZICBOZ: TargetFeatures = feature_set!(ZICBOZ);
4006
4007    #[doc = "'Ziccamoa' (Main Memory Supports All Atomics in A)."]
4008    pub const ZICCAMOA: TargetFeatures = feature_set!(ZICCAMOA);
4009
4010    #[doc = "'Ziccif' (Main Memory Supports Instruction Fetch with Atomicity Requirement)."]
4011    pub const ZICCIF: TargetFeatures = feature_set!(ZICCIF);
4012
4013    #[doc = "'Zicclsm' (Main Memory Supports Misaligned Loads/Stores)."]
4014    pub const ZICCLSM: TargetFeatures = feature_set!(ZICCLSM);
4015
4016    #[doc = "'Ziccrse' (Main Memory Supports Forward Progress on LR/SC Sequences)."]
4017    pub const ZICCRSE: TargetFeatures = feature_set!(ZICCRSE);
4018
4019    #[doc = "'Zicntr' (Base Counters and Timers)."]
4020    pub const ZICNTR: TargetFeatures = feature_set!(ZICNTR, ZICSR);
4021
4022    #[doc = "'Zicond' (Integer Conditional Operations)."]
4023    pub const ZICOND: TargetFeatures = feature_set!(ZICOND);
4024
4025    #[doc = "'Zicsr' (CSRs)."]
4026    pub const ZICSR: TargetFeatures = feature_set!(ZICSR);
4027
4028    #[doc = "'Zifencei' (fence.i)."]
4029    pub const ZIFENCEI: TargetFeatures = feature_set!(ZIFENCEI);
4030
4031    #[doc = "'Zihintntl' (Non-Temporal Locality Hints)."]
4032    pub const ZIHINTNTL: TargetFeatures = feature_set!(ZIHINTNTL);
4033
4034    #[doc = "'Zihintpause' (Pause Hint)."]
4035    pub const ZIHINTPAUSE: TargetFeatures = feature_set!(ZIHINTPAUSE);
4036
4037    #[doc = "'Zihpm' (Hardware Performance Counters)."]
4038    pub const ZIHPM: TargetFeatures = feature_set!(ZICSR, ZIHPM);
4039
4040    #[doc = "'Zimop' (May-Be-Operations)."]
4041    pub const ZIMOP: TargetFeatures = feature_set!(ZIMOP);
4042
4043    #[doc = "'Zk' (Standard scalar cryptography extension)."]
4044    pub const ZK: TargetFeatures = feature_set!(ZBKB, ZBKC, ZBKX, ZK, ZKN, ZKND, ZKNE, ZKNH, ZKR, ZKT);
4045
4046    #[doc = "'Zkn' (NIST Algorithm Suite)."]
4047    pub const ZKN: TargetFeatures = feature_set!(ZBKB, ZBKC, ZBKX, ZKN, ZKND, ZKNE, ZKNH);
4048
4049    #[doc = "'Zknd' (NIST Suite: AES Decryption)."]
4050    pub const ZKND: TargetFeatures = feature_set!(ZKND);
4051
4052    #[doc = "'Zkne' (NIST Suite: AES Encryption)."]
4053    pub const ZKNE: TargetFeatures = feature_set!(ZKNE);
4054
4055    #[doc = "'Zknh' (NIST Suite: Hash Function Instructions)."]
4056    pub const ZKNH: TargetFeatures = feature_set!(ZKNH);
4057
4058    #[doc = "'Zkr' (Entropy Source Extension)."]
4059    pub const ZKR: TargetFeatures = feature_set!(ZKR);
4060
4061    #[doc = "'Zks' (ShangMi Algorithm Suite)."]
4062    pub const ZKS: TargetFeatures = feature_set!(ZBKB, ZBKC, ZBKX, ZKS, ZKSED, ZKSH);
4063
4064    #[doc = "'Zksed' (ShangMi Suite: SM4 Block Cipher Instructions)."]
4065    pub const ZKSED: TargetFeatures = feature_set!(ZKSED);
4066
4067    #[doc = "'Zksh' (ShangMi Suite: SM3 Hash Function Instructions)."]
4068    pub const ZKSH: TargetFeatures = feature_set!(ZKSH);
4069
4070    #[doc = "'Zkt' (Data Independent Execution Latency)."]
4071    pub const ZKT: TargetFeatures = feature_set!(ZKT);
4072
4073    #[doc = "'Ztso' (Memory Model"]
4074    pub const ZTSO: TargetFeatures = feature_set!(ZTSO);
4075
4076    #[doc = "'Zvbb' (Vector basic bit-manipulation instructions)."]
4077    pub const ZVBB: TargetFeatures = feature_set!(ZICSR, ZVBB, ZVE32X, ZVKB, ZVL32B);
4078
4079    #[doc = "'Zvbc' (Vector Carryless Multiplication)."]
4080    pub const ZVBC: TargetFeatures = feature_set!(ZICSR, ZVBC, ZVE32X, ZVE64X, ZVL32B, ZVL64B);
4081
4082    #[doc = "'Zve32f' (Vector Extensions for Embedded Processors with maximal 32 EEW and F extension)."]
4083    pub const ZVE32F: TargetFeatures = feature_set!(F, ZICSR, ZVE32F, ZVE32X, ZVL32B);
4084
4085    #[doc = "'Zve32x' (Vector Extensions for Embedded Processors with maximal 32 EEW)."]
4086    pub const ZVE32X: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVL32B);
4087
4088    #[doc = "'Zve64d' (Vector Extensions for Embedded Processors with maximal 64 EEW, F and D extension)."]
4089    pub const ZVE64D: TargetFeatures = feature_set!(D, F, ZICSR, ZVE32F, ZVE32X, ZVE64D, ZVE64F, ZVE64X, ZVL32B, ZVL64B);
4090
4091    #[doc = "'Zve64f' (Vector Extensions for Embedded Processors with maximal 64 EEW and F extension)."]
4092    pub const ZVE64F: TargetFeatures = feature_set!(F, ZICSR, ZVE32F, ZVE32X, ZVE64F, ZVE64X, ZVL32B, ZVL64B);
4093
4094    #[doc = "'Zve64x' (Vector Extensions for Embedded Processors with maximal 64 EEW)."]
4095    pub const ZVE64X: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVE64X, ZVL32B, ZVL64B);
4096
4097    #[doc = "'Zvfbfmin' (Vector BF16 Converts)."]
4098    pub const ZVFBFMIN: TargetFeatures = feature_set!(F, ZICSR, ZVE32F, ZVE32X, ZVFBFMIN, ZVL32B);
4099
4100    #[doc = "'Zvfbfwma' (Vector BF16 widening mul-add)."]
4101    pub const ZVFBFWMA: TargetFeatures = feature_set!(F, ZFBFMIN, ZICSR, ZVE32F, ZVE32X, ZVFBFMIN, ZVFBFWMA, ZVL32B);
4102
4103    #[doc = "'Zvfh' (Vector Half-Precision Floating-Point)."]
4104    pub const ZVFH: TargetFeatures = feature_set!(F, ZFHMIN, ZICSR, ZVE32F, ZVE32X, ZVFH, ZVFHMIN, ZVL32B);
4105
4106    #[doc = "'Zvfhmin' (Vector Half-Precision Floating-Point Minimal)."]
4107    pub const ZVFHMIN: TargetFeatures = feature_set!(F, ZICSR, ZVE32F, ZVE32X, ZVFHMIN, ZVL32B);
4108
4109    #[doc = "'Zvkb' (Vector Bit-manipulation used in Cryptography)."]
4110    pub const ZVKB: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKB, ZVL32B);
4111
4112    #[doc = "'Zvkg' (Vector GCM instructions for Cryptography)."]
4113    pub const ZVKG: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKG, ZVL32B);
4114
4115    #[doc = "'Zvkn' (shorthand for 'Zvkned', 'Zvknhb', 'Zvkb', and 'Zvkt')."]
4116    pub const ZVKN: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVE64X, ZVKB, ZVKN, ZVKNED, ZVKNHA, ZVKNHB, ZVKT, ZVL32B, ZVL64B);
4117
4118    #[doc = "'Zvknc' (shorthand for 'Zvknc' and 'Zvbc')."]
4119    pub const ZVKNC: TargetFeatures = feature_set!(ZICSR, ZVBC, ZVE32X, ZVE64X, ZVKB, ZVKN, ZVKNC, ZVKNED, ZVKNHA, ZVKNHB, ZVKT, ZVL32B, ZVL64B);
4120
4121    #[doc = "'Zvkned' (Vector AES Encryption & Decryption (Single Round))."]
4122    pub const ZVKNED: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKNED, ZVL32B);
4123
4124    #[doc = "'Zvkng' (shorthand for 'Zvkn' and 'Zvkg')."]
4125    pub const ZVKNG: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVE64X, ZVKB, ZVKG, ZVKN, ZVKNED, ZVKNG, ZVKNHA, ZVKNHB, ZVKT, ZVL32B, ZVL64B);
4126
4127    #[doc = "'Zvknha' (Vector SHA-2 (SHA-256 only))."]
4128    pub const ZVKNHA: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKNHA, ZVL32B);
4129
4130    #[doc = "'Zvknhb' (Vector SHA-2 (SHA-256 and SHA-512))."]
4131    pub const ZVKNHB: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVE64X, ZVKNHA, ZVKNHB, ZVL32B, ZVL64B);
4132
4133    #[doc = "'Zvks' (shorthand for 'Zvksed', 'Zvksh', 'Zvkb', and 'Zvkt')."]
4134    pub const ZVKS: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKB, ZVKS, ZVKSED, ZVKSH, ZVKT, ZVL32B);
4135
4136    #[doc = "'Zvksc' (shorthand for 'Zvks' and 'Zvbc')."]
4137    pub const ZVKSC: TargetFeatures = feature_set!(ZICSR, ZVBC, ZVE32X, ZVE64X, ZVKB, ZVKS, ZVKSC, ZVKSED, ZVKSH, ZVKT, ZVL32B, ZVL64B);
4138
4139    #[doc = "'Zvksed' (SM4 Block Cipher Instructions)."]
4140    pub const ZVKSED: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKSED, ZVL32B);
4141
4142    #[doc = "'Zvksg' (shorthand for 'Zvks' and 'Zvkg')."]
4143    pub const ZVKSG: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKB, ZVKG, ZVKS, ZVKSED, ZVKSG, ZVKSH, ZVKT, ZVL32B);
4144
4145    #[doc = "'Zvksh' (SM3 Hash Function Instructions)."]
4146    pub const ZVKSH: TargetFeatures = feature_set!(ZICSR, ZVE32X, ZVKSH, ZVL32B);
4147
4148    #[doc = "'Zvkt' (Vector Data-Independent Execution Latency)."]
4149    pub const ZVKT: TargetFeatures = feature_set!(ZVKT);
4150
4151    #[doc = "'Zvl1024b' (Minimum Vector Length 1024)."]
4152    pub const ZVL1024B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL256B, ZVL32B, ZVL512B, ZVL64B);
4153
4154    #[doc = "'Zvl128b' (Minimum Vector Length 128)."]
4155    pub const ZVL128B: TargetFeatures = feature_set!(ZVL128B, ZVL32B, ZVL64B);
4156
4157    #[doc = "'Zvl16384b' (Minimum Vector Length 16384)."]
4158    pub const ZVL16384B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL16384B, ZVL2048B, ZVL256B, ZVL32B, ZVL4096B, ZVL512B, ZVL64B, ZVL8192B);
4159
4160    #[doc = "'Zvl2048b' (Minimum Vector Length 2048)."]
4161    pub const ZVL2048B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL2048B, ZVL256B, ZVL32B, ZVL512B, ZVL64B);
4162
4163    #[doc = "'Zvl256b' (Minimum Vector Length 256)."]
4164    pub const ZVL256B: TargetFeatures = feature_set!(ZVL128B, ZVL256B, ZVL32B, ZVL64B);
4165
4166    #[doc = "'Zvl32768b' (Minimum Vector Length 32768)."]
4167    pub const ZVL32768B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL16384B, ZVL2048B, ZVL256B, ZVL32768B, ZVL32B, ZVL4096B, ZVL512B, ZVL64B, ZVL8192B);
4168
4169    #[doc = "'Zvl32b' (Minimum Vector Length 32)."]
4170    pub const ZVL32B: TargetFeatures = feature_set!(ZVL32B);
4171
4172    #[doc = "'Zvl4096b' (Minimum Vector Length 4096)."]
4173    pub const ZVL4096B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL2048B, ZVL256B, ZVL32B, ZVL4096B, ZVL512B, ZVL64B);
4174
4175    #[doc = "'Zvl512b' (Minimum Vector Length 512)."]
4176    pub const ZVL512B: TargetFeatures = feature_set!(ZVL128B, ZVL256B, ZVL32B, ZVL512B, ZVL64B);
4177
4178    #[doc = "'Zvl64b' (Minimum Vector Length 64)."]
4179    pub const ZVL64B: TargetFeatures = feature_set!(ZVL32B, ZVL64B);
4180
4181    #[doc = "'Zvl65536b' (Minimum Vector Length 65536)."]
4182    pub const ZVL65536B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL16384B, ZVL2048B, ZVL256B, ZVL32768B, ZVL32B, ZVL4096B, ZVL512B, ZVL64B, ZVL65536B, ZVL8192B);
4183
4184    #[doc = "'Zvl8192b' (Minimum Vector Length 8192)."]
4185    pub const ZVL8192B: TargetFeatures = feature_set!(ZVL1024B, ZVL128B, ZVL2048B, ZVL256B, ZVL32B, ZVL4096B, ZVL512B, ZVL64B, ZVL8192B);
4186
4187
4188    #[cfg(target_arch = "riscv64")]
4189    pub(crate) const FEATURES: &[FeatureData] = &[
4190        FeatureData::new("a", A),
4191        FeatureData::new("b", B),
4192        FeatureData::new("c", C),
4193        FeatureData::new("crt-static", CRT_STATIC),
4194        FeatureData::new("d", D),
4195        FeatureData::new("e", E),
4196        FeatureData::new("f", F),
4197        FeatureData::new("m", M),
4198        FeatureData::new("relax", RELAX),
4199        FeatureData::new("rva23u64", RVA23U64),
4200        FeatureData::new("supm", SUPM),
4201        FeatureData::new("unaligned-scalar-mem", UNALIGNED_SCALAR_MEM),
4202        FeatureData::new("unaligned-vector-mem", UNALIGNED_VECTOR_MEM),
4203        FeatureData::new("v", V),
4204        FeatureData::new("za128rs", ZA128RS),
4205        FeatureData::new("za64rs", ZA64RS),
4206        FeatureData::new("zaamo", ZAAMO),
4207        FeatureData::new("zabha", ZABHA),
4208        FeatureData::new("zacas", ZACAS),
4209        FeatureData::new("zalrsc", ZALRSC),
4210        FeatureData::new("zama16b", ZAMA16B),
4211        FeatureData::new("zawrs", ZAWRS),
4212        FeatureData::new("zba", ZBA),
4213        FeatureData::new("zbb", ZBB),
4214        FeatureData::new("zbc", ZBC),
4215        FeatureData::new("zbkb", ZBKB),
4216        FeatureData::new("zbkc", ZBKC),
4217        FeatureData::new("zbkx", ZBKX),
4218        FeatureData::new("zbs", ZBS),
4219        FeatureData::new("zca", ZCA),
4220        FeatureData::new("zcb", ZCB),
4221        FeatureData::new("zcmop", ZCMOP),
4222        FeatureData::new("zdinx", ZDINX),
4223        FeatureData::new("zfa", ZFA),
4224        FeatureData::new("zfbfmin", ZFBFMIN),
4225        FeatureData::new("zfh", ZFH),
4226        FeatureData::new("zfhmin", ZFHMIN),
4227        FeatureData::new("zfinx", ZFINX),
4228        FeatureData::new("zhinx", ZHINX),
4229        FeatureData::new("zhinxmin", ZHINXMIN),
4230        FeatureData::new("zic64b", ZIC64B),
4231        FeatureData::new("zicbom", ZICBOM),
4232        FeatureData::new("zicbop", ZICBOP),
4233        FeatureData::new("zicboz", ZICBOZ),
4234        FeatureData::new("ziccamoa", ZICCAMOA),
4235        FeatureData::new("ziccif", ZICCIF),
4236        FeatureData::new("zicclsm", ZICCLSM),
4237        FeatureData::new("ziccrse", ZICCRSE),
4238        FeatureData::new("zicntr", ZICNTR),
4239        FeatureData::new("zicond", ZICOND),
4240        FeatureData::new("zicsr", ZICSR),
4241        FeatureData::new("zifencei", ZIFENCEI),
4242        FeatureData::new("zihintntl", ZIHINTNTL),
4243        FeatureData::new("zihintpause", ZIHINTPAUSE),
4244        FeatureData::new("zihpm", ZIHPM),
4245        FeatureData::new("zimop", ZIMOP),
4246        FeatureData::new("zk", ZK),
4247        FeatureData::new("zkn", ZKN),
4248        FeatureData::new("zknd", ZKND),
4249        FeatureData::new("zkne", ZKNE),
4250        FeatureData::new("zknh", ZKNH),
4251        FeatureData::new("zkr", ZKR),
4252        FeatureData::new("zks", ZKS),
4253        FeatureData::new("zksed", ZKSED),
4254        FeatureData::new("zksh", ZKSH),
4255        FeatureData::new("zkt", ZKT),
4256        FeatureData::new("ztso", ZTSO),
4257        FeatureData::new("zvbb", ZVBB),
4258        FeatureData::new("zvbc", ZVBC),
4259        FeatureData::new("zve32f", ZVE32F),
4260        FeatureData::new("zve32x", ZVE32X),
4261        FeatureData::new("zve64d", ZVE64D),
4262        FeatureData::new("zve64f", ZVE64F),
4263        FeatureData::new("zve64x", ZVE64X),
4264        FeatureData::new("zvfbfmin", ZVFBFMIN),
4265        FeatureData::new("zvfbfwma", ZVFBFWMA),
4266        FeatureData::new("zvfh", ZVFH),
4267        FeatureData::new("zvfhmin", ZVFHMIN),
4268        FeatureData::new("zvkb", ZVKB),
4269        FeatureData::new("zvkg", ZVKG),
4270        FeatureData::new("zvkn", ZVKN),
4271        FeatureData::new("zvknc", ZVKNC),
4272        FeatureData::new("zvkned", ZVKNED),
4273        FeatureData::new("zvkng", ZVKNG),
4274        FeatureData::new("zvknha", ZVKNHA),
4275        FeatureData::new("zvknhb", ZVKNHB),
4276        FeatureData::new("zvks", ZVKS),
4277        FeatureData::new("zvksc", ZVKSC),
4278        FeatureData::new("zvksed", ZVKSED),
4279        FeatureData::new("zvksg", ZVKSG),
4280        FeatureData::new("zvksh", ZVKSH),
4281        FeatureData::new("zvkt", ZVKT),
4282        FeatureData::new("zvl1024b", ZVL1024B),
4283        FeatureData::new("zvl128b", ZVL128B),
4284        FeatureData::new("zvl16384b", ZVL16384B),
4285        FeatureData::new("zvl2048b", ZVL2048B),
4286        FeatureData::new("zvl256b", ZVL256B),
4287        FeatureData::new("zvl32768b", ZVL32768B),
4288        FeatureData::new("zvl32b", ZVL32B),
4289        FeatureData::new("zvl4096b", ZVL4096B),
4290        FeatureData::new("zvl512b", ZVL512B),
4291        FeatureData::new("zvl64b", ZVL64B),
4292        FeatureData::new("zvl65536b", ZVL65536B),
4293        FeatureData::new("zvl8192b", ZVL8192B),
4294    ];
4295
4296    #[cfg(target_arch = "riscv64")]
4297    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
4298    pub(crate) const fn enabled_for_target() -> TargetFeatures {
4299        let features = TargetFeatures::empty();
4300        #[cfg(target_feature = "a")]
4301        let features = features.with(A);
4302        #[cfg(target_feature = "b")]
4303        let features = features.with(B);
4304        #[cfg(target_feature = "c")]
4305        let features = features.with(C);
4306        #[cfg(target_feature = "crt-static")]
4307        let features = features.with(CRT_STATIC);
4308        #[cfg(target_feature = "d")]
4309        let features = features.with(D);
4310        #[cfg(target_feature = "e")]
4311        let features = features.with(E);
4312        #[cfg(target_feature = "f")]
4313        let features = features.with(F);
4314        #[cfg(target_feature = "m")]
4315        let features = features.with(M);
4316        #[cfg(target_feature = "relax")]
4317        let features = features.with(RELAX);
4318        #[cfg(target_feature = "rva23u64")]
4319        let features = features.with(RVA23U64);
4320        #[cfg(target_feature = "supm")]
4321        let features = features.with(SUPM);
4322        #[cfg(target_feature = "unaligned-scalar-mem")]
4323        let features = features.with(UNALIGNED_SCALAR_MEM);
4324        #[cfg(target_feature = "unaligned-vector-mem")]
4325        let features = features.with(UNALIGNED_VECTOR_MEM);
4326        #[cfg(target_feature = "v")]
4327        let features = features.with(V);
4328        #[cfg(target_feature = "za128rs")]
4329        let features = features.with(ZA128RS);
4330        #[cfg(target_feature = "za64rs")]
4331        let features = features.with(ZA64RS);
4332        #[cfg(target_feature = "zaamo")]
4333        let features = features.with(ZAAMO);
4334        #[cfg(target_feature = "zabha")]
4335        let features = features.with(ZABHA);
4336        #[cfg(target_feature = "zacas")]
4337        let features = features.with(ZACAS);
4338        #[cfg(target_feature = "zalrsc")]
4339        let features = features.with(ZALRSC);
4340        #[cfg(target_feature = "zama16b")]
4341        let features = features.with(ZAMA16B);
4342        #[cfg(target_feature = "zawrs")]
4343        let features = features.with(ZAWRS);
4344        #[cfg(target_feature = "zba")]
4345        let features = features.with(ZBA);
4346        #[cfg(target_feature = "zbb")]
4347        let features = features.with(ZBB);
4348        #[cfg(target_feature = "zbc")]
4349        let features = features.with(ZBC);
4350        #[cfg(target_feature = "zbkb")]
4351        let features = features.with(ZBKB);
4352        #[cfg(target_feature = "zbkc")]
4353        let features = features.with(ZBKC);
4354        #[cfg(target_feature = "zbkx")]
4355        let features = features.with(ZBKX);
4356        #[cfg(target_feature = "zbs")]
4357        let features = features.with(ZBS);
4358        #[cfg(target_feature = "zca")]
4359        let features = features.with(ZCA);
4360        #[cfg(target_feature = "zcb")]
4361        let features = features.with(ZCB);
4362        #[cfg(target_feature = "zcmop")]
4363        let features = features.with(ZCMOP);
4364        #[cfg(target_feature = "zdinx")]
4365        let features = features.with(ZDINX);
4366        #[cfg(target_feature = "zfa")]
4367        let features = features.with(ZFA);
4368        #[cfg(target_feature = "zfbfmin")]
4369        let features = features.with(ZFBFMIN);
4370        #[cfg(target_feature = "zfh")]
4371        let features = features.with(ZFH);
4372        #[cfg(target_feature = "zfhmin")]
4373        let features = features.with(ZFHMIN);
4374        #[cfg(target_feature = "zfinx")]
4375        let features = features.with(ZFINX);
4376        #[cfg(target_feature = "zhinx")]
4377        let features = features.with(ZHINX);
4378        #[cfg(target_feature = "zhinxmin")]
4379        let features = features.with(ZHINXMIN);
4380        #[cfg(target_feature = "zic64b")]
4381        let features = features.with(ZIC64B);
4382        #[cfg(target_feature = "zicbom")]
4383        let features = features.with(ZICBOM);
4384        #[cfg(target_feature = "zicbop")]
4385        let features = features.with(ZICBOP);
4386        #[cfg(target_feature = "zicboz")]
4387        let features = features.with(ZICBOZ);
4388        #[cfg(target_feature = "ziccamoa")]
4389        let features = features.with(ZICCAMOA);
4390        #[cfg(target_feature = "ziccif")]
4391        let features = features.with(ZICCIF);
4392        #[cfg(target_feature = "zicclsm")]
4393        let features = features.with(ZICCLSM);
4394        #[cfg(target_feature = "ziccrse")]
4395        let features = features.with(ZICCRSE);
4396        #[cfg(target_feature = "zicntr")]
4397        let features = features.with(ZICNTR);
4398        #[cfg(target_feature = "zicond")]
4399        let features = features.with(ZICOND);
4400        #[cfg(target_feature = "zicsr")]
4401        let features = features.with(ZICSR);
4402        #[cfg(target_feature = "zifencei")]
4403        let features = features.with(ZIFENCEI);
4404        #[cfg(target_feature = "zihintntl")]
4405        let features = features.with(ZIHINTNTL);
4406        #[cfg(target_feature = "zihintpause")]
4407        let features = features.with(ZIHINTPAUSE);
4408        #[cfg(target_feature = "zihpm")]
4409        let features = features.with(ZIHPM);
4410        #[cfg(target_feature = "zimop")]
4411        let features = features.with(ZIMOP);
4412        #[cfg(target_feature = "zk")]
4413        let features = features.with(ZK);
4414        #[cfg(target_feature = "zkn")]
4415        let features = features.with(ZKN);
4416        #[cfg(target_feature = "zknd")]
4417        let features = features.with(ZKND);
4418        #[cfg(target_feature = "zkne")]
4419        let features = features.with(ZKNE);
4420        #[cfg(target_feature = "zknh")]
4421        let features = features.with(ZKNH);
4422        #[cfg(target_feature = "zkr")]
4423        let features = features.with(ZKR);
4424        #[cfg(target_feature = "zks")]
4425        let features = features.with(ZKS);
4426        #[cfg(target_feature = "zksed")]
4427        let features = features.with(ZKSED);
4428        #[cfg(target_feature = "zksh")]
4429        let features = features.with(ZKSH);
4430        #[cfg(target_feature = "zkt")]
4431        let features = features.with(ZKT);
4432        #[cfg(target_feature = "ztso")]
4433        let features = features.with(ZTSO);
4434        #[cfg(target_feature = "zvbb")]
4435        let features = features.with(ZVBB);
4436        #[cfg(target_feature = "zvbc")]
4437        let features = features.with(ZVBC);
4438        #[cfg(target_feature = "zve32f")]
4439        let features = features.with(ZVE32F);
4440        #[cfg(target_feature = "zve32x")]
4441        let features = features.with(ZVE32X);
4442        #[cfg(target_feature = "zve64d")]
4443        let features = features.with(ZVE64D);
4444        #[cfg(target_feature = "zve64f")]
4445        let features = features.with(ZVE64F);
4446        #[cfg(target_feature = "zve64x")]
4447        let features = features.with(ZVE64X);
4448        #[cfg(target_feature = "zvfbfmin")]
4449        let features = features.with(ZVFBFMIN);
4450        #[cfg(target_feature = "zvfbfwma")]
4451        let features = features.with(ZVFBFWMA);
4452        #[cfg(target_feature = "zvfh")]
4453        let features = features.with(ZVFH);
4454        #[cfg(target_feature = "zvfhmin")]
4455        let features = features.with(ZVFHMIN);
4456        #[cfg(target_feature = "zvkb")]
4457        let features = features.with(ZVKB);
4458        #[cfg(target_feature = "zvkg")]
4459        let features = features.with(ZVKG);
4460        #[cfg(target_feature = "zvkn")]
4461        let features = features.with(ZVKN);
4462        #[cfg(target_feature = "zvknc")]
4463        let features = features.with(ZVKNC);
4464        #[cfg(target_feature = "zvkned")]
4465        let features = features.with(ZVKNED);
4466        #[cfg(target_feature = "zvkng")]
4467        let features = features.with(ZVKNG);
4468        #[cfg(target_feature = "zvknha")]
4469        let features = features.with(ZVKNHA);
4470        #[cfg(target_feature = "zvknhb")]
4471        let features = features.with(ZVKNHB);
4472        #[cfg(target_feature = "zvks")]
4473        let features = features.with(ZVKS);
4474        #[cfg(target_feature = "zvksc")]
4475        let features = features.with(ZVKSC);
4476        #[cfg(target_feature = "zvksed")]
4477        let features = features.with(ZVKSED);
4478        #[cfg(target_feature = "zvksg")]
4479        let features = features.with(ZVKSG);
4480        #[cfg(target_feature = "zvksh")]
4481        let features = features.with(ZVKSH);
4482        #[cfg(target_feature = "zvkt")]
4483        let features = features.with(ZVKT);
4484        #[cfg(target_feature = "zvl1024b")]
4485        let features = features.with(ZVL1024B);
4486        #[cfg(target_feature = "zvl128b")]
4487        let features = features.with(ZVL128B);
4488        #[cfg(target_feature = "zvl16384b")]
4489        let features = features.with(ZVL16384B);
4490        #[cfg(target_feature = "zvl2048b")]
4491        let features = features.with(ZVL2048B);
4492        #[cfg(target_feature = "zvl256b")]
4493        let features = features.with(ZVL256B);
4494        #[cfg(target_feature = "zvl32768b")]
4495        let features = features.with(ZVL32768B);
4496        #[cfg(target_feature = "zvl32b")]
4497        let features = features.with(ZVL32B);
4498        #[cfg(target_feature = "zvl4096b")]
4499        let features = features.with(ZVL4096B);
4500        #[cfg(target_feature = "zvl512b")]
4501        let features = features.with(ZVL512B);
4502        #[cfg(target_feature = "zvl64b")]
4503        let features = features.with(ZVL64B);
4504        #[cfg(target_feature = "zvl65536b")]
4505        let features = features.with(ZVL65536B);
4506        #[cfg(target_feature = "zvl8192b")]
4507        let features = features.with(ZVL8192B);
4508        features
4509    }
4510
4511}
4512#[cfg(any(doc, target_arch = "s390x"))]
4513#[rustfmt::skip]
4514pub mod s390x {
4515    use super::*;
4516
4517    #[repr(u16)]
4518    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
4519    enum FeatureId {
4520        BACKCHAIN,
4521        CONCURRENT_FUNCTIONS,
4522        CRT_STATIC,
4523        DEFLATE_CONVERSION,
4524        ENHANCED_SORT,
4525        GUARDED_STORAGE,
4526        HIGH_WORD,
4527        MESSAGE_SECURITY_ASSIST_EXTENSION12,
4528        MESSAGE_SECURITY_ASSIST_EXTENSION3,
4529        MESSAGE_SECURITY_ASSIST_EXTENSION4,
4530        MESSAGE_SECURITY_ASSIST_EXTENSION5,
4531        MESSAGE_SECURITY_ASSIST_EXTENSION8,
4532        MESSAGE_SECURITY_ASSIST_EXTENSION9,
4533        MISCELLANEOUS_EXTENSIONS_2,
4534        MISCELLANEOUS_EXTENSIONS_3,
4535        MISCELLANEOUS_EXTENSIONS_4,
4536        NNP_ASSIST,
4537        TRANSACTIONAL_EXECUTION,
4538        VECTOR,
4539        VECTOR_ENHANCEMENTS_1,
4540        VECTOR_ENHANCEMENTS_2,
4541        VECTOR_ENHANCEMENTS_3,
4542        VECTOR_PACKED_DECIMAL,
4543        VECTOR_PACKED_DECIMAL_ENHANCEMENT,
4544        VECTOR_PACKED_DECIMAL_ENHANCEMENT_2,
4545        VECTOR_PACKED_DECIMAL_ENHANCEMENT_3,
4546    }
4547
4548    macro_rules! feature_set {
4549        ($($feature:ident),* $(,)?) => { {
4550            #[cfg(target_arch = "s390x")]
4551            {
4552                let features = TargetFeatures::empty();
4553                $(let features = features.with_bit(FeatureId::$feature as usize);)*
4554                features
4555            }
4556            #[cfg(all(doc, not(target_arch = "s390x")))]
4557            {
4558                TargetFeatures::empty()
4559            }
4560        } };
4561    }
4562    #[doc = "Store the address of the caller's frame into the callee's stack frame."]
4563    pub const BACKCHAIN: TargetFeatures = feature_set!(BACKCHAIN);
4564
4565    #[doc = "Assume that the concurrent-functions facility is installed."]
4566    pub const CONCURRENT_FUNCTIONS: TargetFeatures = feature_set!(CONCURRENT_FUNCTIONS);
4567
4568    #[doc = "Enables C Run-time Libraries to be statically linked."]
4569    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
4570
4571    #[doc = "Assume that the deflate-conversion facility is installed."]
4572    pub const DEFLATE_CONVERSION: TargetFeatures = feature_set!(DEFLATE_CONVERSION);
4573
4574    #[doc = "Assume that the enhanced-sort facility is installed."]
4575    pub const ENHANCED_SORT: TargetFeatures = feature_set!(ENHANCED_SORT);
4576
4577    #[doc = "Assume that the guarded-storage facility is installed."]
4578    pub const GUARDED_STORAGE: TargetFeatures = feature_set!(GUARDED_STORAGE);
4579
4580    #[doc = "Assume that the high-word facility is installed."]
4581    pub const HIGH_WORD: TargetFeatures = feature_set!(HIGH_WORD);
4582
4583    #[doc = "Assume that the message-security-assist extension facility 12 is installed."]
4584    pub const MESSAGE_SECURITY_ASSIST_EXTENSION12: TargetFeatures = feature_set!(MESSAGE_SECURITY_ASSIST_EXTENSION12);
4585
4586    #[doc = "Assume that the message-security-assist extension facility 3 is installed."]
4587    pub const MESSAGE_SECURITY_ASSIST_EXTENSION3: TargetFeatures = feature_set!(MESSAGE_SECURITY_ASSIST_EXTENSION3);
4588
4589    #[doc = "Assume that the message-security-assist extension facility 4 is installed."]
4590    pub const MESSAGE_SECURITY_ASSIST_EXTENSION4: TargetFeatures = feature_set!(MESSAGE_SECURITY_ASSIST_EXTENSION4);
4591
4592    #[doc = "Assume that the message-security-assist extension facility 5 is installed."]
4593    pub const MESSAGE_SECURITY_ASSIST_EXTENSION5: TargetFeatures = feature_set!(MESSAGE_SECURITY_ASSIST_EXTENSION5);
4594
4595    #[doc = "Assume that the message-security-assist extension facility 8 is installed."]
4596    pub const MESSAGE_SECURITY_ASSIST_EXTENSION8: TargetFeatures = feature_set!(MESSAGE_SECURITY_ASSIST_EXTENSION3, MESSAGE_SECURITY_ASSIST_EXTENSION8);
4597
4598    #[doc = "Assume that the message-security-assist extension facility 9 is installed."]
4599    pub const MESSAGE_SECURITY_ASSIST_EXTENSION9: TargetFeatures = feature_set!(MESSAGE_SECURITY_ASSIST_EXTENSION3, MESSAGE_SECURITY_ASSIST_EXTENSION4, MESSAGE_SECURITY_ASSIST_EXTENSION9);
4600
4601    #[doc = "Assume that the miscellaneous-extensions facility 2 is installed."]
4602    pub const MISCELLANEOUS_EXTENSIONS_2: TargetFeatures = feature_set!(MISCELLANEOUS_EXTENSIONS_2);
4603
4604    #[doc = "Assume that the miscellaneous-extensions facility 3 is installed."]
4605    pub const MISCELLANEOUS_EXTENSIONS_3: TargetFeatures = feature_set!(MISCELLANEOUS_EXTENSIONS_3);
4606
4607    #[doc = "Assume that the miscellaneous-extensions facility 4 is installed."]
4608    pub const MISCELLANEOUS_EXTENSIONS_4: TargetFeatures = feature_set!(MISCELLANEOUS_EXTENSIONS_4);
4609
4610    #[doc = "Assume that the NNP-assist facility is installed."]
4611    pub const NNP_ASSIST: TargetFeatures = feature_set!(NNP_ASSIST, VECTOR);
4612
4613    #[doc = "Assume that the transactional-execution facility is installed."]
4614    pub const TRANSACTIONAL_EXECUTION: TargetFeatures = feature_set!(TRANSACTIONAL_EXECUTION);
4615
4616    #[doc = "Assume that the vectory facility is installed."]
4617    pub const VECTOR: TargetFeatures = feature_set!(VECTOR);
4618
4619    #[doc = "Assume that the vector enhancements facility 1 is installed."]
4620    pub const VECTOR_ENHANCEMENTS_1: TargetFeatures = feature_set!(VECTOR, VECTOR_ENHANCEMENTS_1);
4621
4622    #[doc = "Assume that the vector enhancements facility 2 is installed."]
4623    pub const VECTOR_ENHANCEMENTS_2: TargetFeatures = feature_set!(VECTOR, VECTOR_ENHANCEMENTS_1, VECTOR_ENHANCEMENTS_2);
4624
4625    #[doc = "Assume that the vector enhancements facility 3 is installed."]
4626    pub const VECTOR_ENHANCEMENTS_3: TargetFeatures = feature_set!(VECTOR, VECTOR_ENHANCEMENTS_1, VECTOR_ENHANCEMENTS_2, VECTOR_ENHANCEMENTS_3);
4627
4628    #[doc = "Assume that the vector packed decimal facility is installed."]
4629    pub const VECTOR_PACKED_DECIMAL: TargetFeatures = feature_set!(VECTOR, VECTOR_PACKED_DECIMAL);
4630
4631    #[doc = "Assume that the vector packed decimal enhancement facility is installed."]
4632    pub const VECTOR_PACKED_DECIMAL_ENHANCEMENT: TargetFeatures = feature_set!(VECTOR, VECTOR_PACKED_DECIMAL, VECTOR_PACKED_DECIMAL_ENHANCEMENT);
4633
4634    #[doc = "Assume that the vector packed decimal enhancement facility 2 is installed."]
4635    pub const VECTOR_PACKED_DECIMAL_ENHANCEMENT_2: TargetFeatures = feature_set!(VECTOR, VECTOR_PACKED_DECIMAL, VECTOR_PACKED_DECIMAL_ENHANCEMENT, VECTOR_PACKED_DECIMAL_ENHANCEMENT_2);
4636
4637    #[doc = "Assume that the vector packed decimal enhancement facility 3 is installed."]
4638    pub const VECTOR_PACKED_DECIMAL_ENHANCEMENT_3: TargetFeatures = feature_set!(VECTOR, VECTOR_PACKED_DECIMAL, VECTOR_PACKED_DECIMAL_ENHANCEMENT, VECTOR_PACKED_DECIMAL_ENHANCEMENT_2, VECTOR_PACKED_DECIMAL_ENHANCEMENT_3);
4639
4640
4641    #[cfg(target_arch = "s390x")]
4642    pub(crate) const FEATURES: &[FeatureData] = &[
4643        FeatureData::new("backchain", BACKCHAIN),
4644        FeatureData::new("concurrent-functions", CONCURRENT_FUNCTIONS),
4645        FeatureData::new("crt-static", CRT_STATIC),
4646        FeatureData::new("deflate-conversion", DEFLATE_CONVERSION),
4647        FeatureData::new("enhanced-sort", ENHANCED_SORT),
4648        FeatureData::new("guarded-storage", GUARDED_STORAGE),
4649        FeatureData::new("high-word", HIGH_WORD),
4650        FeatureData::new("message-security-assist-extension12", MESSAGE_SECURITY_ASSIST_EXTENSION12),
4651        FeatureData::new("message-security-assist-extension3", MESSAGE_SECURITY_ASSIST_EXTENSION3),
4652        FeatureData::new("message-security-assist-extension4", MESSAGE_SECURITY_ASSIST_EXTENSION4),
4653        FeatureData::new("message-security-assist-extension5", MESSAGE_SECURITY_ASSIST_EXTENSION5),
4654        FeatureData::new("message-security-assist-extension8", MESSAGE_SECURITY_ASSIST_EXTENSION8),
4655        FeatureData::new("message-security-assist-extension9", MESSAGE_SECURITY_ASSIST_EXTENSION9),
4656        FeatureData::new("miscellaneous-extensions-2", MISCELLANEOUS_EXTENSIONS_2),
4657        FeatureData::new("miscellaneous-extensions-3", MISCELLANEOUS_EXTENSIONS_3),
4658        FeatureData::new("miscellaneous-extensions-4", MISCELLANEOUS_EXTENSIONS_4),
4659        FeatureData::new("nnp-assist", NNP_ASSIST),
4660        FeatureData::new("transactional-execution", TRANSACTIONAL_EXECUTION),
4661        FeatureData::new("vector", VECTOR),
4662        FeatureData::new("vector-enhancements-1", VECTOR_ENHANCEMENTS_1),
4663        FeatureData::new("vector-enhancements-2", VECTOR_ENHANCEMENTS_2),
4664        FeatureData::new("vector-enhancements-3", VECTOR_ENHANCEMENTS_3),
4665        FeatureData::new("vector-packed-decimal", VECTOR_PACKED_DECIMAL),
4666        FeatureData::new("vector-packed-decimal-enhancement", VECTOR_PACKED_DECIMAL_ENHANCEMENT),
4667        FeatureData::new("vector-packed-decimal-enhancement-2", VECTOR_PACKED_DECIMAL_ENHANCEMENT_2),
4668        FeatureData::new("vector-packed-decimal-enhancement-3", VECTOR_PACKED_DECIMAL_ENHANCEMENT_3),
4669    ];
4670
4671    #[cfg(target_arch = "s390x")]
4672    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
4673    pub(crate) const fn enabled_for_target() -> TargetFeatures {
4674        let features = TargetFeatures::empty();
4675        #[cfg(target_feature = "backchain")]
4676        let features = features.with(BACKCHAIN);
4677        #[cfg(target_feature = "concurrent-functions")]
4678        let features = features.with(CONCURRENT_FUNCTIONS);
4679        #[cfg(target_feature = "crt-static")]
4680        let features = features.with(CRT_STATIC);
4681        #[cfg(target_feature = "deflate-conversion")]
4682        let features = features.with(DEFLATE_CONVERSION);
4683        #[cfg(target_feature = "enhanced-sort")]
4684        let features = features.with(ENHANCED_SORT);
4685        #[cfg(target_feature = "guarded-storage")]
4686        let features = features.with(GUARDED_STORAGE);
4687        #[cfg(target_feature = "high-word")]
4688        let features = features.with(HIGH_WORD);
4689        #[cfg(target_feature = "message-security-assist-extension12")]
4690        let features = features.with(MESSAGE_SECURITY_ASSIST_EXTENSION12);
4691        #[cfg(target_feature = "message-security-assist-extension3")]
4692        let features = features.with(MESSAGE_SECURITY_ASSIST_EXTENSION3);
4693        #[cfg(target_feature = "message-security-assist-extension4")]
4694        let features = features.with(MESSAGE_SECURITY_ASSIST_EXTENSION4);
4695        #[cfg(target_feature = "message-security-assist-extension5")]
4696        let features = features.with(MESSAGE_SECURITY_ASSIST_EXTENSION5);
4697        #[cfg(target_feature = "message-security-assist-extension8")]
4698        let features = features.with(MESSAGE_SECURITY_ASSIST_EXTENSION8);
4699        #[cfg(target_feature = "message-security-assist-extension9")]
4700        let features = features.with(MESSAGE_SECURITY_ASSIST_EXTENSION9);
4701        #[cfg(target_feature = "miscellaneous-extensions-2")]
4702        let features = features.with(MISCELLANEOUS_EXTENSIONS_2);
4703        #[cfg(target_feature = "miscellaneous-extensions-3")]
4704        let features = features.with(MISCELLANEOUS_EXTENSIONS_3);
4705        #[cfg(target_feature = "miscellaneous-extensions-4")]
4706        let features = features.with(MISCELLANEOUS_EXTENSIONS_4);
4707        #[cfg(target_feature = "nnp-assist")]
4708        let features = features.with(NNP_ASSIST);
4709        #[cfg(target_feature = "transactional-execution")]
4710        let features = features.with(TRANSACTIONAL_EXECUTION);
4711        #[cfg(target_feature = "vector")]
4712        let features = features.with(VECTOR);
4713        #[cfg(target_feature = "vector-enhancements-1")]
4714        let features = features.with(VECTOR_ENHANCEMENTS_1);
4715        #[cfg(target_feature = "vector-enhancements-2")]
4716        let features = features.with(VECTOR_ENHANCEMENTS_2);
4717        #[cfg(target_feature = "vector-enhancements-3")]
4718        let features = features.with(VECTOR_ENHANCEMENTS_3);
4719        #[cfg(target_feature = "vector-packed-decimal")]
4720        let features = features.with(VECTOR_PACKED_DECIMAL);
4721        #[cfg(target_feature = "vector-packed-decimal-enhancement")]
4722        let features = features.with(VECTOR_PACKED_DECIMAL_ENHANCEMENT);
4723        #[cfg(target_feature = "vector-packed-decimal-enhancement-2")]
4724        let features = features.with(VECTOR_PACKED_DECIMAL_ENHANCEMENT_2);
4725        #[cfg(target_feature = "vector-packed-decimal-enhancement-3")]
4726        let features = features.with(VECTOR_PACKED_DECIMAL_ENHANCEMENT_3);
4727        features
4728    }
4729
4730}
4731#[cfg(any(doc, target_arch = "sparc"))]
4732#[rustfmt::skip]
4733pub mod sparc {
4734    use super::*;
4735
4736    #[repr(u16)]
4737    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
4738    enum FeatureId {
4739        CRT_STATIC,
4740        LEONCASA,
4741        V8PLUS,
4742        V9,
4743    }
4744
4745    macro_rules! feature_set {
4746        ($($feature:ident),* $(,)?) => { {
4747            #[cfg(target_arch = "sparc")]
4748            {
4749                let features = TargetFeatures::empty();
4750                $(let features = features.with_bit(FeatureId::$feature as usize);)*
4751                features
4752            }
4753            #[cfg(all(doc, not(target_arch = "sparc")))]
4754            {
4755                TargetFeatures::empty()
4756            }
4757        } };
4758    }
4759    #[doc = "Enables C Run-time Libraries to be statically linked."]
4760    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
4761
4762    #[doc = "Enable CASA instruction for LEON3 and LEON4 processors."]
4763    pub const LEONCASA: TargetFeatures = feature_set!(LEONCASA);
4764
4765    #[doc = "Enable V8+ mode, allowing use of 64-bit V9 instructions in 32-bit code."]
4766    pub const V8PLUS: TargetFeatures = feature_set!(V8PLUS);
4767
4768    #[doc = "Enable SPARC-V9 instructions."]
4769    pub const V9: TargetFeatures = feature_set!(V9);
4770
4771
4772    #[cfg(target_arch = "sparc")]
4773    pub(crate) const FEATURES: &[FeatureData] = &[
4774        FeatureData::new("crt-static", CRT_STATIC),
4775        FeatureData::new("leoncasa", LEONCASA),
4776        FeatureData::new("v8plus", V8PLUS),
4777        FeatureData::new("v9", V9),
4778    ];
4779
4780    #[cfg(target_arch = "sparc")]
4781    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
4782    pub(crate) const fn enabled_for_target() -> TargetFeatures {
4783        let features = TargetFeatures::empty();
4784        #[cfg(target_feature = "crt-static")]
4785        let features = features.with(CRT_STATIC);
4786        #[cfg(target_feature = "leoncasa")]
4787        let features = features.with(LEONCASA);
4788        #[cfg(target_feature = "v8plus")]
4789        let features = features.with(V8PLUS);
4790        #[cfg(target_feature = "v9")]
4791        let features = features.with(V9);
4792        features
4793    }
4794
4795}
4796#[cfg(any(doc, target_arch = "sparc64"))]
4797#[rustfmt::skip]
4798pub mod sparc64 {
4799    use super::*;
4800
4801    #[repr(u16)]
4802    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
4803    enum FeatureId {
4804        CRT_STATIC,
4805        LEONCASA,
4806        V8PLUS,
4807        V9,
4808    }
4809
4810    macro_rules! feature_set {
4811        ($($feature:ident),* $(,)?) => { {
4812            #[cfg(target_arch = "sparc64")]
4813            {
4814                let features = TargetFeatures::empty();
4815                $(let features = features.with_bit(FeatureId::$feature as usize);)*
4816                features
4817            }
4818            #[cfg(all(doc, not(target_arch = "sparc64")))]
4819            {
4820                TargetFeatures::empty()
4821            }
4822        } };
4823    }
4824    #[doc = "Enables C Run-time Libraries to be statically linked."]
4825    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
4826
4827    #[doc = "Enable CASA instruction for LEON3 and LEON4 processors."]
4828    pub const LEONCASA: TargetFeatures = feature_set!(LEONCASA);
4829
4830    #[doc = "Enable V8+ mode, allowing use of 64-bit V9 instructions in 32-bit code."]
4831    pub const V8PLUS: TargetFeatures = feature_set!(V8PLUS);
4832
4833    #[doc = "Enable SPARC-V9 instructions."]
4834    pub const V9: TargetFeatures = feature_set!(V9);
4835
4836
4837    #[cfg(target_arch = "sparc64")]
4838    pub(crate) const FEATURES: &[FeatureData] = &[
4839        FeatureData::new("crt-static", CRT_STATIC),
4840        FeatureData::new("leoncasa", LEONCASA),
4841        FeatureData::new("v8plus", V8PLUS),
4842        FeatureData::new("v9", V9),
4843    ];
4844
4845    #[cfg(target_arch = "sparc64")]
4846    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
4847    pub(crate) const fn enabled_for_target() -> TargetFeatures {
4848        let features = TargetFeatures::empty();
4849        #[cfg(target_feature = "crt-static")]
4850        let features = features.with(CRT_STATIC);
4851        #[cfg(target_feature = "leoncasa")]
4852        let features = features.with(LEONCASA);
4853        #[cfg(target_feature = "v8plus")]
4854        let features = features.with(V8PLUS);
4855        #[cfg(target_feature = "v9")]
4856        let features = features.with(V9);
4857        features
4858    }
4859
4860}
4861#[cfg(any(doc, target_arch = "wasm32"))]
4862#[rustfmt::skip]
4863pub mod wasm32 {
4864    use super::*;
4865
4866    #[repr(u16)]
4867    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
4868    enum FeatureId {
4869        ATOMICS,
4870        BULK_MEMORY,
4871        CRT_STATIC,
4872        EXCEPTION_HANDLING,
4873        EXTENDED_CONST,
4874        GC,
4875        MULTIVALUE,
4876        MUTABLE_GLOBALS,
4877        NONTRAPPING_FPTOINT,
4878        REFERENCE_TYPES,
4879        RELAXED_SIMD,
4880        SIGN_EXT,
4881        SIMD128,
4882        TAIL_CALL,
4883        WIDE_ARITHMETIC,
4884    }
4885
4886    macro_rules! feature_set {
4887        ($($feature:ident),* $(,)?) => { {
4888            #[cfg(target_arch = "wasm32")]
4889            {
4890                let features = TargetFeatures::empty();
4891                $(let features = features.with_bit(FeatureId::$feature as usize);)*
4892                features
4893            }
4894            #[cfg(all(doc, not(target_arch = "wasm32")))]
4895            {
4896                TargetFeatures::empty()
4897            }
4898        } };
4899    }
4900    #[doc = "Enable Atomics."]
4901    pub const ATOMICS: TargetFeatures = feature_set!(ATOMICS);
4902
4903    #[doc = "Enable bulk memory operations."]
4904    pub const BULK_MEMORY: TargetFeatures = feature_set!(BULK_MEMORY);
4905
4906    #[doc = "Enables C Run-time Libraries to be statically linked."]
4907    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
4908
4909    #[doc = "Enable Wasm exception handling."]
4910    pub const EXCEPTION_HANDLING: TargetFeatures = feature_set!(EXCEPTION_HANDLING);
4911
4912    #[doc = "Enable extended const expressions."]
4913    pub const EXTENDED_CONST: TargetFeatures = feature_set!(EXTENDED_CONST);
4914
4915    #[doc = "Enable wasm gc."]
4916    pub const GC: TargetFeatures = feature_set!(GC, REFERENCE_TYPES);
4917
4918    #[doc = "Enable multivalue blocks, instructions, and functions."]
4919    pub const MULTIVALUE: TargetFeatures = feature_set!(MULTIVALUE);
4920
4921    #[doc = "Enable mutable globals."]
4922    pub const MUTABLE_GLOBALS: TargetFeatures = feature_set!(MUTABLE_GLOBALS);
4923
4924    #[doc = "Enable non-trapping float-to-int conversion operators."]
4925    pub const NONTRAPPING_FPTOINT: TargetFeatures = feature_set!(NONTRAPPING_FPTOINT);
4926
4927    #[doc = "Enable reference types."]
4928    pub const REFERENCE_TYPES: TargetFeatures = feature_set!(REFERENCE_TYPES);
4929
4930    #[doc = "Enable relaxed-simd instructions."]
4931    pub const RELAXED_SIMD: TargetFeatures = feature_set!(RELAXED_SIMD, SIMD128);
4932
4933    #[doc = "Enable sign extension operators."]
4934    pub const SIGN_EXT: TargetFeatures = feature_set!(SIGN_EXT);
4935
4936    #[doc = "Enable 128-bit SIMD."]
4937    pub const SIMD128: TargetFeatures = feature_set!(SIMD128);
4938
4939    #[doc = "Enable tail call instructions."]
4940    pub const TAIL_CALL: TargetFeatures = feature_set!(TAIL_CALL);
4941
4942    #[doc = "Enable wide-arithmetic instructions."]
4943    pub const WIDE_ARITHMETIC: TargetFeatures = feature_set!(WIDE_ARITHMETIC);
4944
4945
4946    #[cfg(target_arch = "wasm32")]
4947    pub(crate) const FEATURES: &[FeatureData] = &[
4948        FeatureData::new("atomics", ATOMICS),
4949        FeatureData::new("bulk-memory", BULK_MEMORY),
4950        FeatureData::new("crt-static", CRT_STATIC),
4951        FeatureData::new("exception-handling", EXCEPTION_HANDLING),
4952        FeatureData::new("extended-const", EXTENDED_CONST),
4953        FeatureData::new("gc", GC),
4954        FeatureData::new("multivalue", MULTIVALUE),
4955        FeatureData::new("mutable-globals", MUTABLE_GLOBALS),
4956        FeatureData::new("nontrapping-fptoint", NONTRAPPING_FPTOINT),
4957        FeatureData::new("reference-types", REFERENCE_TYPES),
4958        FeatureData::new("relaxed-simd", RELAXED_SIMD),
4959        FeatureData::new("sign-ext", SIGN_EXT),
4960        FeatureData::new("simd128", SIMD128),
4961        FeatureData::new("tail-call", TAIL_CALL),
4962        FeatureData::new("wide-arithmetic", WIDE_ARITHMETIC),
4963    ];
4964
4965    #[cfg(target_arch = "wasm32")]
4966    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
4967    pub(crate) const fn enabled_for_target() -> TargetFeatures {
4968        let features = TargetFeatures::empty();
4969        #[cfg(target_feature = "atomics")]
4970        let features = features.with(ATOMICS);
4971        #[cfg(target_feature = "bulk-memory")]
4972        let features = features.with(BULK_MEMORY);
4973        #[cfg(target_feature = "crt-static")]
4974        let features = features.with(CRT_STATIC);
4975        #[cfg(target_feature = "exception-handling")]
4976        let features = features.with(EXCEPTION_HANDLING);
4977        #[cfg(target_feature = "extended-const")]
4978        let features = features.with(EXTENDED_CONST);
4979        #[cfg(target_feature = "gc")]
4980        let features = features.with(GC);
4981        #[cfg(target_feature = "multivalue")]
4982        let features = features.with(MULTIVALUE);
4983        #[cfg(target_feature = "mutable-globals")]
4984        let features = features.with(MUTABLE_GLOBALS);
4985        #[cfg(target_feature = "nontrapping-fptoint")]
4986        let features = features.with(NONTRAPPING_FPTOINT);
4987        #[cfg(target_feature = "reference-types")]
4988        let features = features.with(REFERENCE_TYPES);
4989        #[cfg(target_feature = "relaxed-simd")]
4990        let features = features.with(RELAXED_SIMD);
4991        #[cfg(target_feature = "sign-ext")]
4992        let features = features.with(SIGN_EXT);
4993        #[cfg(target_feature = "simd128")]
4994        let features = features.with(SIMD128);
4995        #[cfg(target_feature = "tail-call")]
4996        let features = features.with(TAIL_CALL);
4997        #[cfg(target_feature = "wide-arithmetic")]
4998        let features = features.with(WIDE_ARITHMETIC);
4999        features
5000    }
5001
5002}
5003#[cfg(any(doc, target_arch = "wasm64"))]
5004#[rustfmt::skip]
5005pub mod wasm64 {
5006    use super::*;
5007
5008    #[repr(u16)]
5009    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
5010    enum FeatureId {
5011        ATOMICS,
5012        BULK_MEMORY,
5013        CRT_STATIC,
5014        EXCEPTION_HANDLING,
5015        EXTENDED_CONST,
5016        GC,
5017        MULTIVALUE,
5018        MUTABLE_GLOBALS,
5019        NONTRAPPING_FPTOINT,
5020        REFERENCE_TYPES,
5021        RELAXED_SIMD,
5022        SIGN_EXT,
5023        SIMD128,
5024        TAIL_CALL,
5025        WIDE_ARITHMETIC,
5026    }
5027
5028    macro_rules! feature_set {
5029        ($($feature:ident),* $(,)?) => { {
5030            #[cfg(target_arch = "wasm64")]
5031            {
5032                let features = TargetFeatures::empty();
5033                $(let features = features.with_bit(FeatureId::$feature as usize);)*
5034                features
5035            }
5036            #[cfg(all(doc, not(target_arch = "wasm64")))]
5037            {
5038                TargetFeatures::empty()
5039            }
5040        } };
5041    }
5042    #[doc = "Enable Atomics."]
5043    pub const ATOMICS: TargetFeatures = feature_set!(ATOMICS);
5044
5045    #[doc = "Enable bulk memory operations."]
5046    pub const BULK_MEMORY: TargetFeatures = feature_set!(BULK_MEMORY);
5047
5048    #[doc = "Enables C Run-time Libraries to be statically linked."]
5049    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
5050
5051    #[doc = "Enable Wasm exception handling."]
5052    pub const EXCEPTION_HANDLING: TargetFeatures = feature_set!(EXCEPTION_HANDLING);
5053
5054    #[doc = "Enable extended const expressions."]
5055    pub const EXTENDED_CONST: TargetFeatures = feature_set!(EXTENDED_CONST);
5056
5057    #[doc = "Enable wasm gc."]
5058    pub const GC: TargetFeatures = feature_set!(GC, REFERENCE_TYPES);
5059
5060    #[doc = "Enable multivalue blocks, instructions, and functions."]
5061    pub const MULTIVALUE: TargetFeatures = feature_set!(MULTIVALUE);
5062
5063    #[doc = "Enable mutable globals."]
5064    pub const MUTABLE_GLOBALS: TargetFeatures = feature_set!(MUTABLE_GLOBALS);
5065
5066    #[doc = "Enable non-trapping float-to-int conversion operators."]
5067    pub const NONTRAPPING_FPTOINT: TargetFeatures = feature_set!(NONTRAPPING_FPTOINT);
5068
5069    #[doc = "Enable reference types."]
5070    pub const REFERENCE_TYPES: TargetFeatures = feature_set!(REFERENCE_TYPES);
5071
5072    #[doc = "Enable relaxed-simd instructions."]
5073    pub const RELAXED_SIMD: TargetFeatures = feature_set!(RELAXED_SIMD, SIMD128);
5074
5075    #[doc = "Enable sign extension operators."]
5076    pub const SIGN_EXT: TargetFeatures = feature_set!(SIGN_EXT);
5077
5078    #[doc = "Enable 128-bit SIMD."]
5079    pub const SIMD128: TargetFeatures = feature_set!(SIMD128);
5080
5081    #[doc = "Enable tail call instructions."]
5082    pub const TAIL_CALL: TargetFeatures = feature_set!(TAIL_CALL);
5083
5084    #[doc = "Enable wide-arithmetic instructions."]
5085    pub const WIDE_ARITHMETIC: TargetFeatures = feature_set!(WIDE_ARITHMETIC);
5086
5087
5088    #[cfg(target_arch = "wasm64")]
5089    pub(crate) const FEATURES: &[FeatureData] = &[
5090        FeatureData::new("atomics", ATOMICS),
5091        FeatureData::new("bulk-memory", BULK_MEMORY),
5092        FeatureData::new("crt-static", CRT_STATIC),
5093        FeatureData::new("exception-handling", EXCEPTION_HANDLING),
5094        FeatureData::new("extended-const", EXTENDED_CONST),
5095        FeatureData::new("gc", GC),
5096        FeatureData::new("multivalue", MULTIVALUE),
5097        FeatureData::new("mutable-globals", MUTABLE_GLOBALS),
5098        FeatureData::new("nontrapping-fptoint", NONTRAPPING_FPTOINT),
5099        FeatureData::new("reference-types", REFERENCE_TYPES),
5100        FeatureData::new("relaxed-simd", RELAXED_SIMD),
5101        FeatureData::new("sign-ext", SIGN_EXT),
5102        FeatureData::new("simd128", SIMD128),
5103        FeatureData::new("tail-call", TAIL_CALL),
5104        FeatureData::new("wide-arithmetic", WIDE_ARITHMETIC),
5105    ];
5106
5107    #[cfg(target_arch = "wasm64")]
5108    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
5109    pub(crate) const fn enabled_for_target() -> TargetFeatures {
5110        let features = TargetFeatures::empty();
5111        #[cfg(target_feature = "atomics")]
5112        let features = features.with(ATOMICS);
5113        #[cfg(target_feature = "bulk-memory")]
5114        let features = features.with(BULK_MEMORY);
5115        #[cfg(target_feature = "crt-static")]
5116        let features = features.with(CRT_STATIC);
5117        #[cfg(target_feature = "exception-handling")]
5118        let features = features.with(EXCEPTION_HANDLING);
5119        #[cfg(target_feature = "extended-const")]
5120        let features = features.with(EXTENDED_CONST);
5121        #[cfg(target_feature = "gc")]
5122        let features = features.with(GC);
5123        #[cfg(target_feature = "multivalue")]
5124        let features = features.with(MULTIVALUE);
5125        #[cfg(target_feature = "mutable-globals")]
5126        let features = features.with(MUTABLE_GLOBALS);
5127        #[cfg(target_feature = "nontrapping-fptoint")]
5128        let features = features.with(NONTRAPPING_FPTOINT);
5129        #[cfg(target_feature = "reference-types")]
5130        let features = features.with(REFERENCE_TYPES);
5131        #[cfg(target_feature = "relaxed-simd")]
5132        let features = features.with(RELAXED_SIMD);
5133        #[cfg(target_feature = "sign-ext")]
5134        let features = features.with(SIGN_EXT);
5135        #[cfg(target_feature = "simd128")]
5136        let features = features.with(SIMD128);
5137        #[cfg(target_feature = "tail-call")]
5138        let features = features.with(TAIL_CALL);
5139        #[cfg(target_feature = "wide-arithmetic")]
5140        let features = features.with(WIDE_ARITHMETIC);
5141        features
5142    }
5143
5144}
5145#[cfg(any(doc, target_arch = "x86"))]
5146#[rustfmt::skip]
5147pub mod x86 {
5148    use super::*;
5149
5150    #[repr(u16)]
5151    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
5152    enum FeatureId {
5153        ADX,
5154        AES,
5155        AMX_AVX512,
5156        AMX_BF16,
5157        AMX_COMPLEX,
5158        AMX_FP16,
5159        AMX_FP8,
5160        AMX_INT8,
5161        AMX_MOVRS,
5162        AMX_TILE,
5163        APXF,
5164        AVX,
5165        AVX10_1,
5166        AVX10_2,
5167        AVX2,
5168        AVX512BF16,
5169        AVX512BITALG,
5170        AVX512BW,
5171        AVX512CD,
5172        AVX512DQ,
5173        AVX512F,
5174        AVX512FP16,
5175        AVX512IFMA,
5176        AVX512VBMI,
5177        AVX512VBMI2,
5178        AVX512VL,
5179        AVX512VNNI,
5180        AVX512VP2INTERSECT,
5181        AVX512VPOPCNTDQ,
5182        AVXIFMA,
5183        AVXNECONVERT,
5184        AVXVNNI,
5185        AVXVNNIINT16,
5186        AVXVNNIINT8,
5187        BMI1,
5188        BMI2,
5189        CLFLUSHOPT,
5190        CMPXCHG16B,
5191        CRT_STATIC,
5192        ERMSB,
5193        F16C,
5194        FMA,
5195        FMA4,
5196        FXSR,
5197        GFNI,
5198        KL,
5199        LAHFSAHF,
5200        LZCNT,
5201        MOVBE,
5202        MOVRS,
5203        PCLMULQDQ,
5204        POPCNT,
5205        PRFCHW,
5206        RDRAND,
5207        RDSEED,
5208        RTM,
5209        SHA,
5210        SHA512,
5211        SM3,
5212        SM4,
5213        SSE,
5214        SSE2,
5215        SSE3,
5216        SSE4_1,
5217        SSE4_2,
5218        SSE4A,
5219        SSSE3,
5220        TBM,
5221        VAES,
5222        VPCLMULQDQ,
5223        WIDEKL,
5224        X87,
5225        XOP,
5226        XSAVE,
5227        XSAVEC,
5228        XSAVEOPT,
5229        XSAVES,
5230    }
5231
5232    macro_rules! feature_set {
5233        ($($feature:ident),* $(,)?) => { {
5234            #[cfg(target_arch = "x86")]
5235            {
5236                let features = TargetFeatures::empty();
5237                $(let features = features.with_bit(FeatureId::$feature as usize);)*
5238                features
5239            }
5240            #[cfg(all(doc, not(target_arch = "x86")))]
5241            {
5242                TargetFeatures::empty()
5243            }
5244        } };
5245    }
5246    #[doc = "Support ADX instructions."]
5247    pub const ADX: TargetFeatures = feature_set!(ADX);
5248
5249    #[doc = "Enable AES instructions."]
5250    pub const AES: TargetFeatures = feature_set!(AES, SSE, SSE2);
5251
5252    #[doc = "Support AMX-AVX512 instructions."]
5253    pub const AMX_AVX512: TargetFeatures = feature_set!(AMX_AVX512, AMX_TILE);
5254
5255    #[doc = "Support AMX-BF16 instructions."]
5256    pub const AMX_BF16: TargetFeatures = feature_set!(AMX_BF16, AMX_TILE);
5257
5258    #[doc = "Support AMX-COMPLEX instructions."]
5259    pub const AMX_COMPLEX: TargetFeatures = feature_set!(AMX_COMPLEX, AMX_TILE);
5260
5261    #[doc = "Support AMX amx-fp16 instructions."]
5262    pub const AMX_FP16: TargetFeatures = feature_set!(AMX_FP16, AMX_TILE);
5263
5264    #[doc = "Support AMX-FP8 instructions."]
5265    pub const AMX_FP8: TargetFeatures = feature_set!(AMX_FP8, AMX_TILE);
5266
5267    #[doc = "Support AMX-INT8 instructions."]
5268    pub const AMX_INT8: TargetFeatures = feature_set!(AMX_INT8, AMX_TILE);
5269
5270    #[doc = "Support AMX-MOVRS instructions."]
5271    pub const AMX_MOVRS: TargetFeatures = feature_set!(AMX_MOVRS, AMX_TILE);
5272
5273    #[doc = "Support AMX-TILE instructions."]
5274    pub const AMX_TILE: TargetFeatures = feature_set!(AMX_TILE);
5275
5276    #[doc = "Support extended general purpose register."]
5277    pub const APXF: TargetFeatures = feature_set!(APXF);
5278
5279    #[doc = "Enable AVX instructions."]
5280    pub const AVX: TargetFeatures = feature_set!(AVX, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5281
5282    #[doc = "Support AVX10.1 instruction."]
5283    pub const AVX10_1: TargetFeatures = feature_set!(AVX, AVX10_1, AVX2, AVX512BF16, AVX512BITALG, AVX512BW, AVX512CD, AVX512DQ, AVX512F, AVX512FP16, AVX512IFMA, AVX512VBMI, AVX512VBMI2, AVX512VL, AVX512VNNI, AVX512VPOPCNTDQ, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5284
5285    #[doc = "Support AVX10.2 instruction."]
5286    pub const AVX10_2: TargetFeatures = feature_set!(AVX, AVX10_1, AVX10_2, AVX2, AVX512BF16, AVX512BITALG, AVX512BW, AVX512CD, AVX512DQ, AVX512F, AVX512FP16, AVX512IFMA, AVX512VBMI, AVX512VBMI2, AVX512VL, AVX512VNNI, AVX512VPOPCNTDQ, AVXVNNI, AVXVNNIINT16, AVXVNNIINT8, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5287
5288    #[doc = "Enable AVX2 instructions."]
5289    pub const AVX2: TargetFeatures = feature_set!(AVX, AVX2, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5290
5291    #[doc = "Support bfloat16 floating point."]
5292    pub const AVX512BF16: TargetFeatures = feature_set!(AVX, AVX2, AVX512BF16, AVX512BW, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5293
5294    #[doc = "Enable AVX-512 Bit Algorithms."]
5295    pub const AVX512BITALG: TargetFeatures = feature_set!(AVX, AVX2, AVX512BITALG, AVX512BW, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5296
5297    #[doc = "Enable AVX-512 Byte and Word Instructions."]
5298    pub const AVX512BW: TargetFeatures = feature_set!(AVX, AVX2, AVX512BW, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5299
5300    #[doc = "Enable AVX-512 Conflict Detection Instructions."]
5301    pub const AVX512CD: TargetFeatures = feature_set!(AVX, AVX2, AVX512CD, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5302
5303    #[doc = "Enable AVX-512 Doubleword and Quadword Instructions."]
5304    pub const AVX512DQ: TargetFeatures = feature_set!(AVX, AVX2, AVX512DQ, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5305
5306    #[doc = "Enable AVX-512 instructions."]
5307    pub const AVX512F: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5308
5309    #[doc = "Support 16-bit floating point."]
5310    pub const AVX512FP16: TargetFeatures = feature_set!(AVX, AVX2, AVX512BW, AVX512F, AVX512FP16, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5311
5312    #[doc = "Enable AVX-512 Integer Fused Multiple-Add."]
5313    pub const AVX512IFMA: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, AVX512IFMA, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5314
5315    #[doc = "Enable AVX-512 Vector Byte Manipulation Instructions."]
5316    pub const AVX512VBMI: TargetFeatures = feature_set!(AVX, AVX2, AVX512BW, AVX512F, AVX512VBMI, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5317
5318    #[doc = "Enable AVX-512 further Vector Byte Manipulation Instructions."]
5319    pub const AVX512VBMI2: TargetFeatures = feature_set!(AVX, AVX2, AVX512BW, AVX512F, AVX512VBMI2, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5320
5321    #[doc = "Enable AVX-512 Vector Length eXtensions."]
5322    pub const AVX512VL: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, AVX512VL, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5323
5324    #[doc = "Enable AVX-512 Vector Neural Network Instructions."]
5325    pub const AVX512VNNI: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, AVX512VNNI, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5326
5327    #[doc = "Enable AVX-512 vp2intersect."]
5328    pub const AVX512VP2INTERSECT: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, AVX512VP2INTERSECT, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5329
5330    #[doc = "Enable AVX-512 Population Count Instructions."]
5331    pub const AVX512VPOPCNTDQ: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, AVX512VPOPCNTDQ, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5332
5333    #[doc = "Enable AVX-IFMA."]
5334    pub const AVXIFMA: TargetFeatures = feature_set!(AVX, AVX2, AVXIFMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5335
5336    #[doc = "Support AVX-NE-CONVERT instructions."]
5337    pub const AVXNECONVERT: TargetFeatures = feature_set!(AVX, AVX2, AVXNECONVERT, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5338
5339    #[doc = "Support AVX_VNNI encoding."]
5340    pub const AVXVNNI: TargetFeatures = feature_set!(AVX, AVX2, AVXVNNI, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5341
5342    #[doc = "Enable AVX-VNNI-INT16."]
5343    pub const AVXVNNIINT16: TargetFeatures = feature_set!(AVX, AVX2, AVXVNNIINT16, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5344
5345    #[doc = "Enable AVX-VNNI-INT8."]
5346    pub const AVXVNNIINT8: TargetFeatures = feature_set!(AVX, AVX2, AVXVNNIINT8, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5347
5348    #[doc = "Support BMI instructions."]
5349    pub const BMI1: TargetFeatures = feature_set!(BMI1);
5350
5351    #[doc = "Support BMI2 instructions."]
5352    pub const BMI2: TargetFeatures = feature_set!(BMI2);
5353
5354    #[doc = "Flush A Cache Line Optimized."]
5355    pub const CLFLUSHOPT: TargetFeatures = feature_set!(CLFLUSHOPT);
5356
5357    #[doc = "64-bit with cmpxchg16b (this is true for most x86-64 chips, but not the first AMD chips)."]
5358    pub const CMPXCHG16B: TargetFeatures = feature_set!(CMPXCHG16B);
5359
5360    #[doc = "Enables C Run-time Libraries to be statically linked."]
5361    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
5362
5363    #[doc = "REP MOVS/STOS are fast."]
5364    pub const ERMSB: TargetFeatures = feature_set!(ERMSB);
5365
5366    #[doc = "Support 16-bit floating point conversion instructions."]
5367    pub const F16C: TargetFeatures = feature_set!(AVX, F16C, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5368
5369    #[doc = "Enable three-operand fused multiple-add."]
5370    pub const FMA: TargetFeatures = feature_set!(AVX, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5371
5372    #[doc = "Enable four-operand fused multiple-add."]
5373    pub const FMA4: TargetFeatures = feature_set!(AVX, FMA4, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSE4A, SSSE3);
5374
5375    #[doc = "Support fxsave/fxrestore instructions."]
5376    pub const FXSR: TargetFeatures = feature_set!(FXSR);
5377
5378    #[doc = "Enable Galois Field Arithmetic Instructions."]
5379    pub const GFNI: TargetFeatures = feature_set!(GFNI, SSE, SSE2);
5380
5381    #[doc = "Support Key Locker kl Instructions."]
5382    pub const KL: TargetFeatures = feature_set!(KL, SSE, SSE2);
5383
5384    #[doc = "Support LAHF and SAHF instructions in 64-bit mode."]
5385    pub const LAHFSAHF: TargetFeatures = feature_set!(LAHFSAHF);
5386
5387    #[doc = "Support LZCNT instruction."]
5388    pub const LZCNT: TargetFeatures = feature_set!(LZCNT);
5389
5390    #[doc = "Support MOVBE instruction."]
5391    pub const MOVBE: TargetFeatures = feature_set!(MOVBE);
5392
5393    #[doc = "Enable MOVRS."]
5394    pub const MOVRS: TargetFeatures = feature_set!(MOVRS);
5395
5396    #[doc = "Enable packed carry-less multiplication instructions."]
5397    pub const PCLMULQDQ: TargetFeatures = feature_set!(PCLMULQDQ, SSE, SSE2);
5398
5399    #[doc = "Support POPCNT instruction."]
5400    pub const POPCNT: TargetFeatures = feature_set!(POPCNT);
5401
5402    #[doc = "Support PRFCHW instructions."]
5403    pub const PRFCHW: TargetFeatures = feature_set!(PRFCHW);
5404
5405    #[doc = "Support RDRAND instruction."]
5406    pub const RDRAND: TargetFeatures = feature_set!(RDRAND);
5407
5408    #[doc = "Support RDSEED instruction."]
5409    pub const RDSEED: TargetFeatures = feature_set!(RDSEED);
5410
5411    #[doc = "Support RTM instructions."]
5412    pub const RTM: TargetFeatures = feature_set!(RTM);
5413
5414    #[doc = "Enable SHA instructions."]
5415    pub const SHA: TargetFeatures = feature_set!(SHA, SSE, SSE2);
5416
5417    #[doc = "Support SHA512 instructions."]
5418    pub const SHA512: TargetFeatures = feature_set!(AVX, AVX2, SHA512, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5419
5420    #[doc = "Support SM3 instructions."]
5421    pub const SM3: TargetFeatures = feature_set!(AVX, SM3, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5422
5423    #[doc = "Support SM4 instructions."]
5424    pub const SM4: TargetFeatures = feature_set!(AVX, AVX2, SM4, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5425
5426    #[doc = "Enable SSE instructions."]
5427    pub const SSE: TargetFeatures = feature_set!(SSE);
5428
5429    #[doc = "Enable SSE2 instructions."]
5430    pub const SSE2: TargetFeatures = feature_set!(SSE, SSE2);
5431
5432    #[doc = "Enable SSE3 instructions."]
5433    pub const SSE3: TargetFeatures = feature_set!(SSE, SSE2, SSE3);
5434
5435    #[doc = "Enable SSE 4.1 instructions."]
5436    pub const SSE4_1: TargetFeatures = feature_set!(SSE, SSE2, SSE3, SSE4_1, SSSE3);
5437
5438    #[doc = "Enable SSE 4.2 instructions."]
5439    pub const SSE4_2: TargetFeatures = feature_set!(SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5440
5441    #[doc = "Support SSE 4a instructions."]
5442    pub const SSE4A: TargetFeatures = feature_set!(SSE, SSE2, SSE3, SSE4A);
5443
5444    #[doc = "Enable SSSE3 instructions."]
5445    pub const SSSE3: TargetFeatures = feature_set!(SSE, SSE2, SSE3, SSSE3);
5446
5447    #[doc = "Enable TBM instructions."]
5448    pub const TBM: TargetFeatures = feature_set!(TBM);
5449
5450    #[doc = "Promote selected AES instructions to AVX512/AVX registers."]
5451    pub const VAES: TargetFeatures = feature_set!(AES, AVX, AVX2, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3, VAES);
5452
5453    #[doc = "Enable vpclmulqdq instructions."]
5454    pub const VPCLMULQDQ: TargetFeatures = feature_set!(AVX, PCLMULQDQ, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3, VPCLMULQDQ);
5455
5456    #[doc = "Support Key Locker wide Instructions."]
5457    pub const WIDEKL: TargetFeatures = feature_set!(KL, SSE, SSE2, WIDEKL);
5458
5459    #[doc = "Enable X87 float instructions."]
5460    pub const X87: TargetFeatures = feature_set!(X87);
5461
5462    #[doc = "Enable XOP instructions."]
5463    pub const XOP: TargetFeatures = feature_set!(AVX, FMA4, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSE4A, SSSE3, XOP);
5464
5465    #[doc = "Support xsave instructions."]
5466    pub const XSAVE: TargetFeatures = feature_set!(XSAVE);
5467
5468    #[doc = "Support xsavec instructions."]
5469    pub const XSAVEC: TargetFeatures = feature_set!(XSAVE, XSAVEC);
5470
5471    #[doc = "Support xsaveopt instructions."]
5472    pub const XSAVEOPT: TargetFeatures = feature_set!(XSAVE, XSAVEOPT);
5473
5474    #[doc = "Support xsaves instructions."]
5475    pub const XSAVES: TargetFeatures = feature_set!(XSAVE, XSAVES);
5476
5477
5478    #[cfg(target_arch = "x86")]
5479    pub(crate) const FEATURES: &[FeatureData] = &[
5480        FeatureData::new("adx", ADX),
5481        FeatureData::new("aes", AES),
5482        FeatureData::new("amx-avx512", AMX_AVX512),
5483        FeatureData::new("amx-bf16", AMX_BF16),
5484        FeatureData::new("amx-complex", AMX_COMPLEX),
5485        FeatureData::new("amx-fp16", AMX_FP16),
5486        FeatureData::new("amx-fp8", AMX_FP8),
5487        FeatureData::new("amx-int8", AMX_INT8),
5488        FeatureData::new("amx-movrs", AMX_MOVRS),
5489        FeatureData::new("amx-tile", AMX_TILE),
5490        FeatureData::new("apxf", APXF),
5491        FeatureData::new("avx", AVX),
5492        FeatureData::new("avx10.1", AVX10_1),
5493        FeatureData::new("avx10.2", AVX10_2),
5494        FeatureData::new("avx2", AVX2),
5495        FeatureData::new("avx512bf16", AVX512BF16),
5496        FeatureData::new("avx512bitalg", AVX512BITALG),
5497        FeatureData::new("avx512bw", AVX512BW),
5498        FeatureData::new("avx512cd", AVX512CD),
5499        FeatureData::new("avx512dq", AVX512DQ),
5500        FeatureData::new("avx512f", AVX512F),
5501        FeatureData::new("avx512fp16", AVX512FP16),
5502        FeatureData::new("avx512ifma", AVX512IFMA),
5503        FeatureData::new("avx512vbmi", AVX512VBMI),
5504        FeatureData::new("avx512vbmi2", AVX512VBMI2),
5505        FeatureData::new("avx512vl", AVX512VL),
5506        FeatureData::new("avx512vnni", AVX512VNNI),
5507        FeatureData::new("avx512vp2intersect", AVX512VP2INTERSECT),
5508        FeatureData::new("avx512vpopcntdq", AVX512VPOPCNTDQ),
5509        FeatureData::new("avxifma", AVXIFMA),
5510        FeatureData::new("avxneconvert", AVXNECONVERT),
5511        FeatureData::new("avxvnni", AVXVNNI),
5512        FeatureData::new("avxvnniint16", AVXVNNIINT16),
5513        FeatureData::new("avxvnniint8", AVXVNNIINT8),
5514        FeatureData::new("bmi1", BMI1),
5515        FeatureData::new("bmi2", BMI2),
5516        FeatureData::new("clflushopt", CLFLUSHOPT),
5517        FeatureData::new("cmpxchg16b", CMPXCHG16B),
5518        FeatureData::new("crt-static", CRT_STATIC),
5519        FeatureData::new("ermsb", ERMSB),
5520        FeatureData::new("f16c", F16C),
5521        FeatureData::new("fma", FMA),
5522        FeatureData::new("fma4", FMA4),
5523        FeatureData::new("fxsr", FXSR),
5524        FeatureData::new("gfni", GFNI),
5525        FeatureData::new("kl", KL),
5526        FeatureData::new("lahfsahf", LAHFSAHF),
5527        FeatureData::new("lzcnt", LZCNT),
5528        FeatureData::new("movbe", MOVBE),
5529        FeatureData::new("movrs", MOVRS),
5530        FeatureData::new("pclmulqdq", PCLMULQDQ),
5531        FeatureData::new("popcnt", POPCNT),
5532        FeatureData::new("prfchw", PRFCHW),
5533        FeatureData::new("rdrand", RDRAND),
5534        FeatureData::new("rdseed", RDSEED),
5535        FeatureData::new("rtm", RTM),
5536        FeatureData::new("sha", SHA),
5537        FeatureData::new("sha512", SHA512),
5538        FeatureData::new("sm3", SM3),
5539        FeatureData::new("sm4", SM4),
5540        FeatureData::new("sse", SSE),
5541        FeatureData::new("sse2", SSE2),
5542        FeatureData::new("sse3", SSE3),
5543        FeatureData::new("sse4.1", SSE4_1),
5544        FeatureData::new("sse4.2", SSE4_2),
5545        FeatureData::new("sse4a", SSE4A),
5546        FeatureData::new("ssse3", SSSE3),
5547        FeatureData::new("tbm", TBM),
5548        FeatureData::new("vaes", VAES),
5549        FeatureData::new("vpclmulqdq", VPCLMULQDQ),
5550        FeatureData::new("widekl", WIDEKL),
5551        FeatureData::new("x87", X87),
5552        FeatureData::new("xop", XOP),
5553        FeatureData::new("xsave", XSAVE),
5554        FeatureData::new("xsavec", XSAVEC),
5555        FeatureData::new("xsaveopt", XSAVEOPT),
5556        FeatureData::new("xsaves", XSAVES),
5557    ];
5558
5559    #[cfg(target_arch = "x86")]
5560    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
5561    pub(crate) const fn enabled_for_target() -> TargetFeatures {
5562        let features = TargetFeatures::empty();
5563        #[cfg(target_feature = "adx")]
5564        let features = features.with(ADX);
5565        #[cfg(target_feature = "aes")]
5566        let features = features.with(AES);
5567        #[cfg(target_feature = "amx-avx512")]
5568        let features = features.with(AMX_AVX512);
5569        #[cfg(target_feature = "amx-bf16")]
5570        let features = features.with(AMX_BF16);
5571        #[cfg(target_feature = "amx-complex")]
5572        let features = features.with(AMX_COMPLEX);
5573        #[cfg(target_feature = "amx-fp16")]
5574        let features = features.with(AMX_FP16);
5575        #[cfg(target_feature = "amx-fp8")]
5576        let features = features.with(AMX_FP8);
5577        #[cfg(target_feature = "amx-int8")]
5578        let features = features.with(AMX_INT8);
5579        #[cfg(target_feature = "amx-movrs")]
5580        let features = features.with(AMX_MOVRS);
5581        #[cfg(target_feature = "amx-tile")]
5582        let features = features.with(AMX_TILE);
5583        #[cfg(target_feature = "apxf")]
5584        let features = features.with(APXF);
5585        #[cfg(target_feature = "avx")]
5586        let features = features.with(AVX);
5587        #[cfg(target_feature = "avx10.1")]
5588        let features = features.with(AVX10_1);
5589        #[cfg(target_feature = "avx10.2")]
5590        let features = features.with(AVX10_2);
5591        #[cfg(target_feature = "avx2")]
5592        let features = features.with(AVX2);
5593        #[cfg(target_feature = "avx512bf16")]
5594        let features = features.with(AVX512BF16);
5595        #[cfg(target_feature = "avx512bitalg")]
5596        let features = features.with(AVX512BITALG);
5597        #[cfg(target_feature = "avx512bw")]
5598        let features = features.with(AVX512BW);
5599        #[cfg(target_feature = "avx512cd")]
5600        let features = features.with(AVX512CD);
5601        #[cfg(target_feature = "avx512dq")]
5602        let features = features.with(AVX512DQ);
5603        #[cfg(target_feature = "avx512f")]
5604        let features = features.with(AVX512F);
5605        #[cfg(target_feature = "avx512fp16")]
5606        let features = features.with(AVX512FP16);
5607        #[cfg(target_feature = "avx512ifma")]
5608        let features = features.with(AVX512IFMA);
5609        #[cfg(target_feature = "avx512vbmi")]
5610        let features = features.with(AVX512VBMI);
5611        #[cfg(target_feature = "avx512vbmi2")]
5612        let features = features.with(AVX512VBMI2);
5613        #[cfg(target_feature = "avx512vl")]
5614        let features = features.with(AVX512VL);
5615        #[cfg(target_feature = "avx512vnni")]
5616        let features = features.with(AVX512VNNI);
5617        #[cfg(target_feature = "avx512vp2intersect")]
5618        let features = features.with(AVX512VP2INTERSECT);
5619        #[cfg(target_feature = "avx512vpopcntdq")]
5620        let features = features.with(AVX512VPOPCNTDQ);
5621        #[cfg(target_feature = "avxifma")]
5622        let features = features.with(AVXIFMA);
5623        #[cfg(target_feature = "avxneconvert")]
5624        let features = features.with(AVXNECONVERT);
5625        #[cfg(target_feature = "avxvnni")]
5626        let features = features.with(AVXVNNI);
5627        #[cfg(target_feature = "avxvnniint16")]
5628        let features = features.with(AVXVNNIINT16);
5629        #[cfg(target_feature = "avxvnniint8")]
5630        let features = features.with(AVXVNNIINT8);
5631        #[cfg(target_feature = "bmi1")]
5632        let features = features.with(BMI1);
5633        #[cfg(target_feature = "bmi2")]
5634        let features = features.with(BMI2);
5635        #[cfg(target_feature = "clflushopt")]
5636        let features = features.with(CLFLUSHOPT);
5637        #[cfg(target_feature = "cmpxchg16b")]
5638        let features = features.with(CMPXCHG16B);
5639        #[cfg(target_feature = "crt-static")]
5640        let features = features.with(CRT_STATIC);
5641        #[cfg(target_feature = "ermsb")]
5642        let features = features.with(ERMSB);
5643        #[cfg(target_feature = "f16c")]
5644        let features = features.with(F16C);
5645        #[cfg(target_feature = "fma")]
5646        let features = features.with(FMA);
5647        #[cfg(target_feature = "fma4")]
5648        let features = features.with(FMA4);
5649        #[cfg(target_feature = "fxsr")]
5650        let features = features.with(FXSR);
5651        #[cfg(target_feature = "gfni")]
5652        let features = features.with(GFNI);
5653        #[cfg(target_feature = "kl")]
5654        let features = features.with(KL);
5655        #[cfg(target_feature = "lahfsahf")]
5656        let features = features.with(LAHFSAHF);
5657        #[cfg(target_feature = "lzcnt")]
5658        let features = features.with(LZCNT);
5659        #[cfg(target_feature = "movbe")]
5660        let features = features.with(MOVBE);
5661        #[cfg(target_feature = "movrs")]
5662        let features = features.with(MOVRS);
5663        #[cfg(target_feature = "pclmulqdq")]
5664        let features = features.with(PCLMULQDQ);
5665        #[cfg(target_feature = "popcnt")]
5666        let features = features.with(POPCNT);
5667        #[cfg(target_feature = "prfchw")]
5668        let features = features.with(PRFCHW);
5669        #[cfg(target_feature = "rdrand")]
5670        let features = features.with(RDRAND);
5671        #[cfg(target_feature = "rdseed")]
5672        let features = features.with(RDSEED);
5673        #[cfg(target_feature = "rtm")]
5674        let features = features.with(RTM);
5675        #[cfg(target_feature = "sha")]
5676        let features = features.with(SHA);
5677        #[cfg(target_feature = "sha512")]
5678        let features = features.with(SHA512);
5679        #[cfg(target_feature = "sm3")]
5680        let features = features.with(SM3);
5681        #[cfg(target_feature = "sm4")]
5682        let features = features.with(SM4);
5683        #[cfg(target_feature = "sse")]
5684        let features = features.with(SSE);
5685        #[cfg(target_feature = "sse2")]
5686        let features = features.with(SSE2);
5687        #[cfg(target_feature = "sse3")]
5688        let features = features.with(SSE3);
5689        #[cfg(target_feature = "sse4.1")]
5690        let features = features.with(SSE4_1);
5691        #[cfg(target_feature = "sse4.2")]
5692        let features = features.with(SSE4_2);
5693        #[cfg(target_feature = "sse4a")]
5694        let features = features.with(SSE4A);
5695        #[cfg(target_feature = "ssse3")]
5696        let features = features.with(SSSE3);
5697        #[cfg(target_feature = "tbm")]
5698        let features = features.with(TBM);
5699        #[cfg(target_feature = "vaes")]
5700        let features = features.with(VAES);
5701        #[cfg(target_feature = "vpclmulqdq")]
5702        let features = features.with(VPCLMULQDQ);
5703        #[cfg(target_feature = "widekl")]
5704        let features = features.with(WIDEKL);
5705        #[cfg(target_feature = "x87")]
5706        let features = features.with(X87);
5707        #[cfg(target_feature = "xop")]
5708        let features = features.with(XOP);
5709        #[cfg(target_feature = "xsave")]
5710        let features = features.with(XSAVE);
5711        #[cfg(target_feature = "xsavec")]
5712        let features = features.with(XSAVEC);
5713        #[cfg(target_feature = "xsaveopt")]
5714        let features = features.with(XSAVEOPT);
5715        #[cfg(target_feature = "xsaves")]
5716        let features = features.with(XSAVES);
5717        features
5718    }
5719
5720}
5721#[cfg(any(doc, target_arch = "x86_64"))]
5722#[rustfmt::skip]
5723pub mod x86_64 {
5724    use super::*;
5725
5726    #[repr(u16)]
5727    #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
5728    enum FeatureId {
5729        ADX,
5730        AES,
5731        AMX_AVX512,
5732        AMX_BF16,
5733        AMX_COMPLEX,
5734        AMX_FP16,
5735        AMX_FP8,
5736        AMX_INT8,
5737        AMX_MOVRS,
5738        AMX_TILE,
5739        APXF,
5740        AVX,
5741        AVX10_1,
5742        AVX10_2,
5743        AVX2,
5744        AVX512BF16,
5745        AVX512BITALG,
5746        AVX512BW,
5747        AVX512CD,
5748        AVX512DQ,
5749        AVX512F,
5750        AVX512FP16,
5751        AVX512IFMA,
5752        AVX512VBMI,
5753        AVX512VBMI2,
5754        AVX512VL,
5755        AVX512VNNI,
5756        AVX512VP2INTERSECT,
5757        AVX512VPOPCNTDQ,
5758        AVXIFMA,
5759        AVXNECONVERT,
5760        AVXVNNI,
5761        AVXVNNIINT16,
5762        AVXVNNIINT8,
5763        BMI1,
5764        BMI2,
5765        CLFLUSHOPT,
5766        CMPXCHG16B,
5767        CRT_STATIC,
5768        ERMSB,
5769        F16C,
5770        FMA,
5771        FMA4,
5772        FXSR,
5773        GFNI,
5774        KL,
5775        LAHFSAHF,
5776        LZCNT,
5777        MOVBE,
5778        MOVRS,
5779        PCLMULQDQ,
5780        POPCNT,
5781        PRFCHW,
5782        RDRAND,
5783        RDSEED,
5784        RTM,
5785        SHA,
5786        SHA512,
5787        SM3,
5788        SM4,
5789        SSE,
5790        SSE2,
5791        SSE3,
5792        SSE4_1,
5793        SSE4_2,
5794        SSE4A,
5795        SSSE3,
5796        TBM,
5797        VAES,
5798        VPCLMULQDQ,
5799        WIDEKL,
5800        X87,
5801        XOP,
5802        XSAVE,
5803        XSAVEC,
5804        XSAVEOPT,
5805        XSAVES,
5806    }
5807
5808    macro_rules! feature_set {
5809        ($($feature:ident),* $(,)?) => { {
5810            #[cfg(target_arch = "x86_64")]
5811            {
5812                let features = TargetFeatures::empty();
5813                $(let features = features.with_bit(FeatureId::$feature as usize);)*
5814                features
5815            }
5816            #[cfg(all(doc, not(target_arch = "x86_64")))]
5817            {
5818                TargetFeatures::empty()
5819            }
5820        } };
5821    }
5822    #[doc = "Support ADX instructions."]
5823    pub const ADX: TargetFeatures = feature_set!(ADX);
5824
5825    #[doc = "Enable AES instructions."]
5826    pub const AES: TargetFeatures = feature_set!(AES, SSE, SSE2);
5827
5828    #[doc = "Support AMX-AVX512 instructions."]
5829    pub const AMX_AVX512: TargetFeatures = feature_set!(AMX_AVX512, AMX_TILE);
5830
5831    #[doc = "Support AMX-BF16 instructions."]
5832    pub const AMX_BF16: TargetFeatures = feature_set!(AMX_BF16, AMX_TILE);
5833
5834    #[doc = "Support AMX-COMPLEX instructions."]
5835    pub const AMX_COMPLEX: TargetFeatures = feature_set!(AMX_COMPLEX, AMX_TILE);
5836
5837    #[doc = "Support AMX amx-fp16 instructions."]
5838    pub const AMX_FP16: TargetFeatures = feature_set!(AMX_FP16, AMX_TILE);
5839
5840    #[doc = "Support AMX-FP8 instructions."]
5841    pub const AMX_FP8: TargetFeatures = feature_set!(AMX_FP8, AMX_TILE);
5842
5843    #[doc = "Support AMX-INT8 instructions."]
5844    pub const AMX_INT8: TargetFeatures = feature_set!(AMX_INT8, AMX_TILE);
5845
5846    #[doc = "Support AMX-MOVRS instructions."]
5847    pub const AMX_MOVRS: TargetFeatures = feature_set!(AMX_MOVRS, AMX_TILE);
5848
5849    #[doc = "Support AMX-TILE instructions."]
5850    pub const AMX_TILE: TargetFeatures = feature_set!(AMX_TILE);
5851
5852    #[doc = "Support extended general purpose register."]
5853    pub const APXF: TargetFeatures = feature_set!(APXF);
5854
5855    #[doc = "Enable AVX instructions."]
5856    pub const AVX: TargetFeatures = feature_set!(AVX, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5857
5858    #[doc = "Support AVX10.1 instruction."]
5859    pub const AVX10_1: TargetFeatures = feature_set!(AVX, AVX10_1, AVX2, AVX512BF16, AVX512BITALG, AVX512BW, AVX512CD, AVX512DQ, AVX512F, AVX512FP16, AVX512IFMA, AVX512VBMI, AVX512VBMI2, AVX512VL, AVX512VNNI, AVX512VPOPCNTDQ, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5860
5861    #[doc = "Support AVX10.2 instruction."]
5862    pub const AVX10_2: TargetFeatures = feature_set!(AVX, AVX10_1, AVX10_2, AVX2, AVX512BF16, AVX512BITALG, AVX512BW, AVX512CD, AVX512DQ, AVX512F, AVX512FP16, AVX512IFMA, AVX512VBMI, AVX512VBMI2, AVX512VL, AVX512VNNI, AVX512VPOPCNTDQ, AVXVNNI, AVXVNNIINT16, AVXVNNIINT8, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5863
5864    #[doc = "Enable AVX2 instructions."]
5865    pub const AVX2: TargetFeatures = feature_set!(AVX, AVX2, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5866
5867    #[doc = "Support bfloat16 floating point."]
5868    pub const AVX512BF16: TargetFeatures = feature_set!(AVX, AVX2, AVX512BF16, AVX512BW, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5869
5870    #[doc = "Enable AVX-512 Bit Algorithms."]
5871    pub const AVX512BITALG: TargetFeatures = feature_set!(AVX, AVX2, AVX512BITALG, AVX512BW, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5872
5873    #[doc = "Enable AVX-512 Byte and Word Instructions."]
5874    pub const AVX512BW: TargetFeatures = feature_set!(AVX, AVX2, AVX512BW, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5875
5876    #[doc = "Enable AVX-512 Conflict Detection Instructions."]
5877    pub const AVX512CD: TargetFeatures = feature_set!(AVX, AVX2, AVX512CD, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5878
5879    #[doc = "Enable AVX-512 Doubleword and Quadword Instructions."]
5880    pub const AVX512DQ: TargetFeatures = feature_set!(AVX, AVX2, AVX512DQ, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5881
5882    #[doc = "Enable AVX-512 instructions."]
5883    pub const AVX512F: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5884
5885    #[doc = "Support 16-bit floating point."]
5886    pub const AVX512FP16: TargetFeatures = feature_set!(AVX, AVX2, AVX512BW, AVX512F, AVX512FP16, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5887
5888    #[doc = "Enable AVX-512 Integer Fused Multiple-Add."]
5889    pub const AVX512IFMA: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, AVX512IFMA, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5890
5891    #[doc = "Enable AVX-512 Vector Byte Manipulation Instructions."]
5892    pub const AVX512VBMI: TargetFeatures = feature_set!(AVX, AVX2, AVX512BW, AVX512F, AVX512VBMI, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5893
5894    #[doc = "Enable AVX-512 further Vector Byte Manipulation Instructions."]
5895    pub const AVX512VBMI2: TargetFeatures = feature_set!(AVX, AVX2, AVX512BW, AVX512F, AVX512VBMI2, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5896
5897    #[doc = "Enable AVX-512 Vector Length eXtensions."]
5898    pub const AVX512VL: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, AVX512VL, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5899
5900    #[doc = "Enable AVX-512 Vector Neural Network Instructions."]
5901    pub const AVX512VNNI: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, AVX512VNNI, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5902
5903    #[doc = "Enable AVX-512 vp2intersect."]
5904    pub const AVX512VP2INTERSECT: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, AVX512VP2INTERSECT, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5905
5906    #[doc = "Enable AVX-512 Population Count Instructions."]
5907    pub const AVX512VPOPCNTDQ: TargetFeatures = feature_set!(AVX, AVX2, AVX512F, AVX512VPOPCNTDQ, F16C, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5908
5909    #[doc = "Enable AVX-IFMA."]
5910    pub const AVXIFMA: TargetFeatures = feature_set!(AVX, AVX2, AVXIFMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5911
5912    #[doc = "Support AVX-NE-CONVERT instructions."]
5913    pub const AVXNECONVERT: TargetFeatures = feature_set!(AVX, AVX2, AVXNECONVERT, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5914
5915    #[doc = "Support AVX_VNNI encoding."]
5916    pub const AVXVNNI: TargetFeatures = feature_set!(AVX, AVX2, AVXVNNI, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5917
5918    #[doc = "Enable AVX-VNNI-INT16."]
5919    pub const AVXVNNIINT16: TargetFeatures = feature_set!(AVX, AVX2, AVXVNNIINT16, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5920
5921    #[doc = "Enable AVX-VNNI-INT8."]
5922    pub const AVXVNNIINT8: TargetFeatures = feature_set!(AVX, AVX2, AVXVNNIINT8, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5923
5924    #[doc = "Support BMI instructions."]
5925    pub const BMI1: TargetFeatures = feature_set!(BMI1);
5926
5927    #[doc = "Support BMI2 instructions."]
5928    pub const BMI2: TargetFeatures = feature_set!(BMI2);
5929
5930    #[doc = "Flush A Cache Line Optimized."]
5931    pub const CLFLUSHOPT: TargetFeatures = feature_set!(CLFLUSHOPT);
5932
5933    #[doc = "64-bit with cmpxchg16b (this is true for most x86-64 chips, but not the first AMD chips)."]
5934    pub const CMPXCHG16B: TargetFeatures = feature_set!(CMPXCHG16B);
5935
5936    #[doc = "Enables C Run-time Libraries to be statically linked."]
5937    pub const CRT_STATIC: TargetFeatures = feature_set!(CRT_STATIC);
5938
5939    #[doc = "REP MOVS/STOS are fast."]
5940    pub const ERMSB: TargetFeatures = feature_set!(ERMSB);
5941
5942    #[doc = "Support 16-bit floating point conversion instructions."]
5943    pub const F16C: TargetFeatures = feature_set!(AVX, F16C, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5944
5945    #[doc = "Enable three-operand fused multiple-add."]
5946    pub const FMA: TargetFeatures = feature_set!(AVX, FMA, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5947
5948    #[doc = "Enable four-operand fused multiple-add."]
5949    pub const FMA4: TargetFeatures = feature_set!(AVX, FMA4, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSE4A, SSSE3);
5950
5951    #[doc = "Support fxsave/fxrestore instructions."]
5952    pub const FXSR: TargetFeatures = feature_set!(FXSR);
5953
5954    #[doc = "Enable Galois Field Arithmetic Instructions."]
5955    pub const GFNI: TargetFeatures = feature_set!(GFNI, SSE, SSE2);
5956
5957    #[doc = "Support Key Locker kl Instructions."]
5958    pub const KL: TargetFeatures = feature_set!(KL, SSE, SSE2);
5959
5960    #[doc = "Support LAHF and SAHF instructions in 64-bit mode."]
5961    pub const LAHFSAHF: TargetFeatures = feature_set!(LAHFSAHF);
5962
5963    #[doc = "Support LZCNT instruction."]
5964    pub const LZCNT: TargetFeatures = feature_set!(LZCNT);
5965
5966    #[doc = "Support MOVBE instruction."]
5967    pub const MOVBE: TargetFeatures = feature_set!(MOVBE);
5968
5969    #[doc = "Enable MOVRS."]
5970    pub const MOVRS: TargetFeatures = feature_set!(MOVRS);
5971
5972    #[doc = "Enable packed carry-less multiplication instructions."]
5973    pub const PCLMULQDQ: TargetFeatures = feature_set!(PCLMULQDQ, SSE, SSE2);
5974
5975    #[doc = "Support POPCNT instruction."]
5976    pub const POPCNT: TargetFeatures = feature_set!(POPCNT);
5977
5978    #[doc = "Support PRFCHW instructions."]
5979    pub const PRFCHW: TargetFeatures = feature_set!(PRFCHW);
5980
5981    #[doc = "Support RDRAND instruction."]
5982    pub const RDRAND: TargetFeatures = feature_set!(RDRAND);
5983
5984    #[doc = "Support RDSEED instruction."]
5985    pub const RDSEED: TargetFeatures = feature_set!(RDSEED);
5986
5987    #[doc = "Support RTM instructions."]
5988    pub const RTM: TargetFeatures = feature_set!(RTM);
5989
5990    #[doc = "Enable SHA instructions."]
5991    pub const SHA: TargetFeatures = feature_set!(SHA, SSE, SSE2);
5992
5993    #[doc = "Support SHA512 instructions."]
5994    pub const SHA512: TargetFeatures = feature_set!(AVX, AVX2, SHA512, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5995
5996    #[doc = "Support SM3 instructions."]
5997    pub const SM3: TargetFeatures = feature_set!(AVX, SM3, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
5998
5999    #[doc = "Support SM4 instructions."]
6000    pub const SM4: TargetFeatures = feature_set!(AVX, AVX2, SM4, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
6001
6002    #[doc = "Enable SSE instructions."]
6003    pub const SSE: TargetFeatures = feature_set!(SSE);
6004
6005    #[doc = "Enable SSE2 instructions."]
6006    pub const SSE2: TargetFeatures = feature_set!(SSE, SSE2);
6007
6008    #[doc = "Enable SSE3 instructions."]
6009    pub const SSE3: TargetFeatures = feature_set!(SSE, SSE2, SSE3);
6010
6011    #[doc = "Enable SSE 4.1 instructions."]
6012    pub const SSE4_1: TargetFeatures = feature_set!(SSE, SSE2, SSE3, SSE4_1, SSSE3);
6013
6014    #[doc = "Enable SSE 4.2 instructions."]
6015    pub const SSE4_2: TargetFeatures = feature_set!(SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3);
6016
6017    #[doc = "Support SSE 4a instructions."]
6018    pub const SSE4A: TargetFeatures = feature_set!(SSE, SSE2, SSE3, SSE4A);
6019
6020    #[doc = "Enable SSSE3 instructions."]
6021    pub const SSSE3: TargetFeatures = feature_set!(SSE, SSE2, SSE3, SSSE3);
6022
6023    #[doc = "Enable TBM instructions."]
6024    pub const TBM: TargetFeatures = feature_set!(TBM);
6025
6026    #[doc = "Promote selected AES instructions to AVX512/AVX registers."]
6027    pub const VAES: TargetFeatures = feature_set!(AES, AVX, AVX2, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3, VAES);
6028
6029    #[doc = "Enable vpclmulqdq instructions."]
6030    pub const VPCLMULQDQ: TargetFeatures = feature_set!(AVX, PCLMULQDQ, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSSE3, VPCLMULQDQ);
6031
6032    #[doc = "Support Key Locker wide Instructions."]
6033    pub const WIDEKL: TargetFeatures = feature_set!(KL, SSE, SSE2, WIDEKL);
6034
6035    #[doc = "Enable X87 float instructions."]
6036    pub const X87: TargetFeatures = feature_set!(X87);
6037
6038    #[doc = "Enable XOP instructions."]
6039    pub const XOP: TargetFeatures = feature_set!(AVX, FMA4, SSE, SSE2, SSE3, SSE4_1, SSE4_2, SSE4A, SSSE3, XOP);
6040
6041    #[doc = "Support xsave instructions."]
6042    pub const XSAVE: TargetFeatures = feature_set!(XSAVE);
6043
6044    #[doc = "Support xsavec instructions."]
6045    pub const XSAVEC: TargetFeatures = feature_set!(XSAVE, XSAVEC);
6046
6047    #[doc = "Support xsaveopt instructions."]
6048    pub const XSAVEOPT: TargetFeatures = feature_set!(XSAVE, XSAVEOPT);
6049
6050    #[doc = "Support xsaves instructions."]
6051    pub const XSAVES: TargetFeatures = feature_set!(XSAVE, XSAVES);
6052
6053
6054    #[cfg(target_arch = "x86_64")]
6055    pub(crate) const FEATURES: &[FeatureData] = &[
6056        FeatureData::new("adx", ADX),
6057        FeatureData::new("aes", AES),
6058        FeatureData::new("amx-avx512", AMX_AVX512),
6059        FeatureData::new("amx-bf16", AMX_BF16),
6060        FeatureData::new("amx-complex", AMX_COMPLEX),
6061        FeatureData::new("amx-fp16", AMX_FP16),
6062        FeatureData::new("amx-fp8", AMX_FP8),
6063        FeatureData::new("amx-int8", AMX_INT8),
6064        FeatureData::new("amx-movrs", AMX_MOVRS),
6065        FeatureData::new("amx-tile", AMX_TILE),
6066        FeatureData::new("apxf", APXF),
6067        FeatureData::new("avx", AVX),
6068        FeatureData::new("avx10.1", AVX10_1),
6069        FeatureData::new("avx10.2", AVX10_2),
6070        FeatureData::new("avx2", AVX2),
6071        FeatureData::new("avx512bf16", AVX512BF16),
6072        FeatureData::new("avx512bitalg", AVX512BITALG),
6073        FeatureData::new("avx512bw", AVX512BW),
6074        FeatureData::new("avx512cd", AVX512CD),
6075        FeatureData::new("avx512dq", AVX512DQ),
6076        FeatureData::new("avx512f", AVX512F),
6077        FeatureData::new("avx512fp16", AVX512FP16),
6078        FeatureData::new("avx512ifma", AVX512IFMA),
6079        FeatureData::new("avx512vbmi", AVX512VBMI),
6080        FeatureData::new("avx512vbmi2", AVX512VBMI2),
6081        FeatureData::new("avx512vl", AVX512VL),
6082        FeatureData::new("avx512vnni", AVX512VNNI),
6083        FeatureData::new("avx512vp2intersect", AVX512VP2INTERSECT),
6084        FeatureData::new("avx512vpopcntdq", AVX512VPOPCNTDQ),
6085        FeatureData::new("avxifma", AVXIFMA),
6086        FeatureData::new("avxneconvert", AVXNECONVERT),
6087        FeatureData::new("avxvnni", AVXVNNI),
6088        FeatureData::new("avxvnniint16", AVXVNNIINT16),
6089        FeatureData::new("avxvnniint8", AVXVNNIINT8),
6090        FeatureData::new("bmi1", BMI1),
6091        FeatureData::new("bmi2", BMI2),
6092        FeatureData::new("clflushopt", CLFLUSHOPT),
6093        FeatureData::new("cmpxchg16b", CMPXCHG16B),
6094        FeatureData::new("crt-static", CRT_STATIC),
6095        FeatureData::new("ermsb", ERMSB),
6096        FeatureData::new("f16c", F16C),
6097        FeatureData::new("fma", FMA),
6098        FeatureData::new("fma4", FMA4),
6099        FeatureData::new("fxsr", FXSR),
6100        FeatureData::new("gfni", GFNI),
6101        FeatureData::new("kl", KL),
6102        FeatureData::new("lahfsahf", LAHFSAHF),
6103        FeatureData::new("lzcnt", LZCNT),
6104        FeatureData::new("movbe", MOVBE),
6105        FeatureData::new("movrs", MOVRS),
6106        FeatureData::new("pclmulqdq", PCLMULQDQ),
6107        FeatureData::new("popcnt", POPCNT),
6108        FeatureData::new("prfchw", PRFCHW),
6109        FeatureData::new("rdrand", RDRAND),
6110        FeatureData::new("rdseed", RDSEED),
6111        FeatureData::new("rtm", RTM),
6112        FeatureData::new("sha", SHA),
6113        FeatureData::new("sha512", SHA512),
6114        FeatureData::new("sm3", SM3),
6115        FeatureData::new("sm4", SM4),
6116        FeatureData::new("sse", SSE),
6117        FeatureData::new("sse2", SSE2),
6118        FeatureData::new("sse3", SSE3),
6119        FeatureData::new("sse4.1", SSE4_1),
6120        FeatureData::new("sse4.2", SSE4_2),
6121        FeatureData::new("sse4a", SSE4A),
6122        FeatureData::new("ssse3", SSSE3),
6123        FeatureData::new("tbm", TBM),
6124        FeatureData::new("vaes", VAES),
6125        FeatureData::new("vpclmulqdq", VPCLMULQDQ),
6126        FeatureData::new("widekl", WIDEKL),
6127        FeatureData::new("x87", X87),
6128        FeatureData::new("xop", XOP),
6129        FeatureData::new("xsave", XSAVE),
6130        FeatureData::new("xsavec", XSAVEC),
6131        FeatureData::new("xsaveopt", XSAVEOPT),
6132        FeatureData::new("xsaves", XSAVES),
6133    ];
6134
6135    #[cfg(target_arch = "x86_64")]
6136    #[allow(unknown_lints, unexpected_cfgs, clippy::let_and_return)]
6137    pub(crate) const fn enabled_for_target() -> TargetFeatures {
6138        let features = TargetFeatures::empty();
6139        #[cfg(target_feature = "adx")]
6140        let features = features.with(ADX);
6141        #[cfg(target_feature = "aes")]
6142        let features = features.with(AES);
6143        #[cfg(target_feature = "amx-avx512")]
6144        let features = features.with(AMX_AVX512);
6145        #[cfg(target_feature = "amx-bf16")]
6146        let features = features.with(AMX_BF16);
6147        #[cfg(target_feature = "amx-complex")]
6148        let features = features.with(AMX_COMPLEX);
6149        #[cfg(target_feature = "amx-fp16")]
6150        let features = features.with(AMX_FP16);
6151        #[cfg(target_feature = "amx-fp8")]
6152        let features = features.with(AMX_FP8);
6153        #[cfg(target_feature = "amx-int8")]
6154        let features = features.with(AMX_INT8);
6155        #[cfg(target_feature = "amx-movrs")]
6156        let features = features.with(AMX_MOVRS);
6157        #[cfg(target_feature = "amx-tile")]
6158        let features = features.with(AMX_TILE);
6159        #[cfg(target_feature = "apxf")]
6160        let features = features.with(APXF);
6161        #[cfg(target_feature = "avx")]
6162        let features = features.with(AVX);
6163        #[cfg(target_feature = "avx10.1")]
6164        let features = features.with(AVX10_1);
6165        #[cfg(target_feature = "avx10.2")]
6166        let features = features.with(AVX10_2);
6167        #[cfg(target_feature = "avx2")]
6168        let features = features.with(AVX2);
6169        #[cfg(target_feature = "avx512bf16")]
6170        let features = features.with(AVX512BF16);
6171        #[cfg(target_feature = "avx512bitalg")]
6172        let features = features.with(AVX512BITALG);
6173        #[cfg(target_feature = "avx512bw")]
6174        let features = features.with(AVX512BW);
6175        #[cfg(target_feature = "avx512cd")]
6176        let features = features.with(AVX512CD);
6177        #[cfg(target_feature = "avx512dq")]
6178        let features = features.with(AVX512DQ);
6179        #[cfg(target_feature = "avx512f")]
6180        let features = features.with(AVX512F);
6181        #[cfg(target_feature = "avx512fp16")]
6182        let features = features.with(AVX512FP16);
6183        #[cfg(target_feature = "avx512ifma")]
6184        let features = features.with(AVX512IFMA);
6185        #[cfg(target_feature = "avx512vbmi")]
6186        let features = features.with(AVX512VBMI);
6187        #[cfg(target_feature = "avx512vbmi2")]
6188        let features = features.with(AVX512VBMI2);
6189        #[cfg(target_feature = "avx512vl")]
6190        let features = features.with(AVX512VL);
6191        #[cfg(target_feature = "avx512vnni")]
6192        let features = features.with(AVX512VNNI);
6193        #[cfg(target_feature = "avx512vp2intersect")]
6194        let features = features.with(AVX512VP2INTERSECT);
6195        #[cfg(target_feature = "avx512vpopcntdq")]
6196        let features = features.with(AVX512VPOPCNTDQ);
6197        #[cfg(target_feature = "avxifma")]
6198        let features = features.with(AVXIFMA);
6199        #[cfg(target_feature = "avxneconvert")]
6200        let features = features.with(AVXNECONVERT);
6201        #[cfg(target_feature = "avxvnni")]
6202        let features = features.with(AVXVNNI);
6203        #[cfg(target_feature = "avxvnniint16")]
6204        let features = features.with(AVXVNNIINT16);
6205        #[cfg(target_feature = "avxvnniint8")]
6206        let features = features.with(AVXVNNIINT8);
6207        #[cfg(target_feature = "bmi1")]
6208        let features = features.with(BMI1);
6209        #[cfg(target_feature = "bmi2")]
6210        let features = features.with(BMI2);
6211        #[cfg(target_feature = "clflushopt")]
6212        let features = features.with(CLFLUSHOPT);
6213        #[cfg(target_feature = "cmpxchg16b")]
6214        let features = features.with(CMPXCHG16B);
6215        #[cfg(target_feature = "crt-static")]
6216        let features = features.with(CRT_STATIC);
6217        #[cfg(target_feature = "ermsb")]
6218        let features = features.with(ERMSB);
6219        #[cfg(target_feature = "f16c")]
6220        let features = features.with(F16C);
6221        #[cfg(target_feature = "fma")]
6222        let features = features.with(FMA);
6223        #[cfg(target_feature = "fma4")]
6224        let features = features.with(FMA4);
6225        #[cfg(target_feature = "fxsr")]
6226        let features = features.with(FXSR);
6227        #[cfg(target_feature = "gfni")]
6228        let features = features.with(GFNI);
6229        #[cfg(target_feature = "kl")]
6230        let features = features.with(KL);
6231        #[cfg(target_feature = "lahfsahf")]
6232        let features = features.with(LAHFSAHF);
6233        #[cfg(target_feature = "lzcnt")]
6234        let features = features.with(LZCNT);
6235        #[cfg(target_feature = "movbe")]
6236        let features = features.with(MOVBE);
6237        #[cfg(target_feature = "movrs")]
6238        let features = features.with(MOVRS);
6239        #[cfg(target_feature = "pclmulqdq")]
6240        let features = features.with(PCLMULQDQ);
6241        #[cfg(target_feature = "popcnt")]
6242        let features = features.with(POPCNT);
6243        #[cfg(target_feature = "prfchw")]
6244        let features = features.with(PRFCHW);
6245        #[cfg(target_feature = "rdrand")]
6246        let features = features.with(RDRAND);
6247        #[cfg(target_feature = "rdseed")]
6248        let features = features.with(RDSEED);
6249        #[cfg(target_feature = "rtm")]
6250        let features = features.with(RTM);
6251        #[cfg(target_feature = "sha")]
6252        let features = features.with(SHA);
6253        #[cfg(target_feature = "sha512")]
6254        let features = features.with(SHA512);
6255        #[cfg(target_feature = "sm3")]
6256        let features = features.with(SM3);
6257        #[cfg(target_feature = "sm4")]
6258        let features = features.with(SM4);
6259        #[cfg(target_feature = "sse")]
6260        let features = features.with(SSE);
6261        #[cfg(target_feature = "sse2")]
6262        let features = features.with(SSE2);
6263        #[cfg(target_feature = "sse3")]
6264        let features = features.with(SSE3);
6265        #[cfg(target_feature = "sse4.1")]
6266        let features = features.with(SSE4_1);
6267        #[cfg(target_feature = "sse4.2")]
6268        let features = features.with(SSE4_2);
6269        #[cfg(target_feature = "sse4a")]
6270        let features = features.with(SSE4A);
6271        #[cfg(target_feature = "ssse3")]
6272        let features = features.with(SSSE3);
6273        #[cfg(target_feature = "tbm")]
6274        let features = features.with(TBM);
6275        #[cfg(target_feature = "vaes")]
6276        let features = features.with(VAES);
6277        #[cfg(target_feature = "vpclmulqdq")]
6278        let features = features.with(VPCLMULQDQ);
6279        #[cfg(target_feature = "widekl")]
6280        let features = features.with(WIDEKL);
6281        #[cfg(target_feature = "x87")]
6282        let features = features.with(X87);
6283        #[cfg(target_feature = "xop")]
6284        let features = features.with(XOP);
6285        #[cfg(target_feature = "xsave")]
6286        let features = features.with(XSAVE);
6287        #[cfg(target_feature = "xsavec")]
6288        let features = features.with(XSAVEC);
6289        #[cfg(target_feature = "xsaveopt")]
6290        let features = features.with(XSAVEOPT);
6291        #[cfg(target_feature = "xsaves")]
6292        let features = features.with(XSAVES);
6293        features
6294    }
6295
6296}
6297
6298#[cfg(target_arch = "arm")]
6299#[doc(hidden)]
6300#[rustfmt::skip]
6301#[macro_export]
6302macro_rules! __target_feature {
6303    ("aclass") => { $crate::arm::ACLASS };
6304    ("acquire-release") => { $crate::arm::ACQUIRE_RELEASE };
6305    ("aes") => { $crate::arm::AES };
6306    ("crc") => { $crate::arm::CRC };
6307    ("crt-static") => { $crate::arm::CRT_STATIC };
6308    ("d32") => { $crate::arm::D32 };
6309    ("dotprod") => { $crate::arm::DOTPROD };
6310    ("dsp") => { $crate::arm::DSP };
6311    ("fp-armv8") => { $crate::arm::FP_ARMV8 };
6312    ("fp16") => { $crate::arm::FP16 };
6313    ("fp64") => { $crate::arm::FP64 };
6314    ("fpregs") => { $crate::arm::FPREGS };
6315    ("i8mm") => { $crate::arm::I8MM };
6316    ("mclass") => { $crate::arm::MCLASS };
6317    ("mve") => { $crate::arm::MVE };
6318    ("mve.fp") => { $crate::arm::MVE_FP };
6319    ("neon") => { $crate::arm::NEON };
6320    ("rclass") => { $crate::arm::RCLASS };
6321    ("sha2") => { $crate::arm::SHA2 };
6322    ("soft-float") => { $crate::arm::SOFT_FLOAT };
6323    ("thumb-mode") => { $crate::arm::THUMB_MODE };
6324    ("thumb2") => { $crate::arm::THUMB2 };
6325    ("trustzone") => { $crate::arm::TRUSTZONE };
6326    ("v5te") => { $crate::arm::V5TE };
6327    ("v6") => { $crate::arm::V6 };
6328    ("v6k") => { $crate::arm::V6K };
6329    ("v6m") => { $crate::arm::V6M };
6330    ("v6t2") => { $crate::arm::V6T2 };
6331    ("v7") => { $crate::arm::V7 };
6332    ("v8") => { $crate::arm::V8 };
6333    ("v8.1m.main") => { $crate::arm::V8_1M_MAIN };
6334    ("v8m") => { $crate::arm::V8M };
6335    ("v8m.main") => { $crate::arm::V8M_MAIN };
6336    ("vfp2") => { $crate::arm::VFP2 };
6337    ("vfp2sp") => { $crate::arm::VFP2SP };
6338    ("vfp3") => { $crate::arm::VFP3 };
6339    ("vfp4") => { $crate::arm::VFP4 };
6340    ("virtualization") => { $crate::arm::VIRTUALIZATION };
6341    ($feature:tt) => {
6342        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6343    };
6344}
6345#[cfg(target_arch = "aarch64")]
6346#[doc(hidden)]
6347#[rustfmt::skip]
6348#[macro_export]
6349macro_rules! __target_feature {
6350    ("aes") => { $crate::aarch64::AES };
6351    ("bf16") => { $crate::aarch64::BF16 };
6352    ("bti") => { $crate::aarch64::BTI };
6353    ("crc") => { $crate::aarch64::CRC };
6354    ("crt-static") => { $crate::aarch64::CRT_STATIC };
6355    ("cssc") => { $crate::aarch64::CSSC };
6356    ("dit") => { $crate::aarch64::DIT };
6357    ("dotprod") => { $crate::aarch64::DOTPROD };
6358    ("dpb") => { $crate::aarch64::DPB };
6359    ("dpb2") => { $crate::aarch64::DPB2 };
6360    ("ecv") => { $crate::aarch64::ECV };
6361    ("f32mm") => { $crate::aarch64::F32MM };
6362    ("f64mm") => { $crate::aarch64::F64MM };
6363    ("faminmax") => { $crate::aarch64::FAMINMAX };
6364    ("fcma") => { $crate::aarch64::FCMA };
6365    ("fhm") => { $crate::aarch64::FHM };
6366    ("flagm") => { $crate::aarch64::FLAGM };
6367    ("flagm2") => { $crate::aarch64::FLAGM2 };
6368    ("fp16") => { $crate::aarch64::FP16 };
6369    ("fp8") => { $crate::aarch64::FP8 };
6370    ("fp8dot2") => { $crate::aarch64::FP8DOT2 };
6371    ("fp8dot4") => { $crate::aarch64::FP8DOT4 };
6372    ("fp8fma") => { $crate::aarch64::FP8FMA };
6373    ("frintts") => { $crate::aarch64::FRINTTS };
6374    ("hbc") => { $crate::aarch64::HBC };
6375    ("i8mm") => { $crate::aarch64::I8MM };
6376    ("jsconv") => { $crate::aarch64::JSCONV };
6377    ("lor") => { $crate::aarch64::LOR };
6378    ("lse") => { $crate::aarch64::LSE };
6379    ("lse128") => { $crate::aarch64::LSE128 };
6380    ("lse2") => { $crate::aarch64::LSE2 };
6381    ("lut") => { $crate::aarch64::LUT };
6382    ("mops") => { $crate::aarch64::MOPS };
6383    ("mte") => { $crate::aarch64::MTE };
6384    ("neon") => { $crate::aarch64::NEON };
6385    ("outline-atomics") => { $crate::aarch64::OUTLINE_ATOMICS };
6386    ("paca") => { $crate::aarch64::PACA };
6387    ("pacg") => { $crate::aarch64::PACG };
6388    ("pan") => { $crate::aarch64::PAN };
6389    ("pauth-lr") => { $crate::aarch64::PAUTH_LR };
6390    ("pmuv3") => { $crate::aarch64::PMUV3 };
6391    ("rand") => { $crate::aarch64::RAND };
6392    ("ras") => { $crate::aarch64::RAS };
6393    ("rcpc") => { $crate::aarch64::RCPC };
6394    ("rcpc2") => { $crate::aarch64::RCPC2 };
6395    ("rcpc3") => { $crate::aarch64::RCPC3 };
6396    ("rdm") => { $crate::aarch64::RDM };
6397    ("sb") => { $crate::aarch64::SB };
6398    ("sha2") => { $crate::aarch64::SHA2 };
6399    ("sha3") => { $crate::aarch64::SHA3 };
6400    ("sm4") => { $crate::aarch64::SM4 };
6401    ("sme") => { $crate::aarch64::SME };
6402    ("sme-b16b16") => { $crate::aarch64::SME_B16B16 };
6403    ("sme-f16f16") => { $crate::aarch64::SME_F16F16 };
6404    ("sme-f64f64") => { $crate::aarch64::SME_F64F64 };
6405    ("sme-f8f16") => { $crate::aarch64::SME_F8F16 };
6406    ("sme-f8f32") => { $crate::aarch64::SME_F8F32 };
6407    ("sme-fa64") => { $crate::aarch64::SME_FA64 };
6408    ("sme-i16i64") => { $crate::aarch64::SME_I16I64 };
6409    ("sme-lutv2") => { $crate::aarch64::SME_LUTV2 };
6410    ("sme2") => { $crate::aarch64::SME2 };
6411    ("sme2p1") => { $crate::aarch64::SME2P1 };
6412    ("spe") => { $crate::aarch64::SPE };
6413    ("ssbs") => { $crate::aarch64::SSBS };
6414    ("ssve-fp8dot2") => { $crate::aarch64::SSVE_FP8DOT2 };
6415    ("ssve-fp8dot4") => { $crate::aarch64::SSVE_FP8DOT4 };
6416    ("ssve-fp8fma") => { $crate::aarch64::SSVE_FP8FMA };
6417    ("sve") => { $crate::aarch64::SVE };
6418    ("sve-b16b16") => { $crate::aarch64::SVE_B16B16 };
6419    ("sve2") => { $crate::aarch64::SVE2 };
6420    ("sve2-aes") => { $crate::aarch64::SVE2_AES };
6421    ("sve2-bitperm") => { $crate::aarch64::SVE2_BITPERM };
6422    ("sve2-sha3") => { $crate::aarch64::SVE2_SHA3 };
6423    ("sve2-sm4") => { $crate::aarch64::SVE2_SM4 };
6424    ("sve2p1") => { $crate::aarch64::SVE2P1 };
6425    ("v8.1a") => { $crate::aarch64::V8_1A };
6426    ("v8.2a") => { $crate::aarch64::V8_2A };
6427    ("v8.3a") => { $crate::aarch64::V8_3A };
6428    ("v8.4a") => { $crate::aarch64::V8_4A };
6429    ("v8.5a") => { $crate::aarch64::V8_5A };
6430    ("v8.6a") => { $crate::aarch64::V8_6A };
6431    ("v8.7a") => { $crate::aarch64::V8_7A };
6432    ("v8.8a") => { $crate::aarch64::V8_8A };
6433    ("v8.9a") => { $crate::aarch64::V8_9A };
6434    ("v9.1a") => { $crate::aarch64::V9_1A };
6435    ("v9.2a") => { $crate::aarch64::V9_2A };
6436    ("v9.3a") => { $crate::aarch64::V9_3A };
6437    ("v9.4a") => { $crate::aarch64::V9_4A };
6438    ("v9.5a") => { $crate::aarch64::V9_5A };
6439    ("v9a") => { $crate::aarch64::V9A };
6440    ("vh") => { $crate::aarch64::VH };
6441    ("wfxt") => { $crate::aarch64::WFXT };
6442    ($feature:tt) => {
6443        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6444    };
6445}
6446#[cfg(target_arch = "arm64ec")]
6447#[doc(hidden)]
6448#[rustfmt::skip]
6449#[macro_export]
6450macro_rules! __target_feature {
6451    ("aes") => { $crate::arm64ec::AES };
6452    ("bf16") => { $crate::arm64ec::BF16 };
6453    ("bti") => { $crate::arm64ec::BTI };
6454    ("crc") => { $crate::arm64ec::CRC };
6455    ("crt-static") => { $crate::arm64ec::CRT_STATIC };
6456    ("cssc") => { $crate::arm64ec::CSSC };
6457    ("dit") => { $crate::arm64ec::DIT };
6458    ("dotprod") => { $crate::arm64ec::DOTPROD };
6459    ("dpb") => { $crate::arm64ec::DPB };
6460    ("dpb2") => { $crate::arm64ec::DPB2 };
6461    ("ecv") => { $crate::arm64ec::ECV };
6462    ("f32mm") => { $crate::arm64ec::F32MM };
6463    ("f64mm") => { $crate::arm64ec::F64MM };
6464    ("faminmax") => { $crate::arm64ec::FAMINMAX };
6465    ("fcma") => { $crate::arm64ec::FCMA };
6466    ("fhm") => { $crate::arm64ec::FHM };
6467    ("flagm") => { $crate::arm64ec::FLAGM };
6468    ("flagm2") => { $crate::arm64ec::FLAGM2 };
6469    ("fp16") => { $crate::arm64ec::FP16 };
6470    ("fp8") => { $crate::arm64ec::FP8 };
6471    ("fp8dot2") => { $crate::arm64ec::FP8DOT2 };
6472    ("fp8dot4") => { $crate::arm64ec::FP8DOT4 };
6473    ("fp8fma") => { $crate::arm64ec::FP8FMA };
6474    ("frintts") => { $crate::arm64ec::FRINTTS };
6475    ("hbc") => { $crate::arm64ec::HBC };
6476    ("i8mm") => { $crate::arm64ec::I8MM };
6477    ("jsconv") => { $crate::arm64ec::JSCONV };
6478    ("lor") => { $crate::arm64ec::LOR };
6479    ("lse") => { $crate::arm64ec::LSE };
6480    ("lse128") => { $crate::arm64ec::LSE128 };
6481    ("lse2") => { $crate::arm64ec::LSE2 };
6482    ("lut") => { $crate::arm64ec::LUT };
6483    ("mops") => { $crate::arm64ec::MOPS };
6484    ("mte") => { $crate::arm64ec::MTE };
6485    ("neon") => { $crate::arm64ec::NEON };
6486    ("outline-atomics") => { $crate::arm64ec::OUTLINE_ATOMICS };
6487    ("paca") => { $crate::arm64ec::PACA };
6488    ("pacg") => { $crate::arm64ec::PACG };
6489    ("pan") => { $crate::arm64ec::PAN };
6490    ("pauth-lr") => { $crate::arm64ec::PAUTH_LR };
6491    ("pmuv3") => { $crate::arm64ec::PMUV3 };
6492    ("rand") => { $crate::arm64ec::RAND };
6493    ("ras") => { $crate::arm64ec::RAS };
6494    ("rcpc") => { $crate::arm64ec::RCPC };
6495    ("rcpc2") => { $crate::arm64ec::RCPC2 };
6496    ("rcpc3") => { $crate::arm64ec::RCPC3 };
6497    ("rdm") => { $crate::arm64ec::RDM };
6498    ("sb") => { $crate::arm64ec::SB };
6499    ("sha2") => { $crate::arm64ec::SHA2 };
6500    ("sha3") => { $crate::arm64ec::SHA3 };
6501    ("sm4") => { $crate::arm64ec::SM4 };
6502    ("sme") => { $crate::arm64ec::SME };
6503    ("sme-b16b16") => { $crate::arm64ec::SME_B16B16 };
6504    ("sme-f16f16") => { $crate::arm64ec::SME_F16F16 };
6505    ("sme-f64f64") => { $crate::arm64ec::SME_F64F64 };
6506    ("sme-f8f16") => { $crate::arm64ec::SME_F8F16 };
6507    ("sme-f8f32") => { $crate::arm64ec::SME_F8F32 };
6508    ("sme-fa64") => { $crate::arm64ec::SME_FA64 };
6509    ("sme-i16i64") => { $crate::arm64ec::SME_I16I64 };
6510    ("sme-lutv2") => { $crate::arm64ec::SME_LUTV2 };
6511    ("sme2") => { $crate::arm64ec::SME2 };
6512    ("sme2p1") => { $crate::arm64ec::SME2P1 };
6513    ("spe") => { $crate::arm64ec::SPE };
6514    ("ssbs") => { $crate::arm64ec::SSBS };
6515    ("ssve-fp8dot2") => { $crate::arm64ec::SSVE_FP8DOT2 };
6516    ("ssve-fp8dot4") => { $crate::arm64ec::SSVE_FP8DOT4 };
6517    ("ssve-fp8fma") => { $crate::arm64ec::SSVE_FP8FMA };
6518    ("sve") => { $crate::arm64ec::SVE };
6519    ("sve-b16b16") => { $crate::arm64ec::SVE_B16B16 };
6520    ("sve2") => { $crate::arm64ec::SVE2 };
6521    ("sve2-aes") => { $crate::arm64ec::SVE2_AES };
6522    ("sve2-bitperm") => { $crate::arm64ec::SVE2_BITPERM };
6523    ("sve2-sha3") => { $crate::arm64ec::SVE2_SHA3 };
6524    ("sve2-sm4") => { $crate::arm64ec::SVE2_SM4 };
6525    ("sve2p1") => { $crate::arm64ec::SVE2P1 };
6526    ("v8.1a") => { $crate::arm64ec::V8_1A };
6527    ("v8.2a") => { $crate::arm64ec::V8_2A };
6528    ("v8.3a") => { $crate::arm64ec::V8_3A };
6529    ("v8.4a") => { $crate::arm64ec::V8_4A };
6530    ("v8.5a") => { $crate::arm64ec::V8_5A };
6531    ("v8.6a") => { $crate::arm64ec::V8_6A };
6532    ("v8.7a") => { $crate::arm64ec::V8_7A };
6533    ("v8.8a") => { $crate::arm64ec::V8_8A };
6534    ("v8.9a") => { $crate::arm64ec::V8_9A };
6535    ("v9.1a") => { $crate::arm64ec::V9_1A };
6536    ("v9.2a") => { $crate::arm64ec::V9_2A };
6537    ("v9.3a") => { $crate::arm64ec::V9_3A };
6538    ("v9.4a") => { $crate::arm64ec::V9_4A };
6539    ("v9.5a") => { $crate::arm64ec::V9_5A };
6540    ("v9a") => { $crate::arm64ec::V9A };
6541    ("vh") => { $crate::arm64ec::VH };
6542    ("wfxt") => { $crate::arm64ec::WFXT };
6543    ($feature:tt) => {
6544        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6545    };
6546}
6547#[cfg(target_arch = "bpf")]
6548#[doc(hidden)]
6549#[rustfmt::skip]
6550#[macro_export]
6551macro_rules! __target_feature {
6552    ("allows-misaligned-mem-access") => { $crate::bpf::ALLOWS_MISALIGNED_MEM_ACCESS };
6553    ("alu32") => { $crate::bpf::ALU32 };
6554    ("crt-static") => { $crate::bpf::CRT_STATIC };
6555    ($feature:tt) => {
6556        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6557    };
6558}
6559#[cfg(target_arch = "hexagon")]
6560#[doc(hidden)]
6561#[rustfmt::skip]
6562#[macro_export]
6563macro_rules! __target_feature {
6564    ("audio") => { $crate::hexagon::AUDIO };
6565    ("crt-static") => { $crate::hexagon::CRT_STATIC };
6566    ("hvx") => { $crate::hexagon::HVX };
6567    ("hvx-ieee-fp") => { $crate::hexagon::HVX_IEEE_FP };
6568    ("hvx-length128b") => { $crate::hexagon::HVX_LENGTH128B };
6569    ("hvx-length64b") => { $crate::hexagon::HVX_LENGTH64B };
6570    ("hvx-qfloat") => { $crate::hexagon::HVX_QFLOAT };
6571    ("hvxv60") => { $crate::hexagon::HVXV60 };
6572    ("hvxv62") => { $crate::hexagon::HVXV62 };
6573    ("hvxv65") => { $crate::hexagon::HVXV65 };
6574    ("hvxv66") => { $crate::hexagon::HVXV66 };
6575    ("hvxv67") => { $crate::hexagon::HVXV67 };
6576    ("hvxv68") => { $crate::hexagon::HVXV68 };
6577    ("hvxv69") => { $crate::hexagon::HVXV69 };
6578    ("hvxv71") => { $crate::hexagon::HVXV71 };
6579    ("hvxv73") => { $crate::hexagon::HVXV73 };
6580    ("hvxv75") => { $crate::hexagon::HVXV75 };
6581    ("hvxv79") => { $crate::hexagon::HVXV79 };
6582    ("v60") => { $crate::hexagon::V60 };
6583    ("v62") => { $crate::hexagon::V62 };
6584    ("v65") => { $crate::hexagon::V65 };
6585    ("v66") => { $crate::hexagon::V66 };
6586    ("v67") => { $crate::hexagon::V67 };
6587    ("v68") => { $crate::hexagon::V68 };
6588    ("v69") => { $crate::hexagon::V69 };
6589    ("v71") => { $crate::hexagon::V71 };
6590    ("v73") => { $crate::hexagon::V73 };
6591    ("v75") => { $crate::hexagon::V75 };
6592    ("v79") => { $crate::hexagon::V79 };
6593    ("zreg") => { $crate::hexagon::ZREG };
6594    ($feature:tt) => {
6595        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6596    };
6597}
6598#[cfg(target_arch = "mips")]
6599#[doc(hidden)]
6600#[rustfmt::skip]
6601#[macro_export]
6602macro_rules! __target_feature {
6603    ("crt-static") => { $crate::mips::CRT_STATIC };
6604    ("fp64") => { $crate::mips::FP64 };
6605    ("msa") => { $crate::mips::MSA };
6606    ("virt") => { $crate::mips::VIRT };
6607    ($feature:tt) => {
6608        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6609    };
6610}
6611#[cfg(target_arch = "mips64")]
6612#[doc(hidden)]
6613#[rustfmt::skip]
6614#[macro_export]
6615macro_rules! __target_feature {
6616    ("crt-static") => { $crate::mips64::CRT_STATIC };
6617    ("fp64") => { $crate::mips64::FP64 };
6618    ("msa") => { $crate::mips64::MSA };
6619    ("virt") => { $crate::mips64::VIRT };
6620    ($feature:tt) => {
6621        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6622    };
6623}
6624#[cfg(target_arch = "loongarch32")]
6625#[doc(hidden)]
6626#[rustfmt::skip]
6627#[macro_export]
6628macro_rules! __target_feature {
6629    ("32s") => { $crate::loongarch32::F_32S };
6630    ("crt-static") => { $crate::loongarch32::CRT_STATIC };
6631    ("d") => { $crate::loongarch32::D };
6632    ("div32") => { $crate::loongarch32::DIV32 };
6633    ("f") => { $crate::loongarch32::F };
6634    ("frecipe") => { $crate::loongarch32::FRECIPE };
6635    ("lam-bh") => { $crate::loongarch32::LAM_BH };
6636    ("lamcas") => { $crate::loongarch32::LAMCAS };
6637    ("lasx") => { $crate::loongarch32::LASX };
6638    ("lbt") => { $crate::loongarch32::LBT };
6639    ("ld-seq-sa") => { $crate::loongarch32::LD_SEQ_SA };
6640    ("lsx") => { $crate::loongarch32::LSX };
6641    ("lvz") => { $crate::loongarch32::LVZ };
6642    ("relax") => { $crate::loongarch32::RELAX };
6643    ("scq") => { $crate::loongarch32::SCQ };
6644    ("ual") => { $crate::loongarch32::UAL };
6645    ($feature:tt) => {
6646        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6647    };
6648}
6649#[cfg(target_arch = "loongarch64")]
6650#[doc(hidden)]
6651#[rustfmt::skip]
6652#[macro_export]
6653macro_rules! __target_feature {
6654    ("32s") => { $crate::loongarch64::F_32S };
6655    ("crt-static") => { $crate::loongarch64::CRT_STATIC };
6656    ("d") => { $crate::loongarch64::D };
6657    ("div32") => { $crate::loongarch64::DIV32 };
6658    ("f") => { $crate::loongarch64::F };
6659    ("frecipe") => { $crate::loongarch64::FRECIPE };
6660    ("lam-bh") => { $crate::loongarch64::LAM_BH };
6661    ("lamcas") => { $crate::loongarch64::LAMCAS };
6662    ("lasx") => { $crate::loongarch64::LASX };
6663    ("lbt") => { $crate::loongarch64::LBT };
6664    ("ld-seq-sa") => { $crate::loongarch64::LD_SEQ_SA };
6665    ("lsx") => { $crate::loongarch64::LSX };
6666    ("lvz") => { $crate::loongarch64::LVZ };
6667    ("relax") => { $crate::loongarch64::RELAX };
6668    ("scq") => { $crate::loongarch64::SCQ };
6669    ("ual") => { $crate::loongarch64::UAL };
6670    ($feature:tt) => {
6671        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6672    };
6673}
6674#[cfg(target_arch = "nvptx64")]
6675#[doc(hidden)]
6676#[rustfmt::skip]
6677#[macro_export]
6678macro_rules! __target_feature {
6679    ("crt-static") => { $crate::nvptx64::CRT_STATIC };
6680    ("ptx70") => { $crate::nvptx64::PTX70 };
6681    ("ptx71") => { $crate::nvptx64::PTX71 };
6682    ("ptx72") => { $crate::nvptx64::PTX72 };
6683    ("ptx73") => { $crate::nvptx64::PTX73 };
6684    ("ptx74") => { $crate::nvptx64::PTX74 };
6685    ("ptx75") => { $crate::nvptx64::PTX75 };
6686    ("ptx76") => { $crate::nvptx64::PTX76 };
6687    ("ptx77") => { $crate::nvptx64::PTX77 };
6688    ("ptx78") => { $crate::nvptx64::PTX78 };
6689    ("ptx80") => { $crate::nvptx64::PTX80 };
6690    ("ptx81") => { $crate::nvptx64::PTX81 };
6691    ("ptx82") => { $crate::nvptx64::PTX82 };
6692    ("ptx83") => { $crate::nvptx64::PTX83 };
6693    ("ptx84") => { $crate::nvptx64::PTX84 };
6694    ("ptx85") => { $crate::nvptx64::PTX85 };
6695    ("ptx86") => { $crate::nvptx64::PTX86 };
6696    ("ptx87") => { $crate::nvptx64::PTX87 };
6697    ("sm_100") => { $crate::nvptx64::SM_100 };
6698    ("sm_100a") => { $crate::nvptx64::SM_100A };
6699    ("sm_101") => { $crate::nvptx64::SM_101 };
6700    ("sm_101a") => { $crate::nvptx64::SM_101A };
6701    ("sm_120") => { $crate::nvptx64::SM_120 };
6702    ("sm_120a") => { $crate::nvptx64::SM_120A };
6703    ("sm_70") => { $crate::nvptx64::SM_70 };
6704    ("sm_72") => { $crate::nvptx64::SM_72 };
6705    ("sm_75") => { $crate::nvptx64::SM_75 };
6706    ("sm_80") => { $crate::nvptx64::SM_80 };
6707    ("sm_86") => { $crate::nvptx64::SM_86 };
6708    ("sm_87") => { $crate::nvptx64::SM_87 };
6709    ("sm_89") => { $crate::nvptx64::SM_89 };
6710    ("sm_90") => { $crate::nvptx64::SM_90 };
6711    ("sm_90a") => { $crate::nvptx64::SM_90A };
6712    ($feature:tt) => {
6713        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6714    };
6715}
6716#[cfg(target_arch = "powerpc")]
6717#[doc(hidden)]
6718#[rustfmt::skip]
6719#[macro_export]
6720macro_rules! __target_feature {
6721    ("altivec") => { $crate::powerpc::ALTIVEC };
6722    ("crt-static") => { $crate::powerpc::CRT_STATIC };
6723    ("msync") => { $crate::powerpc::MSYNC };
6724    ("partword-atomics") => { $crate::powerpc::PARTWORD_ATOMICS };
6725    ("power10-vector") => { $crate::powerpc::POWER10_VECTOR };
6726    ("power8-altivec") => { $crate::powerpc::POWER8_ALTIVEC };
6727    ("power8-crypto") => { $crate::powerpc::POWER8_CRYPTO };
6728    ("power8-vector") => { $crate::powerpc::POWER8_VECTOR };
6729    ("power9-altivec") => { $crate::powerpc::POWER9_ALTIVEC };
6730    ("power9-vector") => { $crate::powerpc::POWER9_VECTOR };
6731    ("quadword-atomics") => { $crate::powerpc::QUADWORD_ATOMICS };
6732    ("vsx") => { $crate::powerpc::VSX };
6733    ($feature:tt) => {
6734        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6735    };
6736}
6737#[cfg(target_arch = "powerpc64")]
6738#[doc(hidden)]
6739#[rustfmt::skip]
6740#[macro_export]
6741macro_rules! __target_feature {
6742    ("altivec") => { $crate::powerpc64::ALTIVEC };
6743    ("crt-static") => { $crate::powerpc64::CRT_STATIC };
6744    ("msync") => { $crate::powerpc64::MSYNC };
6745    ("partword-atomics") => { $crate::powerpc64::PARTWORD_ATOMICS };
6746    ("power10-vector") => { $crate::powerpc64::POWER10_VECTOR };
6747    ("power8-altivec") => { $crate::powerpc64::POWER8_ALTIVEC };
6748    ("power8-crypto") => { $crate::powerpc64::POWER8_CRYPTO };
6749    ("power8-vector") => { $crate::powerpc64::POWER8_VECTOR };
6750    ("power9-altivec") => { $crate::powerpc64::POWER9_ALTIVEC };
6751    ("power9-vector") => { $crate::powerpc64::POWER9_VECTOR };
6752    ("quadword-atomics") => { $crate::powerpc64::QUADWORD_ATOMICS };
6753    ("vsx") => { $crate::powerpc64::VSX };
6754    ($feature:tt) => {
6755        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6756    };
6757}
6758#[cfg(target_arch = "riscv32")]
6759#[doc(hidden)]
6760#[rustfmt::skip]
6761#[macro_export]
6762macro_rules! __target_feature {
6763    ("a") => { $crate::riscv32::A };
6764    ("b") => { $crate::riscv32::B };
6765    ("c") => { $crate::riscv32::C };
6766    ("crt-static") => { $crate::riscv32::CRT_STATIC };
6767    ("d") => { $crate::riscv32::D };
6768    ("e") => { $crate::riscv32::E };
6769    ("f") => { $crate::riscv32::F };
6770    ("m") => { $crate::riscv32::M };
6771    ("relax") => { $crate::riscv32::RELAX };
6772    ("rva23u64") => { $crate::riscv32::RVA23U64 };
6773    ("supm") => { $crate::riscv32::SUPM };
6774    ("unaligned-scalar-mem") => { $crate::riscv32::UNALIGNED_SCALAR_MEM };
6775    ("unaligned-vector-mem") => { $crate::riscv32::UNALIGNED_VECTOR_MEM };
6776    ("v") => { $crate::riscv32::V };
6777    ("za128rs") => { $crate::riscv32::ZA128RS };
6778    ("za64rs") => { $crate::riscv32::ZA64RS };
6779    ("zaamo") => { $crate::riscv32::ZAAMO };
6780    ("zabha") => { $crate::riscv32::ZABHA };
6781    ("zacas") => { $crate::riscv32::ZACAS };
6782    ("zalrsc") => { $crate::riscv32::ZALRSC };
6783    ("zama16b") => { $crate::riscv32::ZAMA16B };
6784    ("zawrs") => { $crate::riscv32::ZAWRS };
6785    ("zba") => { $crate::riscv32::ZBA };
6786    ("zbb") => { $crate::riscv32::ZBB };
6787    ("zbc") => { $crate::riscv32::ZBC };
6788    ("zbkb") => { $crate::riscv32::ZBKB };
6789    ("zbkc") => { $crate::riscv32::ZBKC };
6790    ("zbkx") => { $crate::riscv32::ZBKX };
6791    ("zbs") => { $crate::riscv32::ZBS };
6792    ("zca") => { $crate::riscv32::ZCA };
6793    ("zcb") => { $crate::riscv32::ZCB };
6794    ("zcmop") => { $crate::riscv32::ZCMOP };
6795    ("zdinx") => { $crate::riscv32::ZDINX };
6796    ("zfa") => { $crate::riscv32::ZFA };
6797    ("zfbfmin") => { $crate::riscv32::ZFBFMIN };
6798    ("zfh") => { $crate::riscv32::ZFH };
6799    ("zfhmin") => { $crate::riscv32::ZFHMIN };
6800    ("zfinx") => { $crate::riscv32::ZFINX };
6801    ("zhinx") => { $crate::riscv32::ZHINX };
6802    ("zhinxmin") => { $crate::riscv32::ZHINXMIN };
6803    ("zic64b") => { $crate::riscv32::ZIC64B };
6804    ("zicbom") => { $crate::riscv32::ZICBOM };
6805    ("zicbop") => { $crate::riscv32::ZICBOP };
6806    ("zicboz") => { $crate::riscv32::ZICBOZ };
6807    ("ziccamoa") => { $crate::riscv32::ZICCAMOA };
6808    ("ziccif") => { $crate::riscv32::ZICCIF };
6809    ("zicclsm") => { $crate::riscv32::ZICCLSM };
6810    ("ziccrse") => { $crate::riscv32::ZICCRSE };
6811    ("zicntr") => { $crate::riscv32::ZICNTR };
6812    ("zicond") => { $crate::riscv32::ZICOND };
6813    ("zicsr") => { $crate::riscv32::ZICSR };
6814    ("zifencei") => { $crate::riscv32::ZIFENCEI };
6815    ("zihintntl") => { $crate::riscv32::ZIHINTNTL };
6816    ("zihintpause") => { $crate::riscv32::ZIHINTPAUSE };
6817    ("zihpm") => { $crate::riscv32::ZIHPM };
6818    ("zimop") => { $crate::riscv32::ZIMOP };
6819    ("zk") => { $crate::riscv32::ZK };
6820    ("zkn") => { $crate::riscv32::ZKN };
6821    ("zknd") => { $crate::riscv32::ZKND };
6822    ("zkne") => { $crate::riscv32::ZKNE };
6823    ("zknh") => { $crate::riscv32::ZKNH };
6824    ("zkr") => { $crate::riscv32::ZKR };
6825    ("zks") => { $crate::riscv32::ZKS };
6826    ("zksed") => { $crate::riscv32::ZKSED };
6827    ("zksh") => { $crate::riscv32::ZKSH };
6828    ("zkt") => { $crate::riscv32::ZKT };
6829    ("ztso") => { $crate::riscv32::ZTSO };
6830    ("zvbb") => { $crate::riscv32::ZVBB };
6831    ("zvbc") => { $crate::riscv32::ZVBC };
6832    ("zve32f") => { $crate::riscv32::ZVE32F };
6833    ("zve32x") => { $crate::riscv32::ZVE32X };
6834    ("zve64d") => { $crate::riscv32::ZVE64D };
6835    ("zve64f") => { $crate::riscv32::ZVE64F };
6836    ("zve64x") => { $crate::riscv32::ZVE64X };
6837    ("zvfbfmin") => { $crate::riscv32::ZVFBFMIN };
6838    ("zvfbfwma") => { $crate::riscv32::ZVFBFWMA };
6839    ("zvfh") => { $crate::riscv32::ZVFH };
6840    ("zvfhmin") => { $crate::riscv32::ZVFHMIN };
6841    ("zvkb") => { $crate::riscv32::ZVKB };
6842    ("zvkg") => { $crate::riscv32::ZVKG };
6843    ("zvkn") => { $crate::riscv32::ZVKN };
6844    ("zvknc") => { $crate::riscv32::ZVKNC };
6845    ("zvkned") => { $crate::riscv32::ZVKNED };
6846    ("zvkng") => { $crate::riscv32::ZVKNG };
6847    ("zvknha") => { $crate::riscv32::ZVKNHA };
6848    ("zvknhb") => { $crate::riscv32::ZVKNHB };
6849    ("zvks") => { $crate::riscv32::ZVKS };
6850    ("zvksc") => { $crate::riscv32::ZVKSC };
6851    ("zvksed") => { $crate::riscv32::ZVKSED };
6852    ("zvksg") => { $crate::riscv32::ZVKSG };
6853    ("zvksh") => { $crate::riscv32::ZVKSH };
6854    ("zvkt") => { $crate::riscv32::ZVKT };
6855    ("zvl1024b") => { $crate::riscv32::ZVL1024B };
6856    ("zvl128b") => { $crate::riscv32::ZVL128B };
6857    ("zvl16384b") => { $crate::riscv32::ZVL16384B };
6858    ("zvl2048b") => { $crate::riscv32::ZVL2048B };
6859    ("zvl256b") => { $crate::riscv32::ZVL256B };
6860    ("zvl32768b") => { $crate::riscv32::ZVL32768B };
6861    ("zvl32b") => { $crate::riscv32::ZVL32B };
6862    ("zvl4096b") => { $crate::riscv32::ZVL4096B };
6863    ("zvl512b") => { $crate::riscv32::ZVL512B };
6864    ("zvl64b") => { $crate::riscv32::ZVL64B };
6865    ("zvl65536b") => { $crate::riscv32::ZVL65536B };
6866    ("zvl8192b") => { $crate::riscv32::ZVL8192B };
6867    ($feature:tt) => {
6868        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6869    };
6870}
6871#[cfg(target_arch = "riscv64")]
6872#[doc(hidden)]
6873#[rustfmt::skip]
6874#[macro_export]
6875macro_rules! __target_feature {
6876    ("a") => { $crate::riscv64::A };
6877    ("b") => { $crate::riscv64::B };
6878    ("c") => { $crate::riscv64::C };
6879    ("crt-static") => { $crate::riscv64::CRT_STATIC };
6880    ("d") => { $crate::riscv64::D };
6881    ("e") => { $crate::riscv64::E };
6882    ("f") => { $crate::riscv64::F };
6883    ("m") => { $crate::riscv64::M };
6884    ("relax") => { $crate::riscv64::RELAX };
6885    ("rva23u64") => { $crate::riscv64::RVA23U64 };
6886    ("supm") => { $crate::riscv64::SUPM };
6887    ("unaligned-scalar-mem") => { $crate::riscv64::UNALIGNED_SCALAR_MEM };
6888    ("unaligned-vector-mem") => { $crate::riscv64::UNALIGNED_VECTOR_MEM };
6889    ("v") => { $crate::riscv64::V };
6890    ("za128rs") => { $crate::riscv64::ZA128RS };
6891    ("za64rs") => { $crate::riscv64::ZA64RS };
6892    ("zaamo") => { $crate::riscv64::ZAAMO };
6893    ("zabha") => { $crate::riscv64::ZABHA };
6894    ("zacas") => { $crate::riscv64::ZACAS };
6895    ("zalrsc") => { $crate::riscv64::ZALRSC };
6896    ("zama16b") => { $crate::riscv64::ZAMA16B };
6897    ("zawrs") => { $crate::riscv64::ZAWRS };
6898    ("zba") => { $crate::riscv64::ZBA };
6899    ("zbb") => { $crate::riscv64::ZBB };
6900    ("zbc") => { $crate::riscv64::ZBC };
6901    ("zbkb") => { $crate::riscv64::ZBKB };
6902    ("zbkc") => { $crate::riscv64::ZBKC };
6903    ("zbkx") => { $crate::riscv64::ZBKX };
6904    ("zbs") => { $crate::riscv64::ZBS };
6905    ("zca") => { $crate::riscv64::ZCA };
6906    ("zcb") => { $crate::riscv64::ZCB };
6907    ("zcmop") => { $crate::riscv64::ZCMOP };
6908    ("zdinx") => { $crate::riscv64::ZDINX };
6909    ("zfa") => { $crate::riscv64::ZFA };
6910    ("zfbfmin") => { $crate::riscv64::ZFBFMIN };
6911    ("zfh") => { $crate::riscv64::ZFH };
6912    ("zfhmin") => { $crate::riscv64::ZFHMIN };
6913    ("zfinx") => { $crate::riscv64::ZFINX };
6914    ("zhinx") => { $crate::riscv64::ZHINX };
6915    ("zhinxmin") => { $crate::riscv64::ZHINXMIN };
6916    ("zic64b") => { $crate::riscv64::ZIC64B };
6917    ("zicbom") => { $crate::riscv64::ZICBOM };
6918    ("zicbop") => { $crate::riscv64::ZICBOP };
6919    ("zicboz") => { $crate::riscv64::ZICBOZ };
6920    ("ziccamoa") => { $crate::riscv64::ZICCAMOA };
6921    ("ziccif") => { $crate::riscv64::ZICCIF };
6922    ("zicclsm") => { $crate::riscv64::ZICCLSM };
6923    ("ziccrse") => { $crate::riscv64::ZICCRSE };
6924    ("zicntr") => { $crate::riscv64::ZICNTR };
6925    ("zicond") => { $crate::riscv64::ZICOND };
6926    ("zicsr") => { $crate::riscv64::ZICSR };
6927    ("zifencei") => { $crate::riscv64::ZIFENCEI };
6928    ("zihintntl") => { $crate::riscv64::ZIHINTNTL };
6929    ("zihintpause") => { $crate::riscv64::ZIHINTPAUSE };
6930    ("zihpm") => { $crate::riscv64::ZIHPM };
6931    ("zimop") => { $crate::riscv64::ZIMOP };
6932    ("zk") => { $crate::riscv64::ZK };
6933    ("zkn") => { $crate::riscv64::ZKN };
6934    ("zknd") => { $crate::riscv64::ZKND };
6935    ("zkne") => { $crate::riscv64::ZKNE };
6936    ("zknh") => { $crate::riscv64::ZKNH };
6937    ("zkr") => { $crate::riscv64::ZKR };
6938    ("zks") => { $crate::riscv64::ZKS };
6939    ("zksed") => { $crate::riscv64::ZKSED };
6940    ("zksh") => { $crate::riscv64::ZKSH };
6941    ("zkt") => { $crate::riscv64::ZKT };
6942    ("ztso") => { $crate::riscv64::ZTSO };
6943    ("zvbb") => { $crate::riscv64::ZVBB };
6944    ("zvbc") => { $crate::riscv64::ZVBC };
6945    ("zve32f") => { $crate::riscv64::ZVE32F };
6946    ("zve32x") => { $crate::riscv64::ZVE32X };
6947    ("zve64d") => { $crate::riscv64::ZVE64D };
6948    ("zve64f") => { $crate::riscv64::ZVE64F };
6949    ("zve64x") => { $crate::riscv64::ZVE64X };
6950    ("zvfbfmin") => { $crate::riscv64::ZVFBFMIN };
6951    ("zvfbfwma") => { $crate::riscv64::ZVFBFWMA };
6952    ("zvfh") => { $crate::riscv64::ZVFH };
6953    ("zvfhmin") => { $crate::riscv64::ZVFHMIN };
6954    ("zvkb") => { $crate::riscv64::ZVKB };
6955    ("zvkg") => { $crate::riscv64::ZVKG };
6956    ("zvkn") => { $crate::riscv64::ZVKN };
6957    ("zvknc") => { $crate::riscv64::ZVKNC };
6958    ("zvkned") => { $crate::riscv64::ZVKNED };
6959    ("zvkng") => { $crate::riscv64::ZVKNG };
6960    ("zvknha") => { $crate::riscv64::ZVKNHA };
6961    ("zvknhb") => { $crate::riscv64::ZVKNHB };
6962    ("zvks") => { $crate::riscv64::ZVKS };
6963    ("zvksc") => { $crate::riscv64::ZVKSC };
6964    ("zvksed") => { $crate::riscv64::ZVKSED };
6965    ("zvksg") => { $crate::riscv64::ZVKSG };
6966    ("zvksh") => { $crate::riscv64::ZVKSH };
6967    ("zvkt") => { $crate::riscv64::ZVKT };
6968    ("zvl1024b") => { $crate::riscv64::ZVL1024B };
6969    ("zvl128b") => { $crate::riscv64::ZVL128B };
6970    ("zvl16384b") => { $crate::riscv64::ZVL16384B };
6971    ("zvl2048b") => { $crate::riscv64::ZVL2048B };
6972    ("zvl256b") => { $crate::riscv64::ZVL256B };
6973    ("zvl32768b") => { $crate::riscv64::ZVL32768B };
6974    ("zvl32b") => { $crate::riscv64::ZVL32B };
6975    ("zvl4096b") => { $crate::riscv64::ZVL4096B };
6976    ("zvl512b") => { $crate::riscv64::ZVL512B };
6977    ("zvl64b") => { $crate::riscv64::ZVL64B };
6978    ("zvl65536b") => { $crate::riscv64::ZVL65536B };
6979    ("zvl8192b") => { $crate::riscv64::ZVL8192B };
6980    ($feature:tt) => {
6981        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
6982    };
6983}
6984#[cfg(target_arch = "s390x")]
6985#[doc(hidden)]
6986#[rustfmt::skip]
6987#[macro_export]
6988macro_rules! __target_feature {
6989    ("backchain") => { $crate::s390x::BACKCHAIN };
6990    ("concurrent-functions") => { $crate::s390x::CONCURRENT_FUNCTIONS };
6991    ("crt-static") => { $crate::s390x::CRT_STATIC };
6992    ("deflate-conversion") => { $crate::s390x::DEFLATE_CONVERSION };
6993    ("enhanced-sort") => { $crate::s390x::ENHANCED_SORT };
6994    ("guarded-storage") => { $crate::s390x::GUARDED_STORAGE };
6995    ("high-word") => { $crate::s390x::HIGH_WORD };
6996    ("message-security-assist-extension12") => { $crate::s390x::MESSAGE_SECURITY_ASSIST_EXTENSION12 };
6997    ("message-security-assist-extension3") => { $crate::s390x::MESSAGE_SECURITY_ASSIST_EXTENSION3 };
6998    ("message-security-assist-extension4") => { $crate::s390x::MESSAGE_SECURITY_ASSIST_EXTENSION4 };
6999    ("message-security-assist-extension5") => { $crate::s390x::MESSAGE_SECURITY_ASSIST_EXTENSION5 };
7000    ("message-security-assist-extension8") => { $crate::s390x::MESSAGE_SECURITY_ASSIST_EXTENSION8 };
7001    ("message-security-assist-extension9") => { $crate::s390x::MESSAGE_SECURITY_ASSIST_EXTENSION9 };
7002    ("miscellaneous-extensions-2") => { $crate::s390x::MISCELLANEOUS_EXTENSIONS_2 };
7003    ("miscellaneous-extensions-3") => { $crate::s390x::MISCELLANEOUS_EXTENSIONS_3 };
7004    ("miscellaneous-extensions-4") => { $crate::s390x::MISCELLANEOUS_EXTENSIONS_4 };
7005    ("nnp-assist") => { $crate::s390x::NNP_ASSIST };
7006    ("transactional-execution") => { $crate::s390x::TRANSACTIONAL_EXECUTION };
7007    ("vector") => { $crate::s390x::VECTOR };
7008    ("vector-enhancements-1") => { $crate::s390x::VECTOR_ENHANCEMENTS_1 };
7009    ("vector-enhancements-2") => { $crate::s390x::VECTOR_ENHANCEMENTS_2 };
7010    ("vector-enhancements-3") => { $crate::s390x::VECTOR_ENHANCEMENTS_3 };
7011    ("vector-packed-decimal") => { $crate::s390x::VECTOR_PACKED_DECIMAL };
7012    ("vector-packed-decimal-enhancement") => { $crate::s390x::VECTOR_PACKED_DECIMAL_ENHANCEMENT };
7013    ("vector-packed-decimal-enhancement-2") => { $crate::s390x::VECTOR_PACKED_DECIMAL_ENHANCEMENT_2 };
7014    ("vector-packed-decimal-enhancement-3") => { $crate::s390x::VECTOR_PACKED_DECIMAL_ENHANCEMENT_3 };
7015    ($feature:tt) => {
7016        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
7017    };
7018}
7019#[cfg(target_arch = "sparc")]
7020#[doc(hidden)]
7021#[rustfmt::skip]
7022#[macro_export]
7023macro_rules! __target_feature {
7024    ("crt-static") => { $crate::sparc::CRT_STATIC };
7025    ("leoncasa") => { $crate::sparc::LEONCASA };
7026    ("v8plus") => { $crate::sparc::V8PLUS };
7027    ("v9") => { $crate::sparc::V9 };
7028    ($feature:tt) => {
7029        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
7030    };
7031}
7032#[cfg(target_arch = "sparc64")]
7033#[doc(hidden)]
7034#[rustfmt::skip]
7035#[macro_export]
7036macro_rules! __target_feature {
7037    ("crt-static") => { $crate::sparc64::CRT_STATIC };
7038    ("leoncasa") => { $crate::sparc64::LEONCASA };
7039    ("v8plus") => { $crate::sparc64::V8PLUS };
7040    ("v9") => { $crate::sparc64::V9 };
7041    ($feature:tt) => {
7042        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
7043    };
7044}
7045#[cfg(target_arch = "wasm32")]
7046#[doc(hidden)]
7047#[rustfmt::skip]
7048#[macro_export]
7049macro_rules! __target_feature {
7050    ("atomics") => { $crate::wasm32::ATOMICS };
7051    ("bulk-memory") => { $crate::wasm32::BULK_MEMORY };
7052    ("crt-static") => { $crate::wasm32::CRT_STATIC };
7053    ("exception-handling") => { $crate::wasm32::EXCEPTION_HANDLING };
7054    ("extended-const") => { $crate::wasm32::EXTENDED_CONST };
7055    ("gc") => { $crate::wasm32::GC };
7056    ("multivalue") => { $crate::wasm32::MULTIVALUE };
7057    ("mutable-globals") => { $crate::wasm32::MUTABLE_GLOBALS };
7058    ("nontrapping-fptoint") => { $crate::wasm32::NONTRAPPING_FPTOINT };
7059    ("reference-types") => { $crate::wasm32::REFERENCE_TYPES };
7060    ("relaxed-simd") => { $crate::wasm32::RELAXED_SIMD };
7061    ("sign-ext") => { $crate::wasm32::SIGN_EXT };
7062    ("simd128") => { $crate::wasm32::SIMD128 };
7063    ("tail-call") => { $crate::wasm32::TAIL_CALL };
7064    ("wide-arithmetic") => { $crate::wasm32::WIDE_ARITHMETIC };
7065    ($feature:tt) => {
7066        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
7067    };
7068}
7069#[cfg(target_arch = "wasm64")]
7070#[doc(hidden)]
7071#[rustfmt::skip]
7072#[macro_export]
7073macro_rules! __target_feature {
7074    ("atomics") => { $crate::wasm64::ATOMICS };
7075    ("bulk-memory") => { $crate::wasm64::BULK_MEMORY };
7076    ("crt-static") => { $crate::wasm64::CRT_STATIC };
7077    ("exception-handling") => { $crate::wasm64::EXCEPTION_HANDLING };
7078    ("extended-const") => { $crate::wasm64::EXTENDED_CONST };
7079    ("gc") => { $crate::wasm64::GC };
7080    ("multivalue") => { $crate::wasm64::MULTIVALUE };
7081    ("mutable-globals") => { $crate::wasm64::MUTABLE_GLOBALS };
7082    ("nontrapping-fptoint") => { $crate::wasm64::NONTRAPPING_FPTOINT };
7083    ("reference-types") => { $crate::wasm64::REFERENCE_TYPES };
7084    ("relaxed-simd") => { $crate::wasm64::RELAXED_SIMD };
7085    ("sign-ext") => { $crate::wasm64::SIGN_EXT };
7086    ("simd128") => { $crate::wasm64::SIMD128 };
7087    ("tail-call") => { $crate::wasm64::TAIL_CALL };
7088    ("wide-arithmetic") => { $crate::wasm64::WIDE_ARITHMETIC };
7089    ($feature:tt) => {
7090        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
7091    };
7092}
7093#[cfg(target_arch = "x86")]
7094#[doc(hidden)]
7095#[rustfmt::skip]
7096#[macro_export]
7097macro_rules! __target_feature {
7098    ("adx") => { $crate::x86::ADX };
7099    ("aes") => { $crate::x86::AES };
7100    ("amx-avx512") => { $crate::x86::AMX_AVX512 };
7101    ("amx-bf16") => { $crate::x86::AMX_BF16 };
7102    ("amx-complex") => { $crate::x86::AMX_COMPLEX };
7103    ("amx-fp16") => { $crate::x86::AMX_FP16 };
7104    ("amx-fp8") => { $crate::x86::AMX_FP8 };
7105    ("amx-int8") => { $crate::x86::AMX_INT8 };
7106    ("amx-movrs") => { $crate::x86::AMX_MOVRS };
7107    ("amx-tile") => { $crate::x86::AMX_TILE };
7108    ("apxf") => { $crate::x86::APXF };
7109    ("avx") => { $crate::x86::AVX };
7110    ("avx10.1") => { $crate::x86::AVX10_1 };
7111    ("avx10.2") => { $crate::x86::AVX10_2 };
7112    ("avx2") => { $crate::x86::AVX2 };
7113    ("avx512bf16") => { $crate::x86::AVX512BF16 };
7114    ("avx512bitalg") => { $crate::x86::AVX512BITALG };
7115    ("avx512bw") => { $crate::x86::AVX512BW };
7116    ("avx512cd") => { $crate::x86::AVX512CD };
7117    ("avx512dq") => { $crate::x86::AVX512DQ };
7118    ("avx512f") => { $crate::x86::AVX512F };
7119    ("avx512fp16") => { $crate::x86::AVX512FP16 };
7120    ("avx512ifma") => { $crate::x86::AVX512IFMA };
7121    ("avx512vbmi") => { $crate::x86::AVX512VBMI };
7122    ("avx512vbmi2") => { $crate::x86::AVX512VBMI2 };
7123    ("avx512vl") => { $crate::x86::AVX512VL };
7124    ("avx512vnni") => { $crate::x86::AVX512VNNI };
7125    ("avx512vp2intersect") => { $crate::x86::AVX512VP2INTERSECT };
7126    ("avx512vpopcntdq") => { $crate::x86::AVX512VPOPCNTDQ };
7127    ("avxifma") => { $crate::x86::AVXIFMA };
7128    ("avxneconvert") => { $crate::x86::AVXNECONVERT };
7129    ("avxvnni") => { $crate::x86::AVXVNNI };
7130    ("avxvnniint16") => { $crate::x86::AVXVNNIINT16 };
7131    ("avxvnniint8") => { $crate::x86::AVXVNNIINT8 };
7132    ("bmi1") => { $crate::x86::BMI1 };
7133    ("bmi2") => { $crate::x86::BMI2 };
7134    ("clflushopt") => { $crate::x86::CLFLUSHOPT };
7135    ("cmpxchg16b") => { $crate::x86::CMPXCHG16B };
7136    ("crt-static") => { $crate::x86::CRT_STATIC };
7137    ("ermsb") => { $crate::x86::ERMSB };
7138    ("f16c") => { $crate::x86::F16C };
7139    ("fma") => { $crate::x86::FMA };
7140    ("fma4") => { $crate::x86::FMA4 };
7141    ("fxsr") => { $crate::x86::FXSR };
7142    ("gfni") => { $crate::x86::GFNI };
7143    ("kl") => { $crate::x86::KL };
7144    ("lahfsahf") => { $crate::x86::LAHFSAHF };
7145    ("lzcnt") => { $crate::x86::LZCNT };
7146    ("movbe") => { $crate::x86::MOVBE };
7147    ("movrs") => { $crate::x86::MOVRS };
7148    ("pclmulqdq") => { $crate::x86::PCLMULQDQ };
7149    ("popcnt") => { $crate::x86::POPCNT };
7150    ("prfchw") => { $crate::x86::PRFCHW };
7151    ("rdrand") => { $crate::x86::RDRAND };
7152    ("rdseed") => { $crate::x86::RDSEED };
7153    ("rtm") => { $crate::x86::RTM };
7154    ("sha") => { $crate::x86::SHA };
7155    ("sha512") => { $crate::x86::SHA512 };
7156    ("sm3") => { $crate::x86::SM3 };
7157    ("sm4") => { $crate::x86::SM4 };
7158    ("sse") => { $crate::x86::SSE };
7159    ("sse2") => { $crate::x86::SSE2 };
7160    ("sse3") => { $crate::x86::SSE3 };
7161    ("sse4.1") => { $crate::x86::SSE4_1 };
7162    ("sse4.2") => { $crate::x86::SSE4_2 };
7163    ("sse4a") => { $crate::x86::SSE4A };
7164    ("ssse3") => { $crate::x86::SSSE3 };
7165    ("tbm") => { $crate::x86::TBM };
7166    ("vaes") => { $crate::x86::VAES };
7167    ("vpclmulqdq") => { $crate::x86::VPCLMULQDQ };
7168    ("widekl") => { $crate::x86::WIDEKL };
7169    ("x87") => { $crate::x86::X87 };
7170    ("xop") => { $crate::x86::XOP };
7171    ("xsave") => { $crate::x86::XSAVE };
7172    ("xsavec") => { $crate::x86::XSAVEC };
7173    ("xsaveopt") => { $crate::x86::XSAVEOPT };
7174    ("xsaves") => { $crate::x86::XSAVES };
7175    ($feature:tt) => {
7176        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
7177    };
7178}
7179#[cfg(target_arch = "x86_64")]
7180#[doc(hidden)]
7181#[rustfmt::skip]
7182#[macro_export]
7183macro_rules! __target_feature {
7184    ("adx") => { $crate::x86_64::ADX };
7185    ("aes") => { $crate::x86_64::AES };
7186    ("amx-avx512") => { $crate::x86_64::AMX_AVX512 };
7187    ("amx-bf16") => { $crate::x86_64::AMX_BF16 };
7188    ("amx-complex") => { $crate::x86_64::AMX_COMPLEX };
7189    ("amx-fp16") => { $crate::x86_64::AMX_FP16 };
7190    ("amx-fp8") => { $crate::x86_64::AMX_FP8 };
7191    ("amx-int8") => { $crate::x86_64::AMX_INT8 };
7192    ("amx-movrs") => { $crate::x86_64::AMX_MOVRS };
7193    ("amx-tile") => { $crate::x86_64::AMX_TILE };
7194    ("apxf") => { $crate::x86_64::APXF };
7195    ("avx") => { $crate::x86_64::AVX };
7196    ("avx10.1") => { $crate::x86_64::AVX10_1 };
7197    ("avx10.2") => { $crate::x86_64::AVX10_2 };
7198    ("avx2") => { $crate::x86_64::AVX2 };
7199    ("avx512bf16") => { $crate::x86_64::AVX512BF16 };
7200    ("avx512bitalg") => { $crate::x86_64::AVX512BITALG };
7201    ("avx512bw") => { $crate::x86_64::AVX512BW };
7202    ("avx512cd") => { $crate::x86_64::AVX512CD };
7203    ("avx512dq") => { $crate::x86_64::AVX512DQ };
7204    ("avx512f") => { $crate::x86_64::AVX512F };
7205    ("avx512fp16") => { $crate::x86_64::AVX512FP16 };
7206    ("avx512ifma") => { $crate::x86_64::AVX512IFMA };
7207    ("avx512vbmi") => { $crate::x86_64::AVX512VBMI };
7208    ("avx512vbmi2") => { $crate::x86_64::AVX512VBMI2 };
7209    ("avx512vl") => { $crate::x86_64::AVX512VL };
7210    ("avx512vnni") => { $crate::x86_64::AVX512VNNI };
7211    ("avx512vp2intersect") => { $crate::x86_64::AVX512VP2INTERSECT };
7212    ("avx512vpopcntdq") => { $crate::x86_64::AVX512VPOPCNTDQ };
7213    ("avxifma") => { $crate::x86_64::AVXIFMA };
7214    ("avxneconvert") => { $crate::x86_64::AVXNECONVERT };
7215    ("avxvnni") => { $crate::x86_64::AVXVNNI };
7216    ("avxvnniint16") => { $crate::x86_64::AVXVNNIINT16 };
7217    ("avxvnniint8") => { $crate::x86_64::AVXVNNIINT8 };
7218    ("bmi1") => { $crate::x86_64::BMI1 };
7219    ("bmi2") => { $crate::x86_64::BMI2 };
7220    ("clflushopt") => { $crate::x86_64::CLFLUSHOPT };
7221    ("cmpxchg16b") => { $crate::x86_64::CMPXCHG16B };
7222    ("crt-static") => { $crate::x86_64::CRT_STATIC };
7223    ("ermsb") => { $crate::x86_64::ERMSB };
7224    ("f16c") => { $crate::x86_64::F16C };
7225    ("fma") => { $crate::x86_64::FMA };
7226    ("fma4") => { $crate::x86_64::FMA4 };
7227    ("fxsr") => { $crate::x86_64::FXSR };
7228    ("gfni") => { $crate::x86_64::GFNI };
7229    ("kl") => { $crate::x86_64::KL };
7230    ("lahfsahf") => { $crate::x86_64::LAHFSAHF };
7231    ("lzcnt") => { $crate::x86_64::LZCNT };
7232    ("movbe") => { $crate::x86_64::MOVBE };
7233    ("movrs") => { $crate::x86_64::MOVRS };
7234    ("pclmulqdq") => { $crate::x86_64::PCLMULQDQ };
7235    ("popcnt") => { $crate::x86_64::POPCNT };
7236    ("prfchw") => { $crate::x86_64::PRFCHW };
7237    ("rdrand") => { $crate::x86_64::RDRAND };
7238    ("rdseed") => { $crate::x86_64::RDSEED };
7239    ("rtm") => { $crate::x86_64::RTM };
7240    ("sha") => { $crate::x86_64::SHA };
7241    ("sha512") => { $crate::x86_64::SHA512 };
7242    ("sm3") => { $crate::x86_64::SM3 };
7243    ("sm4") => { $crate::x86_64::SM4 };
7244    ("sse") => { $crate::x86_64::SSE };
7245    ("sse2") => { $crate::x86_64::SSE2 };
7246    ("sse3") => { $crate::x86_64::SSE3 };
7247    ("sse4.1") => { $crate::x86_64::SSE4_1 };
7248    ("sse4.2") => { $crate::x86_64::SSE4_2 };
7249    ("sse4a") => { $crate::x86_64::SSE4A };
7250    ("ssse3") => { $crate::x86_64::SSSE3 };
7251    ("tbm") => { $crate::x86_64::TBM };
7252    ("vaes") => { $crate::x86_64::VAES };
7253    ("vpclmulqdq") => { $crate::x86_64::VPCLMULQDQ };
7254    ("widekl") => { $crate::x86_64::WIDEKL };
7255    ("x87") => { $crate::x86_64::X87 };
7256    ("xop") => { $crate::x86_64::XOP };
7257    ("xsave") => { $crate::x86_64::XSAVE };
7258    ("xsavec") => { $crate::x86_64::XSAVEC };
7259    ("xsaveopt") => { $crate::x86_64::XSAVEOPT };
7260    ("xsaves") => { $crate::x86_64::XSAVES };
7261    ($feature:tt) => {
7262        compile_error!(concat!("unknown target feature: ", stringify!($feature)))
7263    };
7264}
7265
7266#[cfg(not(any(
7267    target_arch = "arm",
7268    target_arch = "aarch64",
7269    target_arch = "arm64ec",
7270    target_arch = "bpf",
7271    target_arch = "hexagon",
7272    target_arch = "mips",
7273    target_arch = "mips64",
7274    target_arch = "loongarch32",
7275    target_arch = "loongarch64",
7276    target_arch = "nvptx64",
7277    target_arch = "powerpc",
7278    target_arch = "powerpc64",
7279    target_arch = "riscv32",
7280    target_arch = "riscv64",
7281    target_arch = "s390x",
7282    target_arch = "sparc",
7283    target_arch = "sparc64",
7284    target_arch = "wasm32",
7285    target_arch = "wasm64",
7286    target_arch = "x86",
7287    target_arch = "x86_64",
7288)))]
7289#[doc(hidden)]
7290#[macro_export]
7291macro_rules! __target_feature {
7292    ($feature:tt) => {
7293        compile_error!(concat!(
7294            "target features are unavailable for this architecture: ",
7295            stringify!($feature)
7296        ))
7297    };
7298}
7299
7300/// Constructs a [`TargetFeatures`] value from target feature names.
7301///
7302/// Each name identifies a target feature.
7303/// Multiple names are combined using [`TargetFeatures::with`].
7304///
7305/// ```
7306/// # #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
7307/// const REQUIRED: target_features::TargetFeatures =
7308///     target_features::target_features!("avx", "fma", "bmi2");
7309/// ```
7310#[macro_export]
7311macro_rules! target_features {
7312    ($($feature:tt),* $(,)?) => { {
7313        let features = $crate::TargetFeatures::empty();
7314        $(let features = features.with($crate::__target_feature!($feature));)*
7315        features
7316    } };
7317}
7318
7319#[allow(unused_variables)]
7320pub(crate) const fn enabled_for_target() -> TargetFeatures {
7321    let features = TargetFeatures::empty();
7322    #[cfg(target_arch = "arm")]
7323    let features = arm::enabled_for_target();
7324    #[cfg(target_arch = "aarch64")]
7325    let features = aarch64::enabled_for_target();
7326    #[cfg(target_arch = "arm64ec")]
7327    let features = arm64ec::enabled_for_target();
7328    #[cfg(target_arch = "bpf")]
7329    let features = bpf::enabled_for_target();
7330    #[cfg(target_arch = "hexagon")]
7331    let features = hexagon::enabled_for_target();
7332    #[cfg(target_arch = "mips")]
7333    let features = mips::enabled_for_target();
7334    #[cfg(target_arch = "mips64")]
7335    let features = mips64::enabled_for_target();
7336    #[cfg(target_arch = "loongarch32")]
7337    let features = loongarch32::enabled_for_target();
7338    #[cfg(target_arch = "loongarch64")]
7339    let features = loongarch64::enabled_for_target();
7340    #[cfg(target_arch = "nvptx64")]
7341    let features = nvptx64::enabled_for_target();
7342    #[cfg(target_arch = "powerpc")]
7343    let features = powerpc::enabled_for_target();
7344    #[cfg(target_arch = "powerpc64")]
7345    let features = powerpc64::enabled_for_target();
7346    #[cfg(target_arch = "riscv32")]
7347    let features = riscv32::enabled_for_target();
7348    #[cfg(target_arch = "riscv64")]
7349    let features = riscv64::enabled_for_target();
7350    #[cfg(target_arch = "s390x")]
7351    let features = s390x::enabled_for_target();
7352    #[cfg(target_arch = "sparc")]
7353    let features = sparc::enabled_for_target();
7354    #[cfg(target_arch = "sparc64")]
7355    let features = sparc64::enabled_for_target();
7356    #[cfg(target_arch = "wasm32")]
7357    let features = wasm32::enabled_for_target();
7358    #[cfg(target_arch = "wasm64")]
7359    let features = wasm64::enabled_for_target();
7360    #[cfg(target_arch = "x86")]
7361    let features = x86::enabled_for_target();
7362    #[cfg(target_arch = "x86_64")]
7363    let features = x86_64::enabled_for_target();
7364    features
7365}
7366
7367#[allow(unused_variables)]
7368pub(crate) fn features() -> &'static [FeatureData] {
7369    let features: &'static [FeatureData] = &[];
7370    #[cfg(target_arch = "arm")]
7371    let features = arm::FEATURES;
7372    #[cfg(target_arch = "aarch64")]
7373    let features = aarch64::FEATURES;
7374    #[cfg(target_arch = "arm64ec")]
7375    let features = arm64ec::FEATURES;
7376    #[cfg(target_arch = "bpf")]
7377    let features = bpf::FEATURES;
7378    #[cfg(target_arch = "hexagon")]
7379    let features = hexagon::FEATURES;
7380    #[cfg(target_arch = "mips")]
7381    let features = mips::FEATURES;
7382    #[cfg(target_arch = "mips64")]
7383    let features = mips64::FEATURES;
7384    #[cfg(target_arch = "loongarch32")]
7385    let features = loongarch32::FEATURES;
7386    #[cfg(target_arch = "loongarch64")]
7387    let features = loongarch64::FEATURES;
7388    #[cfg(target_arch = "nvptx64")]
7389    let features = nvptx64::FEATURES;
7390    #[cfg(target_arch = "powerpc")]
7391    let features = powerpc::FEATURES;
7392    #[cfg(target_arch = "powerpc64")]
7393    let features = powerpc64::FEATURES;
7394    #[cfg(target_arch = "riscv32")]
7395    let features = riscv32::FEATURES;
7396    #[cfg(target_arch = "riscv64")]
7397    let features = riscv64::FEATURES;
7398    #[cfg(target_arch = "s390x")]
7399    let features = s390x::FEATURES;
7400    #[cfg(target_arch = "sparc")]
7401    let features = sparc::FEATURES;
7402    #[cfg(target_arch = "sparc64")]
7403    let features = sparc64::FEATURES;
7404    #[cfg(target_arch = "wasm32")]
7405    let features = wasm32::FEATURES;
7406    #[cfg(target_arch = "wasm64")]
7407    let features = wasm64::FEATURES;
7408    #[cfg(target_arch = "x86")]
7409    let features = x86::FEATURES;
7410    #[cfg(target_arch = "x86_64")]
7411    let features = x86_64::FEATURES;
7412    features
7413}