Skip to main content

rustc_target/asm/
mod.rs

1use std::borrow::Cow;
2use std::fmt;
3
4use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
5use rustc_macros::{Decodable, Encodable, StableHash};
6use rustc_span::Symbol;
7
8use crate::spec::{Arch, RelocModel, Target};
9
10pub struct ModifierInfo {
11    pub modifier: char,
12    pub result: &'static str,
13    pub size: InlineAsmSize,
14}
15
16impl From<(char, &'static str, InlineAsmSize)> for ModifierInfo {
17    fn from((modifier, result, size): (char, &'static str, InlineAsmSize)) -> Self {
18        Self { modifier, result, size }
19    }
20}
21
22macro_rules! def_reg_class {
23    ($arch:ident $arch_regclass:ident {
24        $(
25            $class:ident,
26        )*
27    }) => {
28        #[derive(Copy, Clone, rustc_macros::Encodable, rustc_macros::Decodable, Debug, Eq, PartialEq, PartialOrd, Hash, rustc_macros::StableHash)]
29        #[allow(non_camel_case_types)]
30        pub enum $arch_regclass {
31            $($class,)*
32        }
33
34        impl $arch_regclass {
35            pub fn name(self) -> rustc_span::Symbol {
36                match self {
37                    $(Self::$class => rustc_span::sym::$class,)*
38                }
39            }
40
41            pub fn parse(name: rustc_span::Symbol) -> Result<Self, &'static [rustc_span::Symbol]> {
42                match name {
43                    $(
44                        rustc_span::sym::$class => Ok(Self::$class),
45                    )*
46                    _ => Err(&[$(rustc_span::sym::$class),*]),
47                }
48            }
49        }
50
51        pub(super) fn regclass_map() -> rustc_data_structures::fx::FxHashMap<
52            super::InlineAsmRegClass,
53            rustc_data_structures::fx::FxIndexSet<super::InlineAsmReg>,
54        > {
55            use rustc_data_structures::fx::FxHashMap;
56            use rustc_data_structures::fx::FxIndexSet;
57            use super::InlineAsmRegClass;
58            let mut map = FxHashMap::default();
59            $(
60                map.insert(InlineAsmRegClass::$arch($arch_regclass::$class), FxIndexSet::default());
61            )*
62            map
63        }
64    }
65}
66
67macro_rules! def_regs {
68    ($arch:ident $arch_reg:ident $arch_regclass:ident {
69        $(
70            $reg:ident: $class:ident $(, $extra_class:ident)* = [$reg_name:literal $(, $alias:literal)*] $(% $filter:ident)*,
71        )*
72        $(
73            #error = [$($bad_reg:literal),+] => $error:literal,
74        )*
75    }) => {
76        #[allow(unreachable_code)]
77        #[derive(Copy, Clone, rustc_macros::Encodable, rustc_macros::Decodable, Debug, Eq, PartialEq, PartialOrd, Hash, rustc_macros::StableHash)]
78        #[allow(non_camel_case_types)]
79        pub enum $arch_reg {
80            $($reg,)*
81        }
82
83        impl $arch_reg {
84            pub fn name(self) -> &'static str {
85                match self {
86                    $(Self::$reg => $reg_name,)*
87                }
88            }
89
90            pub fn reg_class(self) -> $arch_regclass {
91                match self {
92                    $(Self::$reg => $arch_regclass::$class,)*
93                }
94            }
95
96            pub fn parse(name: &str) -> Result<Self, &'static str> {
97                match name {
98                    $(
99                        $($alias)|* | $reg_name => Ok(Self::$reg),
100                    )*
101                    $(
102                        $($bad_reg)|* => Err($error),
103                    )*
104                    _ => Err("unknown register"),
105                }
106            }
107
108            pub fn validate(self,
109                _arch: super::InlineAsmArch,
110                _reloc_model: crate::spec::RelocModel,
111                _target_features: &rustc_data_structures::fx::FxIndexSet<Symbol>,
112                _target: &crate::spec::Target,
113                _is_clobber: bool,
114            ) -> Result<(), &'static str> {
115                match self {
116                    $(
117                        Self::$reg => {
118                            $($filter(
119                                _arch,
120                                _reloc_model,
121                                _target_features,
122                                _target,
123                                _is_clobber
124                            )?;)*
125                            Ok(())
126                        }
127                    )*
128                }
129            }
130        }
131
132        pub(super) fn fill_reg_map(
133            _arch: super::InlineAsmArch,
134            _reloc_model: crate::spec::RelocModel,
135            _target_features: &rustc_data_structures::fx::FxIndexSet<Symbol>,
136            _target: &crate::spec::Target,
137            _map: &mut rustc_data_structures::fx::FxHashMap<
138                super::InlineAsmRegClass,
139                rustc_data_structures::fx::FxIndexSet<super::InlineAsmReg>,
140            >,
141        ) {
142            #[allow(unused_imports)]
143            use super::{InlineAsmReg, InlineAsmRegClass};
144            $(
145                if $($filter(_arch, _reloc_model, _target_features, _target, false).is_ok() &&)* true {
146                    if let Some(set) = _map.get_mut(&InlineAsmRegClass::$arch($arch_regclass::$class)) {
147                        set.insert(InlineAsmReg::$arch($arch_reg::$reg));
148                    }
149                    $(
150                        if let Some(set) = _map.get_mut(&InlineAsmRegClass::$arch($arch_regclass::$extra_class)) {
151                            set.insert(InlineAsmReg::$arch($arch_reg::$reg));
152                        }
153                    )*
154                }
155            )*
156        }
157    }
158}
159
160macro_rules! types {
161    (
162        $(_ : $($ty:expr),+;)?
163        $($feature:ident: $($ty2:expr),+;)*
164    ) => {
165        {
166            use super::InlineAsmType::*;
167            &[
168                $($(
169                    ($ty, None),
170                )*)?
171                $($(
172                    ($ty2, Some(rustc_span::sym::$feature)),
173                )*)*
174            ]
175        }
176    };
177}
178
179mod aarch64;
180mod amdgpu;
181mod arm;
182mod avr;
183mod bpf;
184mod csky;
185mod hexagon;
186mod loongarch;
187mod m68k;
188mod mips;
189mod msp430;
190mod nvptx;
191mod powerpc;
192mod riscv;
193mod s390x;
194mod sparc;
195mod spirv;
196mod wasm;
197mod x86;
198mod xtensa;
199
200pub use aarch64::{AArch64InlineAsmReg, AArch64InlineAsmRegClass};
201pub use amdgpu::{AmdgpuInlineAsmReg, AmdgpuInlineAsmRegClass};
202pub use arm::{ArmInlineAsmReg, ArmInlineAsmRegClass};
203pub use avr::{AvrInlineAsmReg, AvrInlineAsmRegClass};
204pub use bpf::{BpfInlineAsmReg, BpfInlineAsmRegClass};
205pub use csky::{CSKYInlineAsmReg, CSKYInlineAsmRegClass};
206pub use hexagon::{HexagonInlineAsmReg, HexagonInlineAsmRegClass};
207pub use loongarch::{LoongArchInlineAsmReg, LoongArchInlineAsmRegClass};
208pub use m68k::{M68kInlineAsmReg, M68kInlineAsmRegClass};
209pub use mips::{MipsInlineAsmReg, MipsInlineAsmRegClass};
210pub use msp430::{Msp430InlineAsmReg, Msp430InlineAsmRegClass};
211pub use nvptx::{NvptxInlineAsmReg, NvptxInlineAsmRegClass};
212pub use powerpc::{PowerPCInlineAsmReg, PowerPCInlineAsmRegClass};
213pub use riscv::{RiscVInlineAsmReg, RiscVInlineAsmRegClass};
214pub use s390x::{S390xInlineAsmReg, S390xInlineAsmRegClass};
215pub use sparc::{SparcInlineAsmReg, SparcInlineAsmRegClass};
216pub use spirv::{SpirVInlineAsmReg, SpirVInlineAsmRegClass};
217pub use wasm::{WasmInlineAsmReg, WasmInlineAsmRegClass};
218pub use x86::{X86InlineAsmReg, X86InlineAsmRegClass};
219pub use xtensa::{XtensaInlineAsmReg, XtensaInlineAsmRegClass};
220
221#[derive(#[automatically_derived]
impl ::core::marker::Copy for InlineAsmArch { }Copy, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for InlineAsmArch { }
#[automatically_derived]
impl ::core::clone::Clone for InlineAsmArch {
    #[inline]
    fn clone(&self) -> Self { *self }
}Clone, const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for InlineAsmArch {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        InlineAsmArch::X86 => { 0usize }
                        InlineAsmArch::X86_64 => { 1usize }
                        InlineAsmArch::Arm => { 2usize }
                        InlineAsmArch::AArch64 => { 3usize }
                        InlineAsmArch::Arm64EC => { 4usize }
                        InlineAsmArch::RiscV32 => { 5usize }
                        InlineAsmArch::RiscV64 => { 6usize }
                        InlineAsmArch::Nvptx64 => { 7usize }
                        InlineAsmArch::Amdgpu => { 8usize }
                        InlineAsmArch::Hexagon => { 9usize }
                        InlineAsmArch::LoongArch32 => { 10usize }
                        InlineAsmArch::LoongArch64 => { 11usize }
                        InlineAsmArch::Mips => { 12usize }
                        InlineAsmArch::Mips64 => { 13usize }
                        InlineAsmArch::PowerPC => { 14usize }
                        InlineAsmArch::PowerPC64 => { 15usize }
                        InlineAsmArch::S390x => { 16usize }
                        InlineAsmArch::Sparc => { 17usize }
                        InlineAsmArch::Sparc64 => { 18usize }
                        InlineAsmArch::SpirV => { 19usize }
                        InlineAsmArch::Wasm32 => { 20usize }
                        InlineAsmArch::Wasm64 => { 21usize }
                        InlineAsmArch::Xtensa => { 22usize }
                        InlineAsmArch::Bpf => { 23usize }
                        InlineAsmArch::Avr => { 24usize }
                        InlineAsmArch::Msp430 => { 25usize }
                        InlineAsmArch::M68k => { 26usize }
                        InlineAsmArch::CSKY => { 27usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
            }
        }
    };Encodable, const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for InlineAsmArch {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { InlineAsmArch::X86 }
                    1usize => { InlineAsmArch::X86_64 }
                    2usize => { InlineAsmArch::Arm }
                    3usize => { InlineAsmArch::AArch64 }
                    4usize => { InlineAsmArch::Arm64EC }
                    5usize => { InlineAsmArch::RiscV32 }
                    6usize => { InlineAsmArch::RiscV64 }
                    7usize => { InlineAsmArch::Nvptx64 }
                    8usize => { InlineAsmArch::Amdgpu }
                    9usize => { InlineAsmArch::Hexagon }
                    10usize => { InlineAsmArch::LoongArch32 }
                    11usize => { InlineAsmArch::LoongArch64 }
                    12usize => { InlineAsmArch::Mips }
                    13usize => { InlineAsmArch::Mips64 }
                    14usize => { InlineAsmArch::PowerPC }
                    15usize => { InlineAsmArch::PowerPC64 }
                    16usize => { InlineAsmArch::S390x }
                    17usize => { InlineAsmArch::Sparc }
                    18usize => { InlineAsmArch::Sparc64 }
                    19usize => { InlineAsmArch::SpirV }
                    20usize => { InlineAsmArch::Wasm32 }
                    21usize => { InlineAsmArch::Wasm64 }
                    22usize => { InlineAsmArch::Xtensa }
                    23usize => { InlineAsmArch::Bpf }
                    24usize => { InlineAsmArch::Avr }
                    25usize => { InlineAsmArch::Msp430 }
                    26usize => { InlineAsmArch::M68k }
                    27usize => { InlineAsmArch::CSKY }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `InlineAsmArch`, expected 0..28, actual {0}",
                                n));
                    }
                }
            }
        }
    };Decodable, #[automatically_derived]
impl ::core::fmt::Debug for InlineAsmArch {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                InlineAsmArch::X86 => "X86",
                InlineAsmArch::X86_64 => "X86_64",
                InlineAsmArch::Arm => "Arm",
                InlineAsmArch::AArch64 => "AArch64",
                InlineAsmArch::Arm64EC => "Arm64EC",
                InlineAsmArch::RiscV32 => "RiscV32",
                InlineAsmArch::RiscV64 => "RiscV64",
                InlineAsmArch::Nvptx64 => "Nvptx64",
                InlineAsmArch::Amdgpu => "Amdgpu",
                InlineAsmArch::Hexagon => "Hexagon",
                InlineAsmArch::LoongArch32 => "LoongArch32",
                InlineAsmArch::LoongArch64 => "LoongArch64",
                InlineAsmArch::Mips => "Mips",
                InlineAsmArch::Mips64 => "Mips64",
                InlineAsmArch::PowerPC => "PowerPC",
                InlineAsmArch::PowerPC64 => "PowerPC64",
                InlineAsmArch::S390x => "S390x",
                InlineAsmArch::Sparc => "Sparc",
                InlineAsmArch::Sparc64 => "Sparc64",
                InlineAsmArch::SpirV => "SpirV",
                InlineAsmArch::Wasm32 => "Wasm32",
                InlineAsmArch::Wasm64 => "Wasm64",
                InlineAsmArch::Xtensa => "Xtensa",
                InlineAsmArch::Bpf => "Bpf",
                InlineAsmArch::Avr => "Avr",
                InlineAsmArch::Msp430 => "Msp430",
                InlineAsmArch::M68k => "M68k",
                InlineAsmArch::CSKY => "CSKY",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for InlineAsmArch { }Eq, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for InlineAsmArch { }
#[automatically_derived]
impl ::core::cmp::PartialEq for InlineAsmArch {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for InlineAsmArch {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state)
    }
}Hash)]
222pub enum InlineAsmArch {
223    X86,
224    X86_64,
225    Arm,
226    AArch64,
227    Arm64EC,
228    RiscV32,
229    RiscV64,
230    Nvptx64,
231    Amdgpu,
232    Hexagon,
233    LoongArch32,
234    LoongArch64,
235    Mips,
236    Mips64,
237    PowerPC,
238    PowerPC64,
239    S390x,
240    Sparc,
241    Sparc64,
242    SpirV,
243    Wasm32,
244    Wasm64,
245    Xtensa,
246    Bpf,
247    Avr,
248    Msp430,
249    M68k,
250    CSKY,
251}
252
253impl InlineAsmArch {
254    pub fn from_arch(arch: &Arch) -> Option<Self> {
255        match arch {
256            Arch::X86 => Some(Self::X86),
257            Arch::X86_64 => Some(Self::X86_64),
258            Arch::Arm => Some(Self::Arm),
259            Arch::Arm64EC => Some(Self::Arm64EC),
260            Arch::AArch64 => Some(Self::AArch64),
261            Arch::AmdGpu => Some(Self::Amdgpu),
262            Arch::RiscV32 => Some(Self::RiscV32),
263            Arch::RiscV64 => Some(Self::RiscV64),
264            Arch::Nvptx64 => Some(Self::Nvptx64),
265            Arch::Hexagon => Some(Self::Hexagon),
266            Arch::LoongArch32 => Some(Self::LoongArch32),
267            Arch::LoongArch64 => Some(Self::LoongArch64),
268            Arch::Mips | Arch::Mips32r6 => Some(Self::Mips),
269            Arch::Mips64 | Arch::Mips64r6 => Some(Self::Mips64),
270            Arch::PowerPC => Some(Self::PowerPC),
271            Arch::PowerPC64 => Some(Self::PowerPC64),
272            Arch::S390x => Some(Self::S390x),
273            Arch::Sparc => Some(Self::Sparc),
274            Arch::Sparc64 => Some(Self::Sparc64),
275            Arch::SpirV => Some(Self::SpirV),
276            Arch::Wasm32 => Some(Self::Wasm32),
277            Arch::Wasm64 => Some(Self::Wasm64),
278            Arch::Bpf => Some(Self::Bpf),
279            Arch::Avr => Some(Self::Avr),
280            Arch::Msp430 => Some(Self::Msp430),
281            Arch::M68k => Some(Self::M68k),
282            Arch::CSky => Some(Self::CSKY),
283            Arch::Xtensa => Some(Self::Xtensa),
284            Arch::Other(_) => None,
285        }
286    }
287}
288
289#[derive(#[automatically_derived]
impl ::core::marker::Copy for InlineAsmReg { }Copy, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for InlineAsmReg { }
#[automatically_derived]
impl ::core::clone::Clone for InlineAsmReg {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<X86InlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<ArmInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<AmdgpuInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<AArch64InlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<RiscVInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<NvptxInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<PowerPCInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<HexagonInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<LoongArchInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<MipsInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<S390xInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<SparcInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<SpirVInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<WasmInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<XtensaInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<BpfInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<AvrInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<Msp430InlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<M68kInlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<CSKYInlineAsmReg>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for InlineAsmReg {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::X86(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "X86",
                    &__self_0),
            Self::Arm(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Arm",
                    &__self_0),
            Self::Amdgpu(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Amdgpu",
                    &__self_0),
            Self::AArch64(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "AArch64", &__self_0),
            Self::RiscV(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "RiscV",
                    &__self_0),
            Self::Nvptx(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Nvptx",
                    &__self_0),
            Self::PowerPC(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "PowerPC", &__self_0),
            Self::Hexagon(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Hexagon", &__self_0),
            Self::LoongArch(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "LoongArch", &__self_0),
            Self::Mips(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Mips",
                    &__self_0),
            Self::S390x(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "S390x",
                    &__self_0),
            Self::Sparc(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Sparc",
                    &__self_0),
            Self::SpirV(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "SpirV",
                    &__self_0),
            Self::Wasm(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm",
                    &__self_0),
            Self::Xtensa(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Xtensa",
                    &__self_0),
            Self::Bpf(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Bpf",
                    &__self_0),
            Self::Avr(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Avr",
                    &__self_0),
            Self::Msp430(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Msp430",
                    &__self_0),
            Self::M68k(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "M68k",
                    &__self_0),
            Self::CSKY(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "CSKY",
                    &__self_0),
            Self::Err => ::core::fmt::Formatter::write_str(f, "Err"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for InlineAsmReg {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<X86InlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<ArmInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<AmdgpuInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<AArch64InlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<RiscVInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<NvptxInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<PowerPCInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<HexagonInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<LoongArchInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<MipsInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<S390xInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<SparcInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<SpirVInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<WasmInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<XtensaInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<BpfInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<AvrInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<Msp430InlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<M68kInlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<CSKYInlineAsmReg>;
    }
}Eq, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for InlineAsmReg { }
#[automatically_derived]
impl ::core::cmp::PartialEq for InlineAsmReg {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::X86(__self_0), Self::X86(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Arm(__self_0), Self::Arm(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Amdgpu(__self_0), Self::Amdgpu(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::AArch64(__self_0), Self::AArch64(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::RiscV(__self_0), Self::RiscV(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Nvptx(__self_0), Self::Nvptx(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::PowerPC(__self_0), Self::PowerPC(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Hexagon(__self_0), Self::Hexagon(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::LoongArch(__self_0), Self::LoongArch(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Mips(__self_0), Self::Mips(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::S390x(__self_0), Self::S390x(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Sparc(__self_0), Self::Sparc(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::SpirV(__self_0), Self::SpirV(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Wasm(__self_0), Self::Wasm(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Xtensa(__self_0), Self::Xtensa(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Bpf(__self_0), Self::Bpf(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Avr(__self_0), Self::Avr(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Msp430(__self_0), Self::Msp430(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::M68k(__self_0), Self::M68k(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::CSKY(__self_0), Self::CSKY(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for InlineAsmReg {
    #[inline]
    fn partial_cmp(&self, other: &Self)
        -> ::core::option::Option<::core::cmp::Ordering> {
        match (self, other) {
            (Self::X86(__self_0), Self::X86(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Arm(__self_0), Self::Arm(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Amdgpu(__self_0), Self::Amdgpu(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::AArch64(__self_0), Self::AArch64(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::RiscV(__self_0), Self::RiscV(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Nvptx(__self_0), Self::Nvptx(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::PowerPC(__self_0), Self::PowerPC(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Hexagon(__self_0), Self::Hexagon(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::LoongArch(__self_0), Self::LoongArch(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Mips(__self_0), Self::Mips(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::S390x(__self_0), Self::S390x(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Sparc(__self_0), Self::Sparc(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::SpirV(__self_0), Self::SpirV(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Wasm(__self_0), Self::Wasm(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Xtensa(__self_0), Self::Xtensa(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Bpf(__self_0), Self::Bpf(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Avr(__self_0), Self::Avr(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Msp430(__self_0), Self::Msp430(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::M68k(__self_0), Self::M68k(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::CSKY(__self_0), Self::CSKY(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            _ =>
                ::core::cmp::PartialOrd::partial_cmp(&::core::intrinsics::discriminant_value(self),
                    &::core::intrinsics::discriminant_value(other)),
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::hash::Hash for InlineAsmReg {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::X86(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Arm(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Amdgpu(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::AArch64(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::RiscV(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Nvptx(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::PowerPC(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Hexagon(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::LoongArch(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Mips(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::S390x(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Sparc(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::SpirV(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Wasm(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Xtensa(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Bpf(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Avr(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Msp430(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::M68k(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::CSKY(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash)]
290#[derive(const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for InlineAsmReg
            {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                ::std::mem::discriminant(self).stable_hash(__hcx, __hasher);
                match *self {
                    InlineAsmReg::X86(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Arm(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Amdgpu(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::AArch64(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::RiscV(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Nvptx(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::PowerPC(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Hexagon(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::LoongArch(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Mips(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::S390x(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Sparc(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::SpirV(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Wasm(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Xtensa(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Bpf(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Avr(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Msp430(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::M68k(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::CSKY(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmReg::Err => {}
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for InlineAsmReg {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        InlineAsmReg::X86(ref __binding_0) => { 0usize }
                        InlineAsmReg::Arm(ref __binding_0) => { 1usize }
                        InlineAsmReg::Amdgpu(ref __binding_0) => { 2usize }
                        InlineAsmReg::AArch64(ref __binding_0) => { 3usize }
                        InlineAsmReg::RiscV(ref __binding_0) => { 4usize }
                        InlineAsmReg::Nvptx(ref __binding_0) => { 5usize }
                        InlineAsmReg::PowerPC(ref __binding_0) => { 6usize }
                        InlineAsmReg::Hexagon(ref __binding_0) => { 7usize }
                        InlineAsmReg::LoongArch(ref __binding_0) => { 8usize }
                        InlineAsmReg::Mips(ref __binding_0) => { 9usize }
                        InlineAsmReg::S390x(ref __binding_0) => { 10usize }
                        InlineAsmReg::Sparc(ref __binding_0) => { 11usize }
                        InlineAsmReg::SpirV(ref __binding_0) => { 12usize }
                        InlineAsmReg::Wasm(ref __binding_0) => { 13usize }
                        InlineAsmReg::Xtensa(ref __binding_0) => { 14usize }
                        InlineAsmReg::Bpf(ref __binding_0) => { 15usize }
                        InlineAsmReg::Avr(ref __binding_0) => { 16usize }
                        InlineAsmReg::Msp430(ref __binding_0) => { 17usize }
                        InlineAsmReg::M68k(ref __binding_0) => { 18usize }
                        InlineAsmReg::CSKY(ref __binding_0) => { 19usize }
                        InlineAsmReg::Err => { 20usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    InlineAsmReg::X86(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Arm(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Amdgpu(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::AArch64(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::RiscV(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Nvptx(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::PowerPC(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Hexagon(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::LoongArch(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Mips(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::S390x(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Sparc(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::SpirV(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Wasm(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Xtensa(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Bpf(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Avr(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Msp430(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::M68k(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::CSKY(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmReg::Err => {}
                }
            }
        }
    };Encodable, const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for InlineAsmReg {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => {
                        InlineAsmReg::X86(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    1usize => {
                        InlineAsmReg::Arm(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    2usize => {
                        InlineAsmReg::Amdgpu(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    3usize => {
                        InlineAsmReg::AArch64(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    4usize => {
                        InlineAsmReg::RiscV(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    5usize => {
                        InlineAsmReg::Nvptx(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    6usize => {
                        InlineAsmReg::PowerPC(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    7usize => {
                        InlineAsmReg::Hexagon(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    8usize => {
                        InlineAsmReg::LoongArch(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    9usize => {
                        InlineAsmReg::Mips(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    10usize => {
                        InlineAsmReg::S390x(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    11usize => {
                        InlineAsmReg::Sparc(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    12usize => {
                        InlineAsmReg::SpirV(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    13usize => {
                        InlineAsmReg::Wasm(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    14usize => {
                        InlineAsmReg::Xtensa(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    15usize => {
                        InlineAsmReg::Bpf(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    16usize => {
                        InlineAsmReg::Avr(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    17usize => {
                        InlineAsmReg::Msp430(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    18usize => {
                        InlineAsmReg::M68k(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    19usize => {
                        InlineAsmReg::CSKY(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    20usize => { InlineAsmReg::Err }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `InlineAsmReg`, expected 0..21, actual {0}",
                                n));
                    }
                }
            }
        }
    };Decodable)]
291pub enum InlineAsmReg {
292    X86(X86InlineAsmReg),
293    Arm(ArmInlineAsmReg),
294    Amdgpu(AmdgpuInlineAsmReg),
295    AArch64(AArch64InlineAsmReg),
296    RiscV(RiscVInlineAsmReg),
297    Nvptx(NvptxInlineAsmReg),
298    PowerPC(PowerPCInlineAsmReg),
299    Hexagon(HexagonInlineAsmReg),
300    LoongArch(LoongArchInlineAsmReg),
301    Mips(MipsInlineAsmReg),
302    S390x(S390xInlineAsmReg),
303    Sparc(SparcInlineAsmReg),
304    SpirV(SpirVInlineAsmReg),
305    Wasm(WasmInlineAsmReg),
306    Xtensa(XtensaInlineAsmReg),
307    Bpf(BpfInlineAsmReg),
308    Avr(AvrInlineAsmReg),
309    Msp430(Msp430InlineAsmReg),
310    M68k(M68kInlineAsmReg),
311    CSKY(CSKYInlineAsmReg),
312    // Placeholder for invalid register constraints for the current target
313    Err,
314}
315
316impl InlineAsmReg {
317    pub fn name(self) -> Cow<'static, str> {
318        match self {
319            Self::X86(r) => r.name().into(),
320            Self::Arm(r) => r.name().into(),
321            Self::AArch64(r) => r.name().into(),
322            Self::Amdgpu(r) => r.name().into(),
323            Self::RiscV(r) => r.name().into(),
324            Self::PowerPC(r) => r.name().into(),
325            Self::Hexagon(r) => r.name().into(),
326            Self::LoongArch(r) => r.name().into(),
327            Self::Mips(r) => r.name().into(),
328            Self::S390x(r) => r.name().into(),
329            Self::Sparc(r) => r.name().into(),
330            Self::Xtensa(r) => r.name().into(),
331            Self::Bpf(r) => r.name().into(),
332            Self::Avr(r) => r.name().into(),
333            Self::Msp430(r) => r.name().into(),
334            Self::M68k(r) => r.name().into(),
335            Self::CSKY(r) => r.name().into(),
336            Self::Err => "<reg>".into(),
337        }
338    }
339
340    pub fn reg_class(self) -> InlineAsmRegClass {
341        match self {
342            Self::X86(r) => InlineAsmRegClass::X86(r.reg_class()),
343            Self::Arm(r) => InlineAsmRegClass::Arm(r.reg_class()),
344            Self::AArch64(r) => InlineAsmRegClass::AArch64(r.reg_class()),
345            Self::Amdgpu(r) => InlineAsmRegClass::Amdgpu(r.reg_class()),
346            Self::RiscV(r) => InlineAsmRegClass::RiscV(r.reg_class()),
347            Self::PowerPC(r) => InlineAsmRegClass::PowerPC(r.reg_class()),
348            Self::Hexagon(r) => InlineAsmRegClass::Hexagon(r.reg_class()),
349            Self::LoongArch(r) => InlineAsmRegClass::LoongArch(r.reg_class()),
350            Self::Mips(r) => InlineAsmRegClass::Mips(r.reg_class()),
351            Self::S390x(r) => InlineAsmRegClass::S390x(r.reg_class()),
352            Self::Sparc(r) => InlineAsmRegClass::Sparc(r.reg_class()),
353            Self::Xtensa(r) => InlineAsmRegClass::Xtensa(r.reg_class()),
354            Self::Bpf(r) => InlineAsmRegClass::Bpf(r.reg_class()),
355            Self::Avr(r) => InlineAsmRegClass::Avr(r.reg_class()),
356            Self::Msp430(r) => InlineAsmRegClass::Msp430(r.reg_class()),
357            Self::M68k(r) => InlineAsmRegClass::M68k(r.reg_class()),
358            Self::CSKY(r) => InlineAsmRegClass::CSKY(r.reg_class()),
359            Self::Err => InlineAsmRegClass::Err,
360        }
361    }
362
363    pub fn parse(arch: InlineAsmArch, name: Symbol) -> Result<Self, &'static str> {
364        // FIXME: use direct symbol comparison for register names
365        // Use `Symbol::as_str` instead of `Symbol::with` here because `has_feature` may access `Symbol`.
366        let name = name.as_str();
367        Ok(match arch {
368            InlineAsmArch::X86 | InlineAsmArch::X86_64 => Self::X86(X86InlineAsmReg::parse(name)?),
369            InlineAsmArch::Arm => Self::Arm(ArmInlineAsmReg::parse(name)?),
370            InlineAsmArch::AArch64 | InlineAsmArch::Arm64EC => {
371                Self::AArch64(AArch64InlineAsmReg::parse(name)?)
372            }
373            InlineAsmArch::Amdgpu => Self::Amdgpu(AmdgpuInlineAsmReg::parse(name)?),
374            InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => {
375                Self::RiscV(RiscVInlineAsmReg::parse(name)?)
376            }
377            InlineAsmArch::Nvptx64 => Self::Nvptx(NvptxInlineAsmReg::parse(name)?),
378            InlineAsmArch::PowerPC | InlineAsmArch::PowerPC64 => {
379                Self::PowerPC(PowerPCInlineAsmReg::parse(name)?)
380            }
381            InlineAsmArch::Hexagon => Self::Hexagon(HexagonInlineAsmReg::parse(name)?),
382            InlineAsmArch::LoongArch32 | InlineAsmArch::LoongArch64 => {
383                Self::LoongArch(LoongArchInlineAsmReg::parse(name)?)
384            }
385            InlineAsmArch::Mips | InlineAsmArch::Mips64 => {
386                Self::Mips(MipsInlineAsmReg::parse(name)?)
387            }
388            InlineAsmArch::Xtensa => Self::Xtensa(XtensaInlineAsmReg::parse(name)?),
389            InlineAsmArch::S390x => Self::S390x(S390xInlineAsmReg::parse(name)?),
390            InlineAsmArch::Sparc | InlineAsmArch::Sparc64 => {
391                Self::Sparc(SparcInlineAsmReg::parse(name)?)
392            }
393            InlineAsmArch::SpirV => Self::SpirV(SpirVInlineAsmReg::parse(name)?),
394            InlineAsmArch::Wasm32 | InlineAsmArch::Wasm64 => {
395                Self::Wasm(WasmInlineAsmReg::parse(name)?)
396            }
397            InlineAsmArch::Bpf => Self::Bpf(BpfInlineAsmReg::parse(name)?),
398            InlineAsmArch::Avr => Self::Avr(AvrInlineAsmReg::parse(name)?),
399            InlineAsmArch::Msp430 => Self::Msp430(Msp430InlineAsmReg::parse(name)?),
400            InlineAsmArch::M68k => Self::M68k(M68kInlineAsmReg::parse(name)?),
401            InlineAsmArch::CSKY => Self::CSKY(CSKYInlineAsmReg::parse(name)?),
402        })
403    }
404
405    pub fn validate(
406        self,
407        arch: InlineAsmArch,
408        reloc_model: RelocModel,
409        target_features: &FxIndexSet<Symbol>,
410        target: &Target,
411        is_clobber: bool,
412    ) -> Result<(), &'static str> {
413        match self {
414            Self::X86(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
415            Self::Arm(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
416            Self::AArch64(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
417            Self::Amdgpu(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
418            Self::RiscV(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
419            Self::PowerPC(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
420            Self::Hexagon(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
421            Self::LoongArch(r) => {
422                r.validate(arch, reloc_model, target_features, target, is_clobber)
423            }
424            Self::Mips(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
425            Self::S390x(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
426            Self::Sparc(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
427            Self::Bpf(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
428            Self::Avr(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
429            Self::Xtensa(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
430            Self::Msp430(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
431            Self::M68k(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
432            Self::CSKY(r) => r.validate(arch, reloc_model, target_features, target, is_clobber),
433            Self::Err => ::core::panicking::panic("internal error: entered unreachable code")unreachable!(),
434        }
435    }
436
437    // NOTE: This function isn't used at the moment, but is needed to support
438    // falling back to an external assembler.
439    pub fn emit(
440        self,
441        out: &mut dyn fmt::Write,
442        arch: InlineAsmArch,
443        modifier: Option<char>,
444    ) -> fmt::Result {
445        match self {
446            Self::X86(r) => r.emit(out, arch, modifier),
447            Self::Arm(r) => r.emit(out, arch, modifier),
448            Self::AArch64(r) => r.emit(out, arch, modifier),
449            Self::Amdgpu(r) => r.emit(out, arch, modifier),
450            Self::RiscV(r) => r.emit(out, arch, modifier),
451            Self::PowerPC(r) => r.emit(out, arch, modifier),
452            Self::Hexagon(r) => r.emit(out, arch, modifier),
453            Self::LoongArch(r) => r.emit(out, arch, modifier),
454            Self::Mips(r) => r.emit(out, arch, modifier),
455            Self::S390x(r) => r.emit(out, arch, modifier),
456            Self::Sparc(r) => r.emit(out, arch, modifier),
457            Self::Xtensa(r) => r.emit(out, arch, modifier),
458            Self::Bpf(r) => r.emit(out, arch, modifier),
459            Self::Avr(r) => r.emit(out, arch, modifier),
460            Self::Msp430(r) => r.emit(out, arch, modifier),
461            Self::M68k(r) => r.emit(out, arch, modifier),
462            Self::CSKY(r) => r.emit(out, arch, modifier),
463            Self::Err => {
    ::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}",
            format_args!("Use of InlineAsmReg::Err")));
}unreachable!("Use of InlineAsmReg::Err"),
464        }
465    }
466
467    pub fn overlapping_regs(self, mut cb: impl FnMut(InlineAsmReg)) {
468        match self {
469            Self::X86(r) => r.overlapping_regs(|r| cb(Self::X86(r))),
470            Self::Arm(r) => r.overlapping_regs(|r| cb(Self::Arm(r))),
471            Self::AArch64(_) => cb(self),
472            Self::Amdgpu(r) => r.overlapping_regs(|r| cb(Self::Amdgpu(r))),
473            Self::RiscV(_) => cb(self),
474            Self::PowerPC(r) => r.overlapping_regs(|r| cb(Self::PowerPC(r))),
475            Self::Hexagon(r) => r.overlapping_regs(|r| cb(Self::Hexagon(r))),
476            Self::LoongArch(r) => r.overlapping_regs(|r| cb(Self::LoongArch(r))),
477            Self::Mips(r) => r.overlapping_regs(|r| cb(Self::Mips(r))),
478            Self::S390x(r) => r.overlapping_regs(|r| cb(Self::S390x(r))),
479            Self::Sparc(r) => r.overlapping_regs(|r| cb(Self::Sparc(r))),
480            Self::Xtensa(_) => cb(self),
481            Self::Bpf(r) => r.overlapping_regs(|r| cb(Self::Bpf(r))),
482            Self::Avr(r) => r.overlapping_regs(|r| cb(Self::Avr(r))),
483            Self::Msp430(_) => cb(self),
484            Self::M68k(_) => cb(self),
485            Self::CSKY(_) => cb(self),
486            Self::Err => {
    ::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}",
            format_args!("Use of InlineAsmReg::Err")));
}unreachable!("Use of InlineAsmReg::Err"),
487        }
488    }
489}
490
491#[derive(#[automatically_derived]
impl ::core::marker::Copy for InlineAsmRegClass { }Copy, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for InlineAsmRegClass { }
#[automatically_derived]
impl ::core::clone::Clone for InlineAsmRegClass {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<X86InlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<ArmInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<AArch64InlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<AmdgpuInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<RiscVInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<NvptxInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<PowerPCInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<HexagonInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<LoongArchInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<MipsInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<S390xInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<SparcInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<SpirVInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<WasmInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<XtensaInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<BpfInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<AvrInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<Msp430InlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<M68kInlineAsmRegClass>;
        let _: ::core::clone::AssertParamIsClone<CSKYInlineAsmRegClass>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for InlineAsmRegClass {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::X86(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "X86",
                    &__self_0),
            Self::Arm(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Arm",
                    &__self_0),
            Self::AArch64(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "AArch64", &__self_0),
            Self::Amdgpu(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Amdgpu",
                    &__self_0),
            Self::RiscV(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "RiscV",
                    &__self_0),
            Self::Nvptx(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Nvptx",
                    &__self_0),
            Self::PowerPC(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "PowerPC", &__self_0),
            Self::Hexagon(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Hexagon", &__self_0),
            Self::LoongArch(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "LoongArch", &__self_0),
            Self::Mips(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Mips",
                    &__self_0),
            Self::S390x(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "S390x",
                    &__self_0),
            Self::Sparc(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Sparc",
                    &__self_0),
            Self::SpirV(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "SpirV",
                    &__self_0),
            Self::Wasm(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Wasm",
                    &__self_0),
            Self::Xtensa(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Xtensa",
                    &__self_0),
            Self::Bpf(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Bpf",
                    &__self_0),
            Self::Avr(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Avr",
                    &__self_0),
            Self::Msp430(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Msp430",
                    &__self_0),
            Self::M68k(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "M68k",
                    &__self_0),
            Self::CSKY(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "CSKY",
                    &__self_0),
            Self::Err => ::core::fmt::Formatter::write_str(f, "Err"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for InlineAsmRegClass {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<X86InlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<ArmInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<AArch64InlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<AmdgpuInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<RiscVInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<NvptxInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<PowerPCInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<HexagonInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<LoongArchInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<MipsInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<S390xInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<SparcInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<SpirVInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<WasmInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<XtensaInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<BpfInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<AvrInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<Msp430InlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<M68kInlineAsmRegClass>;
        let _: ::core::cmp::AssertParamIsEq<CSKYInlineAsmRegClass>;
    }
}Eq, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for InlineAsmRegClass { }
#[automatically_derived]
impl ::core::cmp::PartialEq for InlineAsmRegClass {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::X86(__self_0), Self::X86(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Arm(__self_0), Self::Arm(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::AArch64(__self_0), Self::AArch64(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Amdgpu(__self_0), Self::Amdgpu(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::RiscV(__self_0), Self::RiscV(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Nvptx(__self_0), Self::Nvptx(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::PowerPC(__self_0), Self::PowerPC(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Hexagon(__self_0), Self::Hexagon(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::LoongArch(__self_0), Self::LoongArch(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Mips(__self_0), Self::Mips(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::S390x(__self_0), Self::S390x(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Sparc(__self_0), Self::Sparc(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::SpirV(__self_0), Self::SpirV(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Wasm(__self_0), Self::Wasm(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Xtensa(__self_0), Self::Xtensa(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Bpf(__self_0), Self::Bpf(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Avr(__self_0), Self::Avr(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Msp430(__self_0), Self::Msp430(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::M68k(__self_0), Self::M68k(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::CSKY(__self_0), Self::CSKY(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for InlineAsmRegClass {
    #[inline]
    fn partial_cmp(&self, other: &Self)
        -> ::core::option::Option<::core::cmp::Ordering> {
        match (self, other) {
            (Self::X86(__self_0), Self::X86(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Arm(__self_0), Self::Arm(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::AArch64(__self_0), Self::AArch64(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Amdgpu(__self_0), Self::Amdgpu(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::RiscV(__self_0), Self::RiscV(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Nvptx(__self_0), Self::Nvptx(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::PowerPC(__self_0), Self::PowerPC(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Hexagon(__self_0), Self::Hexagon(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::LoongArch(__self_0), Self::LoongArch(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Mips(__self_0), Self::Mips(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::S390x(__self_0), Self::S390x(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Sparc(__self_0), Self::Sparc(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::SpirV(__self_0), Self::SpirV(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Wasm(__self_0), Self::Wasm(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Xtensa(__self_0), Self::Xtensa(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Bpf(__self_0), Self::Bpf(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Avr(__self_0), Self::Avr(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::Msp430(__self_0), Self::Msp430(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::M68k(__self_0), Self::M68k(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::CSKY(__self_0), Self::CSKY(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            _ =>
                ::core::cmp::PartialOrd::partial_cmp(&::core::intrinsics::discriminant_value(self),
                    &::core::intrinsics::discriminant_value(other)),
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::hash::Hash for InlineAsmRegClass {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::X86(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Arm(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::AArch64(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Amdgpu(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::RiscV(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Nvptx(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::PowerPC(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Hexagon(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::LoongArch(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Mips(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::S390x(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Sparc(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::SpirV(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Wasm(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Xtensa(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Bpf(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Avr(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Msp430(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::M68k(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::CSKY(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash)]
492#[derive(const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            InlineAsmRegClass {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                ::std::mem::discriminant(self).stable_hash(__hcx, __hasher);
                match *self {
                    InlineAsmRegClass::X86(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Arm(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::AArch64(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Amdgpu(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::RiscV(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Nvptx(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::PowerPC(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Hexagon(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::LoongArch(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Mips(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::S390x(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Sparc(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::SpirV(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Wasm(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Xtensa(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Bpf(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Avr(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Msp430(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::M68k(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::CSKY(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegClass::Err => {}
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for InlineAsmRegClass {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        InlineAsmRegClass::X86(ref __binding_0) => { 0usize }
                        InlineAsmRegClass::Arm(ref __binding_0) => { 1usize }
                        InlineAsmRegClass::AArch64(ref __binding_0) => { 2usize }
                        InlineAsmRegClass::Amdgpu(ref __binding_0) => { 3usize }
                        InlineAsmRegClass::RiscV(ref __binding_0) => { 4usize }
                        InlineAsmRegClass::Nvptx(ref __binding_0) => { 5usize }
                        InlineAsmRegClass::PowerPC(ref __binding_0) => { 6usize }
                        InlineAsmRegClass::Hexagon(ref __binding_0) => { 7usize }
                        InlineAsmRegClass::LoongArch(ref __binding_0) => { 8usize }
                        InlineAsmRegClass::Mips(ref __binding_0) => { 9usize }
                        InlineAsmRegClass::S390x(ref __binding_0) => { 10usize }
                        InlineAsmRegClass::Sparc(ref __binding_0) => { 11usize }
                        InlineAsmRegClass::SpirV(ref __binding_0) => { 12usize }
                        InlineAsmRegClass::Wasm(ref __binding_0) => { 13usize }
                        InlineAsmRegClass::Xtensa(ref __binding_0) => { 14usize }
                        InlineAsmRegClass::Bpf(ref __binding_0) => { 15usize }
                        InlineAsmRegClass::Avr(ref __binding_0) => { 16usize }
                        InlineAsmRegClass::Msp430(ref __binding_0) => { 17usize }
                        InlineAsmRegClass::M68k(ref __binding_0) => { 18usize }
                        InlineAsmRegClass::CSKY(ref __binding_0) => { 19usize }
                        InlineAsmRegClass::Err => { 20usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    InlineAsmRegClass::X86(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Arm(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::AArch64(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Amdgpu(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::RiscV(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Nvptx(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::PowerPC(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Hexagon(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::LoongArch(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Mips(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::S390x(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Sparc(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::SpirV(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Wasm(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Xtensa(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Bpf(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Avr(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Msp430(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::M68k(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::CSKY(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegClass::Err => {}
                }
            }
        }
    };Encodable, const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for InlineAsmRegClass {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => {
                        InlineAsmRegClass::X86(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    1usize => {
                        InlineAsmRegClass::Arm(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    2usize => {
                        InlineAsmRegClass::AArch64(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    3usize => {
                        InlineAsmRegClass::Amdgpu(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    4usize => {
                        InlineAsmRegClass::RiscV(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    5usize => {
                        InlineAsmRegClass::Nvptx(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    6usize => {
                        InlineAsmRegClass::PowerPC(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    7usize => {
                        InlineAsmRegClass::Hexagon(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    8usize => {
                        InlineAsmRegClass::LoongArch(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    9usize => {
                        InlineAsmRegClass::Mips(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    10usize => {
                        InlineAsmRegClass::S390x(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    11usize => {
                        InlineAsmRegClass::Sparc(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    12usize => {
                        InlineAsmRegClass::SpirV(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    13usize => {
                        InlineAsmRegClass::Wasm(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    14usize => {
                        InlineAsmRegClass::Xtensa(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    15usize => {
                        InlineAsmRegClass::Bpf(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    16usize => {
                        InlineAsmRegClass::Avr(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    17usize => {
                        InlineAsmRegClass::Msp430(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    18usize => {
                        InlineAsmRegClass::M68k(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    19usize => {
                        InlineAsmRegClass::CSKY(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    20usize => { InlineAsmRegClass::Err }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `InlineAsmRegClass`, expected 0..21, actual {0}",
                                n));
                    }
                }
            }
        }
    };Decodable)]
493pub enum InlineAsmRegClass {
494    X86(X86InlineAsmRegClass),
495    Arm(ArmInlineAsmRegClass),
496    AArch64(AArch64InlineAsmRegClass),
497    Amdgpu(AmdgpuInlineAsmRegClass),
498    RiscV(RiscVInlineAsmRegClass),
499    Nvptx(NvptxInlineAsmRegClass),
500    PowerPC(PowerPCInlineAsmRegClass),
501    Hexagon(HexagonInlineAsmRegClass),
502    LoongArch(LoongArchInlineAsmRegClass),
503    Mips(MipsInlineAsmRegClass),
504    S390x(S390xInlineAsmRegClass),
505    Sparc(SparcInlineAsmRegClass),
506    SpirV(SpirVInlineAsmRegClass),
507    Wasm(WasmInlineAsmRegClass),
508    Xtensa(XtensaInlineAsmRegClass),
509    Bpf(BpfInlineAsmRegClass),
510    Avr(AvrInlineAsmRegClass),
511    Msp430(Msp430InlineAsmRegClass),
512    M68k(M68kInlineAsmRegClass),
513    CSKY(CSKYInlineAsmRegClass),
514    // Placeholder for invalid register constraints for the current target
515    Err,
516}
517
518impl InlineAsmRegClass {
519    pub fn name(self) -> Symbol {
520        match self {
521            Self::X86(r) => r.name(),
522            Self::Arm(r) => r.name(),
523            Self::AArch64(r) => r.name(),
524            Self::Amdgpu(r) => r.name(),
525            Self::RiscV(r) => r.name(),
526            Self::Nvptx(r) => r.name(),
527            Self::PowerPC(r) => r.name(),
528            Self::Hexagon(r) => r.name(),
529            Self::LoongArch(r) => r.name(),
530            Self::Mips(r) => r.name(),
531            Self::S390x(r) => r.name(),
532            Self::Sparc(r) => r.name(),
533            Self::SpirV(r) => r.name(),
534            Self::Wasm(r) => r.name(),
535            Self::Xtensa(r) => r.name(),
536            Self::Bpf(r) => r.name(),
537            Self::Avr(r) => r.name(),
538            Self::Msp430(r) => r.name(),
539            Self::M68k(r) => r.name(),
540            Self::CSKY(r) => r.name(),
541            Self::Err => rustc_span::sym::reg,
542        }
543    }
544
545    /// Returns a suggested register class to use for this type. This is called
546    /// when `supported_types` fails to give a better error
547    /// message to the user.
548    pub fn suggest_class(self, arch: InlineAsmArch, ty: InlineAsmType) -> Option<Self> {
549        match self {
550            Self::X86(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::X86),
551            Self::Arm(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Arm),
552            Self::AArch64(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::AArch64),
553            Self::Amdgpu(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Amdgpu),
554            Self::RiscV(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::RiscV),
555            Self::Nvptx(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Nvptx),
556            Self::PowerPC(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::PowerPC),
557            Self::Hexagon(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Hexagon),
558            Self::LoongArch(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::LoongArch),
559            Self::Mips(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Mips),
560            Self::S390x(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::S390x),
561            Self::Sparc(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Sparc),
562            Self::SpirV(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::SpirV),
563            Self::Wasm(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Wasm),
564            Self::Xtensa(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Xtensa),
565            Self::Bpf(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Bpf),
566            Self::Avr(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Avr),
567            Self::Msp430(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::Msp430),
568            Self::M68k(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::M68k),
569            Self::CSKY(r) => r.suggest_class(arch, ty).map(InlineAsmRegClass::CSKY),
570            Self::Err => {
    ::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}",
            format_args!("Use of InlineAsmRegClass::Err")));
}unreachable!("Use of InlineAsmRegClass::Err"),
571        }
572    }
573
574    /// Returns a suggested template modifier to use for this type and an
575    /// example of a register named formatted with it.
576    ///
577    /// Such suggestions are useful if a type smaller than the full register
578    /// size is used and a modifier can be used to point to the subregister of
579    /// the correct size.
580    pub fn suggest_modifier(self, arch: InlineAsmArch, ty: InlineAsmType) -> Option<ModifierInfo> {
581        match self {
582            Self::X86(r) => r.suggest_modifier(arch, ty),
583            Self::Arm(r) => r.suggest_modifier(arch, ty),
584            Self::AArch64(r) => r.suggest_modifier(arch, ty),
585            Self::Amdgpu(r) => r.suggest_modifier(arch, ty),
586            Self::RiscV(r) => r.suggest_modifier(arch, ty),
587            Self::Nvptx(r) => r.suggest_modifier(arch, ty),
588            Self::PowerPC(r) => r.suggest_modifier(arch, ty),
589            Self::Hexagon(r) => r.suggest_modifier(arch, ty),
590            Self::LoongArch(r) => r.suggest_modifier(arch, ty),
591            Self::Mips(r) => r.suggest_modifier(arch, ty),
592            Self::S390x(r) => r.suggest_modifier(arch, ty),
593            Self::Sparc(r) => r.suggest_modifier(arch, ty),
594            Self::SpirV(r) => r.suggest_modifier(arch, ty),
595            Self::Wasm(r) => r.suggest_modifier(arch, ty),
596            Self::Xtensa(r) => r.suggest_modifier(arch, ty),
597            Self::Bpf(r) => r.suggest_modifier(arch, ty),
598            Self::Avr(r) => r.suggest_modifier(arch, ty),
599            Self::Msp430(r) => r.suggest_modifier(arch, ty),
600            Self::M68k(r) => r.suggest_modifier(arch, ty),
601            Self::CSKY(r) => r.suggest_modifier(arch, ty),
602            Self::Err => {
    ::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}",
            format_args!("Use of InlineAsmRegClass::Err")));
}unreachable!("Use of InlineAsmRegClass::Err"),
603        }
604    }
605
606    /// Returns the default modifier for this register and an example of a
607    /// register named formatted with it.
608    ///
609    /// This is only needed when the register class can suggest a modifier, so
610    /// that the user can be shown how to get the default behavior without a
611    /// warning.
612    pub fn default_modifier(self, arch: InlineAsmArch) -> Option<ModifierInfo> {
613        match self {
614            Self::X86(r) => r.default_modifier(arch),
615            Self::Arm(r) => r.default_modifier(arch),
616            Self::AArch64(r) => r.default_modifier(arch),
617            Self::Amdgpu(r) => r.default_modifier(arch),
618            Self::RiscV(r) => r.default_modifier(arch),
619            Self::Nvptx(r) => r.default_modifier(arch),
620            Self::PowerPC(r) => r.default_modifier(arch),
621            Self::Hexagon(r) => r.default_modifier(arch),
622            Self::LoongArch(r) => r.default_modifier(arch),
623            Self::Mips(r) => r.default_modifier(arch),
624            Self::S390x(r) => r.default_modifier(arch),
625            Self::Sparc(r) => r.default_modifier(arch),
626            Self::SpirV(r) => r.default_modifier(arch),
627            Self::Wasm(r) => r.default_modifier(arch),
628            Self::Xtensa(r) => r.default_modifier(arch),
629            Self::Bpf(r) => r.default_modifier(arch),
630            Self::Avr(r) => r.default_modifier(arch),
631            Self::Msp430(r) => r.default_modifier(arch),
632            Self::M68k(r) => r.default_modifier(arch),
633            Self::CSKY(r) => r.default_modifier(arch),
634            Self::Err => {
    ::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}",
            format_args!("Use of InlineAsmRegClass::Err")));
}unreachable!("Use of InlineAsmRegClass::Err"),
635        }
636    }
637
638    /// Returns a list of supported types for this register class, each with an
639    /// options target feature required to use this type.
640    ///
641    /// At the codegen stage, it is fine to always pass true for `allow_experimental_reg`,
642    /// since all the stability checking will have been done in prior stages.
643    pub fn supported_types(
644        self,
645        arch: InlineAsmArch,
646        allow_experimental_reg: bool,
647    ) -> Cow<'static, [(InlineAsmType, Option<Symbol>)]> {
648        match self {
649            Self::X86(r) => r.supported_types(arch, allow_experimental_reg).into(),
650            Self::Arm(r) => r.supported_types(arch).into(),
651            Self::AArch64(r) => r.supported_types(arch, allow_experimental_reg).into(),
652            Self::Amdgpu(r) => r.supported_types(arch).into(),
653            Self::RiscV(r) => r.supported_types(arch).into(),
654            Self::Nvptx(r) => r.supported_types(arch).into(),
655            Self::PowerPC(r) => r.supported_types(arch).into(),
656            Self::Hexagon(r) => r.supported_types(arch).into(),
657            Self::LoongArch(r) => r.supported_types(arch, allow_experimental_reg).into(),
658            Self::Mips(r) => r.supported_types(arch).into(),
659            Self::S390x(r) => r.supported_types(arch).into(),
660            Self::Sparc(r) => r.supported_types(arch).into(),
661            Self::SpirV(r) => r.supported_types(arch).into(),
662            Self::Wasm(r) => r.supported_types(arch).into(),
663            Self::Xtensa(r) => r.supported_types(arch).into(),
664            Self::Bpf(r) => r.supported_types(arch).into(),
665            Self::Avr(r) => r.supported_types(arch).into(),
666            Self::Msp430(r) => r.supported_types(arch).into(),
667            Self::M68k(r) => r.supported_types(arch).into(),
668            Self::CSKY(r) => r.supported_types(arch).into(),
669            Self::Err => {
    ::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}",
            format_args!("Use of InlineAsmRegClass::Err")));
}unreachable!("Use of InlineAsmRegClass::Err"),
670        }
671    }
672
673    pub fn parse(arch: InlineAsmArch, name: Symbol) -> Result<Self, &'static [rustc_span::Symbol]> {
674        Ok(match arch {
675            InlineAsmArch::X86 | InlineAsmArch::X86_64 => {
676                Self::X86(X86InlineAsmRegClass::parse(name)?)
677            }
678            InlineAsmArch::Arm => Self::Arm(ArmInlineAsmRegClass::parse(name)?),
679            InlineAsmArch::AArch64 | InlineAsmArch::Arm64EC => {
680                Self::AArch64(AArch64InlineAsmRegClass::parse(name)?)
681            }
682            InlineAsmArch::Amdgpu => Self::Amdgpu(AmdgpuInlineAsmRegClass::parse(name)?),
683            InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => {
684                Self::RiscV(RiscVInlineAsmRegClass::parse(name)?)
685            }
686            InlineAsmArch::Nvptx64 => Self::Nvptx(NvptxInlineAsmRegClass::parse(name)?),
687            InlineAsmArch::PowerPC | InlineAsmArch::PowerPC64 => {
688                Self::PowerPC(PowerPCInlineAsmRegClass::parse(name)?)
689            }
690            InlineAsmArch::Hexagon => Self::Hexagon(HexagonInlineAsmRegClass::parse(name)?),
691            InlineAsmArch::LoongArch32 | InlineAsmArch::LoongArch64 => {
692                Self::LoongArch(LoongArchInlineAsmRegClass::parse(name)?)
693            }
694            InlineAsmArch::Mips | InlineAsmArch::Mips64 => {
695                Self::Mips(MipsInlineAsmRegClass::parse(name)?)
696            }
697            InlineAsmArch::S390x => Self::S390x(S390xInlineAsmRegClass::parse(name)?),
698            InlineAsmArch::Sparc | InlineAsmArch::Sparc64 => {
699                Self::Sparc(SparcInlineAsmRegClass::parse(name)?)
700            }
701            InlineAsmArch::SpirV => Self::SpirV(SpirVInlineAsmRegClass::parse(name)?),
702            InlineAsmArch::Wasm32 | InlineAsmArch::Wasm64 => {
703                Self::Wasm(WasmInlineAsmRegClass::parse(name)?)
704            }
705            InlineAsmArch::Bpf => Self::Bpf(BpfInlineAsmRegClass::parse(name)?),
706            InlineAsmArch::Avr => Self::Avr(AvrInlineAsmRegClass::parse(name)?),
707            InlineAsmArch::Xtensa => Self::Xtensa(XtensaInlineAsmRegClass::parse(name)?),
708            InlineAsmArch::Msp430 => Self::Msp430(Msp430InlineAsmRegClass::parse(name)?),
709            InlineAsmArch::M68k => Self::M68k(M68kInlineAsmRegClass::parse(name)?),
710            InlineAsmArch::CSKY => Self::CSKY(CSKYInlineAsmRegClass::parse(name)?),
711        })
712    }
713
714    /// Returns the list of template modifiers that can be used with this register class, as well as
715    /// whether the `asm_experimental_reg` feature is enabled: there can be template modifiers that
716    /// apply to currently unstable registers, and we don't want to make these modifiers usable
717    /// without the feature gate.
718    pub fn valid_modifiers(
719        self,
720        arch: InlineAsmArch,
721        allow_experimental_reg: bool,
722    ) -> &'static [char] {
723        match self {
724            Self::X86(r) => r.valid_modifiers(arch),
725            Self::Arm(r) => r.valid_modifiers(arch),
726            Self::AArch64(r) => r.valid_modifiers(arch, allow_experimental_reg),
727            Self::Amdgpu(r) => r.valid_modifiers(arch),
728            Self::RiscV(r) => r.valid_modifiers(arch),
729            Self::Nvptx(r) => r.valid_modifiers(arch),
730            Self::PowerPC(r) => r.valid_modifiers(arch),
731            Self::Hexagon(r) => r.valid_modifiers(arch),
732            Self::LoongArch(r) => r.valid_modifiers(arch),
733            Self::Mips(r) => r.valid_modifiers(arch),
734            Self::S390x(r) => r.valid_modifiers(arch),
735            Self::Sparc(r) => r.valid_modifiers(arch),
736            Self::SpirV(r) => r.valid_modifiers(arch),
737            Self::Wasm(r) => r.valid_modifiers(arch),
738            Self::Xtensa(r) => r.valid_modifiers(arch),
739            Self::Bpf(r) => r.valid_modifiers(arch),
740            Self::Avr(r) => r.valid_modifiers(arch),
741            Self::Msp430(r) => r.valid_modifiers(arch),
742            Self::M68k(r) => r.valid_modifiers(arch),
743            Self::CSKY(r) => r.valid_modifiers(arch),
744            Self::Err => {
    ::core::panicking::panic_fmt(format_args!("internal error: entered unreachable code: {0}",
            format_args!("Use of InlineAsmRegClass::Err")));
}unreachable!("Use of InlineAsmRegClass::Err"),
745        }
746    }
747
748    /// Returns whether registers in this class can only be used as clobbers
749    /// and not as inputs/outputs.
750    ///
751    /// At the codegen stage, it is fine to always pass true for `allow_experimental_reg`,
752    /// since all the stability checking will have been done in prior stages.
753    pub fn is_clobber_only(self, arch: InlineAsmArch, allow_experimental_reg: bool) -> bool {
754        self.supported_types(arch, allow_experimental_reg).is_empty()
755    }
756}
757
758#[derive(#[automatically_derived]
impl ::core::marker::Copy for InlineAsmRegOrRegClass { }Copy, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for InlineAsmRegOrRegClass { }
#[automatically_derived]
impl ::core::clone::Clone for InlineAsmRegOrRegClass {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<InlineAsmReg>;
        let _: ::core::clone::AssertParamIsClone<InlineAsmRegClass>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for InlineAsmRegOrRegClass {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Reg(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Reg",
                    &__self_0),
            Self::RegClass(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "RegClass", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for InlineAsmRegOrRegClass {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<InlineAsmReg>;
        let _: ::core::cmp::AssertParamIsEq<InlineAsmRegClass>;
    }
}Eq, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for InlineAsmRegOrRegClass { }
#[automatically_derived]
impl ::core::cmp::PartialEq for InlineAsmRegOrRegClass {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Reg(__self_0), Self::Reg(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::RegClass(__self_0), Self::RegClass(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for InlineAsmRegOrRegClass {
    #[inline]
    fn partial_cmp(&self, other: &Self)
        -> ::core::option::Option<::core::cmp::Ordering> {
        match (self, other) {
            (Self::Reg(__self_0), Self::Reg(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (Self::RegClass(__self_0), Self::RegClass(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            _ =>
                ::core::cmp::PartialOrd::partial_cmp(&::core::intrinsics::discriminant_value(self),
                    &::core::intrinsics::discriminant_value(other)),
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::hash::Hash for InlineAsmRegOrRegClass {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::Reg(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::RegClass(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
        }
    }
}Hash)]
759#[derive(const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            InlineAsmRegOrRegClass {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                ::std::mem::discriminant(self).stable_hash(__hcx, __hasher);
                match *self {
                    InlineAsmRegOrRegClass::Reg(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmRegOrRegClass::RegClass(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for InlineAsmRegOrRegClass {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        InlineAsmRegOrRegClass::Reg(ref __binding_0) => { 0usize }
                        InlineAsmRegOrRegClass::RegClass(ref __binding_0) => {
                            1usize
                        }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    InlineAsmRegOrRegClass::Reg(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    InlineAsmRegOrRegClass::RegClass(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                }
            }
        }
    };Encodable, const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for InlineAsmRegOrRegClass {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => {
                        InlineAsmRegOrRegClass::Reg(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    1usize => {
                        InlineAsmRegOrRegClass::RegClass(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `InlineAsmRegOrRegClass`, expected 0..2, actual {0}",
                                n));
                    }
                }
            }
        }
    };Decodable)]
760pub enum InlineAsmRegOrRegClass {
761    Reg(InlineAsmReg),
762    RegClass(InlineAsmRegClass),
763}
764
765impl InlineAsmRegOrRegClass {
766    pub fn reg_class(self) -> InlineAsmRegClass {
767        match self {
768            Self::Reg(r) => r.reg_class(),
769            Self::RegClass(r) => r,
770        }
771    }
772}
773
774impl fmt::Display for InlineAsmRegOrRegClass {
775    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
776        match self {
777            Self::Reg(r) => f.write_fmt(format_args!("\"{0}\"", r.name()))write!(f, "\"{}\"", r.name()),
778            Self::RegClass(r) => f.write_fmt(format_args!("{0}", r.name()))write!(f, "{}", r.name()),
779        }
780    }
781}
782
783/// Set of types which can be used with a particular register class.
784#[derive(#[automatically_derived]
impl ::core::marker::Copy for InlineAsmType { }Copy, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for InlineAsmType { }
#[automatically_derived]
impl ::core::clone::Clone for InlineAsmType {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<u64>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for InlineAsmType {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::I8 => ::core::fmt::Formatter::write_str(f, "I8"),
            Self::I16 => ::core::fmt::Formatter::write_str(f, "I16"),
            Self::I32 => ::core::fmt::Formatter::write_str(f, "I32"),
            Self::I64 => ::core::fmt::Formatter::write_str(f, "I64"),
            Self::I128 => ::core::fmt::Formatter::write_str(f, "I128"),
            Self::F16 => ::core::fmt::Formatter::write_str(f, "F16"),
            Self::F32 => ::core::fmt::Formatter::write_str(f, "F32"),
            Self::F64 => ::core::fmt::Formatter::write_str(f, "F64"),
            Self::F128 => ::core::fmt::Formatter::write_str(f, "F128"),
            Self::VecI8(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "VecI8",
                    &__self_0),
            Self::VecI16(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "VecI16",
                    &__self_0),
            Self::VecI32(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "VecI32",
                    &__self_0),
            Self::VecI64(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "VecI64",
                    &__self_0),
            Self::VecI128(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "VecI128", &__self_0),
            Self::VecF16(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "VecF16",
                    &__self_0),
            Self::VecF32(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "VecF32",
                    &__self_0),
            Self::VecF64(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "VecF64",
                    &__self_0),
            Self::VecF128(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "VecF128", &__self_0),
            Self::SveVecI8 =>
                ::core::fmt::Formatter::write_str(f, "SveVecI8"),
            Self::SveVecI16 =>
                ::core::fmt::Formatter::write_str(f, "SveVecI16"),
            Self::SveVecI32 =>
                ::core::fmt::Formatter::write_str(f, "SveVecI32"),
            Self::SveVecI64 =>
                ::core::fmt::Formatter::write_str(f, "SveVecI64"),
            Self::SveVecI128 =>
                ::core::fmt::Formatter::write_str(f, "SveVecI128"),
            Self::SveVecF16 =>
                ::core::fmt::Formatter::write_str(f, "SveVecF16"),
            Self::SveVecF32 =>
                ::core::fmt::Formatter::write_str(f, "SveVecF32"),
            Self::SveVecF64 =>
                ::core::fmt::Formatter::write_str(f, "SveVecF64"),
            Self::SveVecF128 =>
                ::core::fmt::Formatter::write_str(f, "SveVecF128"),
            Self::SveVecBool =>
                ::core::fmt::Formatter::write_str(f, "SveVecBool"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for InlineAsmType {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<u64>;
    }
}Eq, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for InlineAsmType { }
#[automatically_derived]
impl ::core::cmp::PartialEq for InlineAsmType {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::VecI8(__self_0), Self::VecI8(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::VecI16(__self_0), Self::VecI16(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::VecI32(__self_0), Self::VecI32(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::VecI64(__self_0), Self::VecI64(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::VecI128(__self_0), Self::VecI128(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::VecF16(__self_0), Self::VecF16(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::VecF32(__self_0), Self::VecF32(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::VecF64(__self_0), Self::VecF64(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::VecF128(__self_0), Self::VecF128(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq)]
785pub enum InlineAsmType {
786    I8,
787    I16,
788    I32,
789    I64,
790    I128,
791    F16,
792    F32,
793    F64,
794    F128,
795    VecI8(u64),
796    VecI16(u64),
797    VecI32(u64),
798    VecI64(u64),
799    VecI128(u64),
800    VecF16(u64),
801    VecF32(u64),
802    VecF64(u64),
803    VecF128(u64),
804    SveVecI8,
805    SveVecI16,
806    SveVecI32,
807    SveVecI64,
808    SveVecI128,
809    SveVecF16,
810    SveVecF32,
811    SveVecF64,
812    SveVecF128,
813    SveVecBool,
814}
815
816#[derive(#[automatically_derived]
impl ::core::marker::Copy for InlineAsmSize { }Copy, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for InlineAsmSize { }
#[automatically_derived]
impl ::core::clone::Clone for InlineAsmSize {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<u64>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for InlineAsmSize {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::FixedBytes(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "FixedBytes", &__self_0),
            Self::Scalable =>
                ::core::fmt::Formatter::write_str(f, "Scalable"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for InlineAsmSize {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<u64>;
    }
}Eq, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for InlineAsmSize { }
#[automatically_derived]
impl ::core::cmp::PartialEq for InlineAsmSize {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::FixedBytes(__self_0), Self::FixedBytes(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq)]
817pub enum InlineAsmSize {
818    FixedBytes(u64),
819    Scalable,
820}
821
822impl InlineAsmSize {
823    pub fn fixed_size_bytes(self) -> Option<u64> {
824        match self {
825            Self::FixedBytes(size) => Some(size),
826            Self::Scalable => None,
827        }
828    }
829}
830
831impl InlineAsmType {
832    pub fn is_integer(self) -> bool {
833        #[allow(non_exhaustive_omitted_patterns)] match self {
    Self::I8 | Self::I16 | Self::I32 | Self::I64 | Self::I128 => true,
    _ => false,
}matches!(self, Self::I8 | Self::I16 | Self::I32 | Self::I64 | Self::I128)
834    }
835
836    pub fn size(self) -> InlineAsmSize {
837        match self {
838            Self::I8 => InlineAsmSize::FixedBytes(1),
839            Self::I16 | Self::F16 => InlineAsmSize::FixedBytes(2),
840            Self::I32 | Self::F32 => InlineAsmSize::FixedBytes(4),
841            Self::I64 | Self::F64 => InlineAsmSize::FixedBytes(8),
842            Self::I128 | Self::F128 => InlineAsmSize::FixedBytes(16),
843            Self::VecI8(n) => InlineAsmSize::FixedBytes(n),
844            Self::VecI16(n) | Self::VecF16(n) => InlineAsmSize::FixedBytes(n * 2),
845            Self::VecI32(n) | Self::VecF32(n) => InlineAsmSize::FixedBytes(n * 4),
846            Self::VecI64(n) | Self::VecF64(n) => InlineAsmSize::FixedBytes(n * 8),
847            Self::VecI128(n) | Self::VecF128(n) => InlineAsmSize::FixedBytes(n * 16),
848            Self::SveVecI8
849            | Self::SveVecI16
850            | Self::SveVecI32
851            | Self::SveVecI64
852            | Self::SveVecI128
853            | Self::SveVecF16
854            | Self::SveVecF32
855            | Self::SveVecF64
856            | Self::SveVecF128
857            | Self::SveVecBool => InlineAsmSize::Scalable,
858        }
859    }
860}
861
862impl fmt::Display for InlineAsmType {
863    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
864        match *self {
865            Self::I8 => f.write_str("i8"),
866            Self::I16 => f.write_str("i16"),
867            Self::I32 => f.write_str("i32"),
868            Self::I64 => f.write_str("i64"),
869            Self::I128 => f.write_str("i128"),
870            Self::F16 => f.write_str("f16"),
871            Self::F32 => f.write_str("f32"),
872            Self::F64 => f.write_str("f64"),
873            Self::F128 => f.write_str("f128"),
874            Self::VecI8(n) => f.write_fmt(format_args!("i8x{0}", n))write!(f, "i8x{n}"),
875            Self::VecI16(n) => f.write_fmt(format_args!("i16x{0}", n))write!(f, "i16x{n}"),
876            Self::VecI32(n) => f.write_fmt(format_args!("i32x{0}", n))write!(f, "i32x{n}"),
877            Self::VecI64(n) => f.write_fmt(format_args!("i64x{0}", n))write!(f, "i64x{n}"),
878            Self::VecI128(n) => f.write_fmt(format_args!("i128x{0}", n))write!(f, "i128x{n}"),
879            Self::VecF16(n) => f.write_fmt(format_args!("f16x{0}", n))write!(f, "f16x{n}"),
880            Self::VecF32(n) => f.write_fmt(format_args!("f32x{0}", n))write!(f, "f32x{n}"),
881            Self::VecF64(n) => f.write_fmt(format_args!("f64x{0}", n))write!(f, "f64x{n}"),
882            Self::VecF128(n) => f.write_fmt(format_args!("f128x{0}", n))write!(f, "f128x{n}"),
883            Self::SveVecI8 => f.write_str("svint8_t"),
884            Self::SveVecI16 => f.write_str("svint16_t"),
885            Self::SveVecI32 => f.write_str("svint32_t"),
886            Self::SveVecI64 => f.write_str("svint64_t"),
887            Self::SveVecI128 => f.write_str("svint128_t"),
888            Self::SveVecF16 => f.write_str("svfloat26_t"),
889            Self::SveVecF32 => f.write_str("svfloat32_t"),
890            Self::SveVecF64 => f.write_str("svfloat64_t"),
891            Self::SveVecF128 => f.write_str("svfloat128_t"),
892            Self::SveVecBool => f.write_str("svbool_t"),
893        }
894    }
895}
896
897/// Returns the full set of allocatable registers for a given architecture.
898///
899/// The registers are structured as a map containing the set of allocatable
900/// registers in each register class. A particular register may be allocatable
901/// from multiple register classes, in which case it will appear multiple times
902/// in the map.
903// NOTE: This function isn't used at the moment, but is needed to support
904// falling back to an external assembler.
905pub fn allocatable_registers(
906    arch: InlineAsmArch,
907    reloc_model: RelocModel,
908    target_features: &FxIndexSet<Symbol>,
909    target: &crate::spec::Target,
910) -> FxHashMap<InlineAsmRegClass, FxIndexSet<InlineAsmReg>> {
911    match arch {
912        InlineAsmArch::X86 | InlineAsmArch::X86_64 => {
913            let mut map = x86::regclass_map();
914            x86::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
915            map
916        }
917        InlineAsmArch::Arm => {
918            let mut map = arm::regclass_map();
919            arm::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
920            map
921        }
922        InlineAsmArch::AArch64 | InlineAsmArch::Arm64EC => {
923            let mut map = aarch64::regclass_map();
924            aarch64::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
925            map
926        }
927        InlineAsmArch::Amdgpu => {
928            let mut map = amdgpu::regclass_map();
929            amdgpu::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
930            map
931        }
932        InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => {
933            let mut map = riscv::regclass_map();
934            riscv::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
935            map
936        }
937        InlineAsmArch::Nvptx64 => {
938            let mut map = nvptx::regclass_map();
939            nvptx::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
940            map
941        }
942        InlineAsmArch::PowerPC | InlineAsmArch::PowerPC64 => {
943            let mut map = powerpc::regclass_map();
944            powerpc::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
945            map
946        }
947        InlineAsmArch::Hexagon => {
948            let mut map = hexagon::regclass_map();
949            hexagon::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
950            map
951        }
952        InlineAsmArch::LoongArch32 | InlineAsmArch::LoongArch64 => {
953            let mut map = loongarch::regclass_map();
954            loongarch::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
955            map
956        }
957        InlineAsmArch::Mips | InlineAsmArch::Mips64 => {
958            let mut map = mips::regclass_map();
959            mips::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
960            map
961        }
962        InlineAsmArch::S390x => {
963            let mut map = s390x::regclass_map();
964            s390x::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
965            map
966        }
967        InlineAsmArch::Sparc | InlineAsmArch::Sparc64 => {
968            let mut map = sparc::regclass_map();
969            sparc::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
970            map
971        }
972        InlineAsmArch::SpirV => {
973            let mut map = spirv::regclass_map();
974            spirv::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
975            map
976        }
977        InlineAsmArch::Wasm32 | InlineAsmArch::Wasm64 => {
978            let mut map = wasm::regclass_map();
979            wasm::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
980            map
981        }
982        InlineAsmArch::Xtensa => {
983            let mut map = xtensa::regclass_map();
984            xtensa::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
985            map
986        }
987        InlineAsmArch::Bpf => {
988            let mut map = bpf::regclass_map();
989            bpf::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
990            map
991        }
992        InlineAsmArch::Avr => {
993            let mut map = avr::regclass_map();
994            avr::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
995            map
996        }
997        InlineAsmArch::Msp430 => {
998            let mut map = msp430::regclass_map();
999            msp430::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
1000            map
1001        }
1002        InlineAsmArch::M68k => {
1003            let mut map = m68k::regclass_map();
1004            m68k::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
1005            map
1006        }
1007        InlineAsmArch::CSKY => {
1008            let mut map = csky::regclass_map();
1009            csky::fill_reg_map(arch, reloc_model, target_features, target, &mut map);
1010            map
1011        }
1012    }
1013}
1014
1015#[derive(#[automatically_derived]
impl ::core::marker::Copy for InlineAsmClobberAbi { }Copy, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for InlineAsmClobberAbi { }
#[automatically_derived]
impl ::core::clone::Clone for InlineAsmClobberAbi {
    #[inline]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for InlineAsmClobberAbi {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                InlineAsmClobberAbi::X86 => "X86",
                InlineAsmClobberAbi::X86_64Win => "X86_64Win",
                InlineAsmClobberAbi::X86_64SysV => "X86_64SysV",
                InlineAsmClobberAbi::Arm => "Arm",
                InlineAsmClobberAbi::AArch64 => "AArch64",
                InlineAsmClobberAbi::AArch64NoX18 => "AArch64NoX18",
                InlineAsmClobberAbi::Arm64EC => "Arm64EC",
                InlineAsmClobberAbi::Avr => "Avr",
                InlineAsmClobberAbi::RiscV => "RiscV",
                InlineAsmClobberAbi::RiscVE => "RiscVE",
                InlineAsmClobberAbi::LoongArch => "LoongArch",
                InlineAsmClobberAbi::PowerPC => "PowerPC",
                InlineAsmClobberAbi::PowerPCSPE => "PowerPCSPE",
                InlineAsmClobberAbi::S390x => "S390x",
                InlineAsmClobberAbi::Bpf => "Bpf",
                InlineAsmClobberAbi::Msp430 => "Msp430",
                InlineAsmClobberAbi::Xtensa => "Xtensa",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for InlineAsmClobberAbi { }Eq, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for InlineAsmClobberAbi { }
#[automatically_derived]
impl ::core::cmp::PartialEq for InlineAsmClobberAbi {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for InlineAsmClobberAbi {
    #[inline]
    fn partial_cmp(&self, other: &Self)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::cmp::PartialOrd::partial_cmp(&::core::intrinsics::discriminant_value(self),
            &::core::intrinsics::discriminant_value(other))
    }
}PartialOrd, #[automatically_derived]
impl ::core::hash::Hash for InlineAsmClobberAbi {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state)
    }
}Hash)]
1016#[derive(const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            InlineAsmClobberAbi {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                ::std::mem::discriminant(self).stable_hash(__hcx, __hasher);
                match *self {
                    InlineAsmClobberAbi::X86 => {}
                    InlineAsmClobberAbi::X86_64Win => {}
                    InlineAsmClobberAbi::X86_64SysV => {}
                    InlineAsmClobberAbi::Arm => {}
                    InlineAsmClobberAbi::AArch64 => {}
                    InlineAsmClobberAbi::AArch64NoX18 => {}
                    InlineAsmClobberAbi::Arm64EC => {}
                    InlineAsmClobberAbi::Avr => {}
                    InlineAsmClobberAbi::RiscV => {}
                    InlineAsmClobberAbi::RiscVE => {}
                    InlineAsmClobberAbi::LoongArch => {}
                    InlineAsmClobberAbi::PowerPC => {}
                    InlineAsmClobberAbi::PowerPCSPE => {}
                    InlineAsmClobberAbi::S390x => {}
                    InlineAsmClobberAbi::Bpf => {}
                    InlineAsmClobberAbi::Msp430 => {}
                    InlineAsmClobberAbi::Xtensa => {}
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for InlineAsmClobberAbi {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        InlineAsmClobberAbi::X86 => { 0usize }
                        InlineAsmClobberAbi::X86_64Win => { 1usize }
                        InlineAsmClobberAbi::X86_64SysV => { 2usize }
                        InlineAsmClobberAbi::Arm => { 3usize }
                        InlineAsmClobberAbi::AArch64 => { 4usize }
                        InlineAsmClobberAbi::AArch64NoX18 => { 5usize }
                        InlineAsmClobberAbi::Arm64EC => { 6usize }
                        InlineAsmClobberAbi::Avr => { 7usize }
                        InlineAsmClobberAbi::RiscV => { 8usize }
                        InlineAsmClobberAbi::RiscVE => { 9usize }
                        InlineAsmClobberAbi::LoongArch => { 10usize }
                        InlineAsmClobberAbi::PowerPC => { 11usize }
                        InlineAsmClobberAbi::PowerPCSPE => { 12usize }
                        InlineAsmClobberAbi::S390x => { 13usize }
                        InlineAsmClobberAbi::Bpf => { 14usize }
                        InlineAsmClobberAbi::Msp430 => { 15usize }
                        InlineAsmClobberAbi::Xtensa => { 16usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
            }
        }
    };Encodable, const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for InlineAsmClobberAbi {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { InlineAsmClobberAbi::X86 }
                    1usize => { InlineAsmClobberAbi::X86_64Win }
                    2usize => { InlineAsmClobberAbi::X86_64SysV }
                    3usize => { InlineAsmClobberAbi::Arm }
                    4usize => { InlineAsmClobberAbi::AArch64 }
                    5usize => { InlineAsmClobberAbi::AArch64NoX18 }
                    6usize => { InlineAsmClobberAbi::Arm64EC }
                    7usize => { InlineAsmClobberAbi::Avr }
                    8usize => { InlineAsmClobberAbi::RiscV }
                    9usize => { InlineAsmClobberAbi::RiscVE }
                    10usize => { InlineAsmClobberAbi::LoongArch }
                    11usize => { InlineAsmClobberAbi::PowerPC }
                    12usize => { InlineAsmClobberAbi::PowerPCSPE }
                    13usize => { InlineAsmClobberAbi::S390x }
                    14usize => { InlineAsmClobberAbi::Bpf }
                    15usize => { InlineAsmClobberAbi::Msp430 }
                    16usize => { InlineAsmClobberAbi::Xtensa }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `InlineAsmClobberAbi`, expected 0..17, actual {0}",
                                n));
                    }
                }
            }
        }
    };Decodable)]
1017pub enum InlineAsmClobberAbi {
1018    X86,
1019    X86_64Win,
1020    X86_64SysV,
1021    Arm,
1022    AArch64,
1023    AArch64NoX18,
1024    Arm64EC,
1025    Avr,
1026    RiscV,
1027    RiscVE,
1028    LoongArch,
1029    PowerPC,
1030    PowerPCSPE,
1031    S390x,
1032    Bpf,
1033    Msp430,
1034    Xtensa,
1035}
1036
1037impl InlineAsmClobberAbi {
1038    /// Parses a clobber ABI for the given target, or returns a list of supported
1039    /// clobber ABIs for the target.
1040    pub fn parse(
1041        arch: InlineAsmArch,
1042        target: &Target,
1043        target_features: &FxIndexSet<Symbol>,
1044        name: Symbol,
1045    ) -> Result<Self, &'static [&'static str]> {
1046        let name = name.as_str();
1047        match arch {
1048            InlineAsmArch::X86 => match name {
1049                "C" | "system" | "efiapi" | "cdecl" | "stdcall" | "fastcall" => {
1050                    Ok(InlineAsmClobberAbi::X86)
1051                }
1052                _ => Err(&["C", "system", "efiapi", "cdecl", "stdcall", "fastcall"]),
1053            },
1054            InlineAsmArch::X86_64 => match name {
1055                "C" | "system" if !target.is_like_windows => Ok(InlineAsmClobberAbi::X86_64SysV),
1056                "C" | "system" if target.is_like_windows => Ok(InlineAsmClobberAbi::X86_64Win),
1057                "win64" | "efiapi" => Ok(InlineAsmClobberAbi::X86_64Win),
1058                "sysv64" => Ok(InlineAsmClobberAbi::X86_64SysV),
1059                _ => Err(&["C", "system", "efiapi", "win64", "sysv64"]),
1060            },
1061            InlineAsmArch::Arm => match name {
1062                "C" | "system" | "efiapi" | "aapcs" => Ok(InlineAsmClobberAbi::Arm),
1063                _ => Err(&["C", "system", "efiapi", "aapcs"]),
1064            },
1065            InlineAsmArch::AArch64 => match name {
1066                "C" | "system" | "efiapi" => {
1067                    Ok(if aarch64::target_reserves_x18(target, target_features) {
1068                        InlineAsmClobberAbi::AArch64NoX18
1069                    } else {
1070                        InlineAsmClobberAbi::AArch64
1071                    })
1072                }
1073                _ => Err(&["C", "system", "efiapi"]),
1074            },
1075            InlineAsmArch::Arm64EC => match name {
1076                "C" | "system" => Ok(InlineAsmClobberAbi::Arm64EC),
1077                _ => Err(&["C", "system"]),
1078            },
1079            InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => match name {
1080                "C" | "system" | "efiapi" => Ok(if riscv::is_e(target_features) {
1081                    InlineAsmClobberAbi::RiscVE
1082                } else {
1083                    InlineAsmClobberAbi::RiscV
1084                }),
1085                _ => Err(&["C", "system", "efiapi"]),
1086            },
1087            InlineAsmArch::Avr => match name {
1088                "C" | "system" => Ok(InlineAsmClobberAbi::Avr),
1089                _ => Err(&["C", "system"]),
1090            },
1091            InlineAsmArch::LoongArch32 | InlineAsmArch::LoongArch64 => match name {
1092                "C" | "system" | "efiapi" => Ok(InlineAsmClobberAbi::LoongArch),
1093                _ => Err(&["C", "system", "efiapi"]),
1094            },
1095            InlineAsmArch::PowerPC | InlineAsmArch::PowerPC64 => match name {
1096                "C" | "system" => Ok(if powerpc::is_spe(target) {
1097                    InlineAsmClobberAbi::PowerPCSPE
1098                } else {
1099                    InlineAsmClobberAbi::PowerPC
1100                }),
1101                _ => Err(&["C", "system"]),
1102            },
1103            InlineAsmArch::S390x => match name {
1104                "C" | "system" => Ok(InlineAsmClobberAbi::S390x),
1105                _ => Err(&["C", "system"]),
1106            },
1107            InlineAsmArch::Bpf => match name {
1108                "C" | "system" => Ok(InlineAsmClobberAbi::Bpf),
1109                _ => Err(&["C", "system"]),
1110            },
1111            InlineAsmArch::Msp430 => match name {
1112                "C" | "system" => Ok(InlineAsmClobberAbi::Msp430),
1113                _ => Err(&["C", "system"]),
1114            },
1115            InlineAsmArch::Xtensa => match name {
1116                "C" | "system" => Ok(InlineAsmClobberAbi::Xtensa),
1117                _ => Err(&["C", "system"]),
1118            },
1119            _ => Err(&[]),
1120        }
1121    }
1122
1123    /// Returns the set of registers which are clobbered by this ABI.
1124    pub fn clobbered_regs(self) -> &'static [InlineAsmReg] {
1125        macro_rules! clobbered_regs {
1126            ($arch:ident $arch_reg:ident {
1127                $(
1128                    $reg:ident,
1129                )*
1130            }) => {
1131                &[
1132                    $(InlineAsmReg::$arch($arch_reg::$reg),)*
1133                ]
1134            };
1135        }
1136        match self {
1137            InlineAsmClobberAbi::X86 => &[InlineAsmReg::X86(X86InlineAsmReg::ax),
            InlineAsmReg::X86(X86InlineAsmReg::cx),
            InlineAsmReg::X86(X86InlineAsmReg::dx),
            InlineAsmReg::X86(X86InlineAsmReg::xmm0),
            InlineAsmReg::X86(X86InlineAsmReg::xmm1),
            InlineAsmReg::X86(X86InlineAsmReg::xmm2),
            InlineAsmReg::X86(X86InlineAsmReg::xmm3),
            InlineAsmReg::X86(X86InlineAsmReg::xmm4),
            InlineAsmReg::X86(X86InlineAsmReg::xmm5),
            InlineAsmReg::X86(X86InlineAsmReg::xmm6),
            InlineAsmReg::X86(X86InlineAsmReg::xmm7),
            InlineAsmReg::X86(X86InlineAsmReg::k0),
            InlineAsmReg::X86(X86InlineAsmReg::k1),
            InlineAsmReg::X86(X86InlineAsmReg::k2),
            InlineAsmReg::X86(X86InlineAsmReg::k3),
            InlineAsmReg::X86(X86InlineAsmReg::k4),
            InlineAsmReg::X86(X86InlineAsmReg::k5),
            InlineAsmReg::X86(X86InlineAsmReg::k6),
            InlineAsmReg::X86(X86InlineAsmReg::k7),
            InlineAsmReg::X86(X86InlineAsmReg::mm0),
            InlineAsmReg::X86(X86InlineAsmReg::mm1),
            InlineAsmReg::X86(X86InlineAsmReg::mm2),
            InlineAsmReg::X86(X86InlineAsmReg::mm3),
            InlineAsmReg::X86(X86InlineAsmReg::mm4),
            InlineAsmReg::X86(X86InlineAsmReg::mm5),
            InlineAsmReg::X86(X86InlineAsmReg::mm6),
            InlineAsmReg::X86(X86InlineAsmReg::mm7),
            InlineAsmReg::X86(X86InlineAsmReg::st0),
            InlineAsmReg::X86(X86InlineAsmReg::st1),
            InlineAsmReg::X86(X86InlineAsmReg::st2),
            InlineAsmReg::X86(X86InlineAsmReg::st3),
            InlineAsmReg::X86(X86InlineAsmReg::st4),
            InlineAsmReg::X86(X86InlineAsmReg::st5),
            InlineAsmReg::X86(X86InlineAsmReg::st6),
            InlineAsmReg::X86(X86InlineAsmReg::st7)]clobbered_regs! {
1138                X86 X86InlineAsmReg {
1139                    ax, cx, dx,
1140
1141                    xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,
1142
1143                    k0, k1, k2, k3, k4, k5, k6, k7,
1144
1145                    mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7,
1146                    st0, st1, st2, st3, st4, st5, st6, st7,
1147                }
1148            },
1149            InlineAsmClobberAbi::X86_64SysV => &[InlineAsmReg::X86(X86InlineAsmReg::ax),
            InlineAsmReg::X86(X86InlineAsmReg::cx),
            InlineAsmReg::X86(X86InlineAsmReg::dx),
            InlineAsmReg::X86(X86InlineAsmReg::si),
            InlineAsmReg::X86(X86InlineAsmReg::di),
            InlineAsmReg::X86(X86InlineAsmReg::r8),
            InlineAsmReg::X86(X86InlineAsmReg::r9),
            InlineAsmReg::X86(X86InlineAsmReg::r10),
            InlineAsmReg::X86(X86InlineAsmReg::r11),
            InlineAsmReg::X86(X86InlineAsmReg::xmm0),
            InlineAsmReg::X86(X86InlineAsmReg::xmm1),
            InlineAsmReg::X86(X86InlineAsmReg::xmm2),
            InlineAsmReg::X86(X86InlineAsmReg::xmm3),
            InlineAsmReg::X86(X86InlineAsmReg::xmm4),
            InlineAsmReg::X86(X86InlineAsmReg::xmm5),
            InlineAsmReg::X86(X86InlineAsmReg::xmm6),
            InlineAsmReg::X86(X86InlineAsmReg::xmm7),
            InlineAsmReg::X86(X86InlineAsmReg::xmm8),
            InlineAsmReg::X86(X86InlineAsmReg::xmm9),
            InlineAsmReg::X86(X86InlineAsmReg::xmm10),
            InlineAsmReg::X86(X86InlineAsmReg::xmm11),
            InlineAsmReg::X86(X86InlineAsmReg::xmm12),
            InlineAsmReg::X86(X86InlineAsmReg::xmm13),
            InlineAsmReg::X86(X86InlineAsmReg::xmm14),
            InlineAsmReg::X86(X86InlineAsmReg::xmm15),
            InlineAsmReg::X86(X86InlineAsmReg::zmm16),
            InlineAsmReg::X86(X86InlineAsmReg::zmm17),
            InlineAsmReg::X86(X86InlineAsmReg::zmm18),
            InlineAsmReg::X86(X86InlineAsmReg::zmm19),
            InlineAsmReg::X86(X86InlineAsmReg::zmm20),
            InlineAsmReg::X86(X86InlineAsmReg::zmm21),
            InlineAsmReg::X86(X86InlineAsmReg::zmm22),
            InlineAsmReg::X86(X86InlineAsmReg::zmm23),
            InlineAsmReg::X86(X86InlineAsmReg::zmm24),
            InlineAsmReg::X86(X86InlineAsmReg::zmm25),
            InlineAsmReg::X86(X86InlineAsmReg::zmm26),
            InlineAsmReg::X86(X86InlineAsmReg::zmm27),
            InlineAsmReg::X86(X86InlineAsmReg::zmm28),
            InlineAsmReg::X86(X86InlineAsmReg::zmm29),
            InlineAsmReg::X86(X86InlineAsmReg::zmm30),
            InlineAsmReg::X86(X86InlineAsmReg::zmm31),
            InlineAsmReg::X86(X86InlineAsmReg::k0),
            InlineAsmReg::X86(X86InlineAsmReg::k1),
            InlineAsmReg::X86(X86InlineAsmReg::k2),
            InlineAsmReg::X86(X86InlineAsmReg::k3),
            InlineAsmReg::X86(X86InlineAsmReg::k4),
            InlineAsmReg::X86(X86InlineAsmReg::k5),
            InlineAsmReg::X86(X86InlineAsmReg::k6),
            InlineAsmReg::X86(X86InlineAsmReg::k7),
            InlineAsmReg::X86(X86InlineAsmReg::mm0),
            InlineAsmReg::X86(X86InlineAsmReg::mm1),
            InlineAsmReg::X86(X86InlineAsmReg::mm2),
            InlineAsmReg::X86(X86InlineAsmReg::mm3),
            InlineAsmReg::X86(X86InlineAsmReg::mm4),
            InlineAsmReg::X86(X86InlineAsmReg::mm5),
            InlineAsmReg::X86(X86InlineAsmReg::mm6),
            InlineAsmReg::X86(X86InlineAsmReg::mm7),
            InlineAsmReg::X86(X86InlineAsmReg::st0),
            InlineAsmReg::X86(X86InlineAsmReg::st1),
            InlineAsmReg::X86(X86InlineAsmReg::st2),
            InlineAsmReg::X86(X86InlineAsmReg::st3),
            InlineAsmReg::X86(X86InlineAsmReg::st4),
            InlineAsmReg::X86(X86InlineAsmReg::st5),
            InlineAsmReg::X86(X86InlineAsmReg::st6),
            InlineAsmReg::X86(X86InlineAsmReg::st7),
            InlineAsmReg::X86(X86InlineAsmReg::tmm0),
            InlineAsmReg::X86(X86InlineAsmReg::tmm1),
            InlineAsmReg::X86(X86InlineAsmReg::tmm2),
            InlineAsmReg::X86(X86InlineAsmReg::tmm3),
            InlineAsmReg::X86(X86InlineAsmReg::tmm4),
            InlineAsmReg::X86(X86InlineAsmReg::tmm5),
            InlineAsmReg::X86(X86InlineAsmReg::tmm6),
            InlineAsmReg::X86(X86InlineAsmReg::tmm7)]clobbered_regs! {
1150                X86 X86InlineAsmReg {
1151                    ax, cx, dx, si, di, r8, r9, r10, r11,
1152
1153                    xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,
1154                    xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,
1155                    zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23,
1156                    zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31,
1157
1158                    k0, k1, k2, k3, k4, k5, k6, k7,
1159
1160                    mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7,
1161                    st0, st1, st2, st3, st4, st5, st6, st7,
1162                    tmm0, tmm1, tmm2, tmm3, tmm4, tmm5, tmm6, tmm7,
1163                }
1164            },
1165            InlineAsmClobberAbi::X86_64Win => &[InlineAsmReg::X86(X86InlineAsmReg::ax),
            InlineAsmReg::X86(X86InlineAsmReg::cx),
            InlineAsmReg::X86(X86InlineAsmReg::dx),
            InlineAsmReg::X86(X86InlineAsmReg::r8),
            InlineAsmReg::X86(X86InlineAsmReg::r9),
            InlineAsmReg::X86(X86InlineAsmReg::r10),
            InlineAsmReg::X86(X86InlineAsmReg::r11),
            InlineAsmReg::X86(X86InlineAsmReg::xmm0),
            InlineAsmReg::X86(X86InlineAsmReg::xmm1),
            InlineAsmReg::X86(X86InlineAsmReg::xmm2),
            InlineAsmReg::X86(X86InlineAsmReg::xmm3),
            InlineAsmReg::X86(X86InlineAsmReg::xmm4),
            InlineAsmReg::X86(X86InlineAsmReg::xmm5),
            InlineAsmReg::X86(X86InlineAsmReg::xmm6),
            InlineAsmReg::X86(X86InlineAsmReg::xmm7),
            InlineAsmReg::X86(X86InlineAsmReg::xmm8),
            InlineAsmReg::X86(X86InlineAsmReg::xmm9),
            InlineAsmReg::X86(X86InlineAsmReg::xmm10),
            InlineAsmReg::X86(X86InlineAsmReg::xmm11),
            InlineAsmReg::X86(X86InlineAsmReg::xmm12),
            InlineAsmReg::X86(X86InlineAsmReg::xmm13),
            InlineAsmReg::X86(X86InlineAsmReg::xmm14),
            InlineAsmReg::X86(X86InlineAsmReg::xmm15),
            InlineAsmReg::X86(X86InlineAsmReg::zmm16),
            InlineAsmReg::X86(X86InlineAsmReg::zmm17),
            InlineAsmReg::X86(X86InlineAsmReg::zmm18),
            InlineAsmReg::X86(X86InlineAsmReg::zmm19),
            InlineAsmReg::X86(X86InlineAsmReg::zmm20),
            InlineAsmReg::X86(X86InlineAsmReg::zmm21),
            InlineAsmReg::X86(X86InlineAsmReg::zmm22),
            InlineAsmReg::X86(X86InlineAsmReg::zmm23),
            InlineAsmReg::X86(X86InlineAsmReg::zmm24),
            InlineAsmReg::X86(X86InlineAsmReg::zmm25),
            InlineAsmReg::X86(X86InlineAsmReg::zmm26),
            InlineAsmReg::X86(X86InlineAsmReg::zmm27),
            InlineAsmReg::X86(X86InlineAsmReg::zmm28),
            InlineAsmReg::X86(X86InlineAsmReg::zmm29),
            InlineAsmReg::X86(X86InlineAsmReg::zmm30),
            InlineAsmReg::X86(X86InlineAsmReg::zmm31),
            InlineAsmReg::X86(X86InlineAsmReg::k0),
            InlineAsmReg::X86(X86InlineAsmReg::k1),
            InlineAsmReg::X86(X86InlineAsmReg::k2),
            InlineAsmReg::X86(X86InlineAsmReg::k3),
            InlineAsmReg::X86(X86InlineAsmReg::k4),
            InlineAsmReg::X86(X86InlineAsmReg::k5),
            InlineAsmReg::X86(X86InlineAsmReg::k6),
            InlineAsmReg::X86(X86InlineAsmReg::k7),
            InlineAsmReg::X86(X86InlineAsmReg::mm0),
            InlineAsmReg::X86(X86InlineAsmReg::mm1),
            InlineAsmReg::X86(X86InlineAsmReg::mm2),
            InlineAsmReg::X86(X86InlineAsmReg::mm3),
            InlineAsmReg::X86(X86InlineAsmReg::mm4),
            InlineAsmReg::X86(X86InlineAsmReg::mm5),
            InlineAsmReg::X86(X86InlineAsmReg::mm6),
            InlineAsmReg::X86(X86InlineAsmReg::mm7),
            InlineAsmReg::X86(X86InlineAsmReg::st0),
            InlineAsmReg::X86(X86InlineAsmReg::st1),
            InlineAsmReg::X86(X86InlineAsmReg::st2),
            InlineAsmReg::X86(X86InlineAsmReg::st3),
            InlineAsmReg::X86(X86InlineAsmReg::st4),
            InlineAsmReg::X86(X86InlineAsmReg::st5),
            InlineAsmReg::X86(X86InlineAsmReg::st6),
            InlineAsmReg::X86(X86InlineAsmReg::st7),
            InlineAsmReg::X86(X86InlineAsmReg::tmm0),
            InlineAsmReg::X86(X86InlineAsmReg::tmm1),
            InlineAsmReg::X86(X86InlineAsmReg::tmm2),
            InlineAsmReg::X86(X86InlineAsmReg::tmm3),
            InlineAsmReg::X86(X86InlineAsmReg::tmm4),
            InlineAsmReg::X86(X86InlineAsmReg::tmm5),
            InlineAsmReg::X86(X86InlineAsmReg::tmm6),
            InlineAsmReg::X86(X86InlineAsmReg::tmm7)]clobbered_regs! {
1166                X86 X86InlineAsmReg {
1167                    // rdi and rsi are callee-saved on windows
1168                    ax, cx, dx, r8, r9, r10, r11,
1169
1170                    // xmm6-xmm15 are callee-saved on windows, but we need to
1171                    // mark them as clobbered anyways because the upper portions
1172                    // of ymm6-ymm15 are volatile.
1173                    xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,
1174                    xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,
1175                    zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23,
1176                    zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31,
1177
1178                    k0, k1, k2, k3, k4, k5, k6, k7,
1179
1180                    mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7,
1181                    st0, st1, st2, st3, st4, st5, st6, st7,
1182                    tmm0, tmm1, tmm2, tmm3, tmm4, tmm5, tmm6, tmm7,
1183                }
1184            },
1185            InlineAsmClobberAbi::AArch64 => &[InlineAsmReg::AArch64(AArch64InlineAsmReg::x0),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x1),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x2),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x3),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x4),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x5),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x6),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x7),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x8),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x9),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x10),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x11),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x12),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x13),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x14),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x15),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x16),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x17),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x18),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x30),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v0),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v1),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v2),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v3),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v4),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v5),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v6),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v7),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v8),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v9),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v10),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v11),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v12),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v13),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v14),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v15),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v16),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v17),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v18),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v19),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v20),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v21),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v22),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v23),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v24),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v25),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v26),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v27),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v28),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v29),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v30),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v31),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p0),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p1),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p2),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p3),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p4),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p5),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p6),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p7),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p8),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p9),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p10),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p11),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p12),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p13),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p14),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p15),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::ffr)]clobbered_regs! {
1186                AArch64 AArch64InlineAsmReg {
1187                    x0, x1, x2, x3, x4, x5, x6, x7,
1188                    x8, x9, x10, x11, x12, x13, x14, x15,
1189                    x16, x17, x18, x30,
1190
1191                    // Technically the low 64 bits of v8-v15 are preserved, but
1192                    // we have no way of expressing this using clobbers.
1193                    v0, v1, v2, v3, v4, v5, v6, v7,
1194                    v8, v9, v10, v11, v12, v13, v14, v15,
1195                    v16, v17, v18, v19, v20, v21, v22, v23,
1196                    v24, v25, v26, v27, v28, v29, v30, v31,
1197
1198                    p0, p1, p2, p3, p4, p5, p6, p7,
1199                    p8, p9, p10, p11, p12, p13, p14, p15,
1200                    ffr,
1201                }
1202            },
1203            InlineAsmClobberAbi::AArch64NoX18 => &[InlineAsmReg::AArch64(AArch64InlineAsmReg::x0),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x1),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x2),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x3),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x4),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x5),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x6),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x7),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x8),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x9),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x10),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x11),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x12),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x13),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x14),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x15),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x16),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x17),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x30),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v0),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v1),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v2),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v3),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v4),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v5),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v6),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v7),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v8),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v9),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v10),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v11),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v12),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v13),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v14),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v15),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v16),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v17),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v18),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v19),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v20),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v21),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v22),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v23),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v24),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v25),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v26),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v27),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v28),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v29),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v30),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v31),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p0),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p1),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p2),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p3),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p4),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p5),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p6),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p7),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p8),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p9),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p10),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p11),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p12),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p13),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p14),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::p15),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::ffr)]clobbered_regs! {
1204                AArch64 AArch64InlineAsmReg {
1205                    x0, x1, x2, x3, x4, x5, x6, x7,
1206                    x8, x9, x10, x11, x12, x13, x14, x15,
1207                    x16, x17, x30,
1208
1209                    // Technically the low 64 bits of v8-v15 are preserved, but
1210                    // we have no way of expressing this using clobbers.
1211                    v0, v1, v2, v3, v4, v5, v6, v7,
1212                    v8, v9, v10, v11, v12, v13, v14, v15,
1213                    v16, v17, v18, v19, v20, v21, v22, v23,
1214                    v24, v25, v26, v27, v28, v29, v30, v31,
1215
1216                    p0, p1, p2, p3, p4, p5, p6, p7,
1217                    p8, p9, p10, p11, p12, p13, p14, p15,
1218                    ffr,
1219                }
1220            },
1221            InlineAsmClobberAbi::Arm64EC => &[InlineAsmReg::AArch64(AArch64InlineAsmReg::x0),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x1),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x2),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x3),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x4),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x5),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x6),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x7),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x8),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x9),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x10),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x11),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x12),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x15),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x16),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x17),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::x30),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v0),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v1),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v2),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v3),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v4),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v5),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v6),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v7),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v8),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v9),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v10),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v11),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v12),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v13),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v14),
            InlineAsmReg::AArch64(AArch64InlineAsmReg::v15)]clobbered_regs! {
1222                AArch64 AArch64InlineAsmReg {
1223                    // x13 and x14 cannot be used in Arm64EC.
1224                    x0, x1, x2, x3, x4, x5, x6, x7,
1225                    x8, x9, x10, x11, x12, x15,
1226                    x16, x17, x30,
1227
1228                    // Technically the low 64 bits of v8-v15 are preserved, but
1229                    // we have no way of expressing this using clobbers.
1230                    v0, v1, v2, v3, v4, v5, v6, v7,
1231                    v8, v9, v10, v11, v12, v13, v14, v15,
1232                    // v16-v31, p*, and ffr cannot be used in Arm64EC.
1233                }
1234            },
1235            InlineAsmClobberAbi::Arm => &[InlineAsmReg::Arm(ArmInlineAsmReg::r0),
            InlineAsmReg::Arm(ArmInlineAsmReg::r1),
            InlineAsmReg::Arm(ArmInlineAsmReg::r2),
            InlineAsmReg::Arm(ArmInlineAsmReg::r3),
            InlineAsmReg::Arm(ArmInlineAsmReg::r12),
            InlineAsmReg::Arm(ArmInlineAsmReg::r14),
            InlineAsmReg::Arm(ArmInlineAsmReg::s0),
            InlineAsmReg::Arm(ArmInlineAsmReg::s1),
            InlineAsmReg::Arm(ArmInlineAsmReg::s2),
            InlineAsmReg::Arm(ArmInlineAsmReg::s3),
            InlineAsmReg::Arm(ArmInlineAsmReg::s4),
            InlineAsmReg::Arm(ArmInlineAsmReg::s5),
            InlineAsmReg::Arm(ArmInlineAsmReg::s6),
            InlineAsmReg::Arm(ArmInlineAsmReg::s7),
            InlineAsmReg::Arm(ArmInlineAsmReg::s8),
            InlineAsmReg::Arm(ArmInlineAsmReg::s9),
            InlineAsmReg::Arm(ArmInlineAsmReg::s10),
            InlineAsmReg::Arm(ArmInlineAsmReg::s11),
            InlineAsmReg::Arm(ArmInlineAsmReg::s12),
            InlineAsmReg::Arm(ArmInlineAsmReg::s13),
            InlineAsmReg::Arm(ArmInlineAsmReg::s14),
            InlineAsmReg::Arm(ArmInlineAsmReg::s15),
            InlineAsmReg::Arm(ArmInlineAsmReg::d16),
            InlineAsmReg::Arm(ArmInlineAsmReg::d17),
            InlineAsmReg::Arm(ArmInlineAsmReg::d18),
            InlineAsmReg::Arm(ArmInlineAsmReg::d19),
            InlineAsmReg::Arm(ArmInlineAsmReg::d20),
            InlineAsmReg::Arm(ArmInlineAsmReg::d21),
            InlineAsmReg::Arm(ArmInlineAsmReg::d22),
            InlineAsmReg::Arm(ArmInlineAsmReg::d23),
            InlineAsmReg::Arm(ArmInlineAsmReg::d24),
            InlineAsmReg::Arm(ArmInlineAsmReg::d25),
            InlineAsmReg::Arm(ArmInlineAsmReg::d26),
            InlineAsmReg::Arm(ArmInlineAsmReg::d27),
            InlineAsmReg::Arm(ArmInlineAsmReg::d28),
            InlineAsmReg::Arm(ArmInlineAsmReg::d29),
            InlineAsmReg::Arm(ArmInlineAsmReg::d30),
            InlineAsmReg::Arm(ArmInlineAsmReg::d31)]clobbered_regs! {
1236                Arm ArmInlineAsmReg {
1237                    // r9 is either platform-reserved or callee-saved. Either
1238                    // way we don't need to clobber it.
1239                    r0, r1, r2, r3, r12, r14,
1240
1241                    // The finest-grained register variant is used here so that
1242                    // partial uses of larger registers are properly handled.
1243                    s0, s1, s2, s3, s4, s5, s6, s7,
1244                    s8, s9, s10, s11, s12, s13, s14, s15,
1245                    // s16-s31 are callee-saved
1246                    d16, d17, d18, d19, d20, d21, d22, d23,
1247                    d24, d25, d26, d27, d28, d29, d30, d31,
1248                }
1249            },
1250            InlineAsmClobberAbi::Avr => &[InlineAsmReg::Avr(AvrInlineAsmReg::r18),
            InlineAsmReg::Avr(AvrInlineAsmReg::r19),
            InlineAsmReg::Avr(AvrInlineAsmReg::r20),
            InlineAsmReg::Avr(AvrInlineAsmReg::r21),
            InlineAsmReg::Avr(AvrInlineAsmReg::r22),
            InlineAsmReg::Avr(AvrInlineAsmReg::r23),
            InlineAsmReg::Avr(AvrInlineAsmReg::r24),
            InlineAsmReg::Avr(AvrInlineAsmReg::r25),
            InlineAsmReg::Avr(AvrInlineAsmReg::r26),
            InlineAsmReg::Avr(AvrInlineAsmReg::r27),
            InlineAsmReg::Avr(AvrInlineAsmReg::r30),
            InlineAsmReg::Avr(AvrInlineAsmReg::r31)]clobbered_regs! {
1251                Avr AvrInlineAsmReg {
1252                    // The list of "Call-Used Registers" according to
1253                    // https://gcc.gnu.org/wiki/avr-gcc#Call-Used_Registers
1254
1255                    // Clobbered registers available in inline assembly
1256                    r18, r19, r20, r21, r22, r23, r24, r25, r26, r27, r30, r31,
1257                    // As per the AVR-GCC-ABI documentation linked above, the R0
1258                    // register is a clobbered register as well. Since we don't
1259                    // allow the usage of R0 in inline assembly, nothing has to
1260                    // be done here.
1261                    // Likewise, the T-flag in the SREG should be clobbered, but
1262                    // this is not necessary to be listed here, since the SREG
1263                    // is considered clobbered anyways unless `preserve_flags`
1264                    // is used.
1265                }
1266            },
1267            InlineAsmClobberAbi::RiscV => &[InlineAsmReg::RiscV(RiscVInlineAsmReg::x1),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x5),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x6),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x7),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x10),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x11),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x12),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x13),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x14),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x15),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x16),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x17),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x28),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x29),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x30),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x31),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f0),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f1),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f2),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f3),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f4),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f5),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f6),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f7),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f10),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f11),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f12),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f13),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f14),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f15),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f16),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f17),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f28),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f29),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f30),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f31),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v0),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v1),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v2),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v3),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v4),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v5),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v6),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v7),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v8),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v9),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v10),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v11),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v12),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v13),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v14),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v15),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v16),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v17),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v18),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v19),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v20),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v21),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v22),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v23),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v24),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v25),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v26),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v27),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v28),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v29),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v30),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v31)]clobbered_regs! {
1268                RiscV RiscVInlineAsmReg {
1269                    // ra
1270                    x1,
1271                    // t0-t2
1272                    x5, x6, x7,
1273                    // a0-a7
1274                    x10, x11, x12, x13, x14, x15, x16, x17,
1275                    // t3-t6
1276                    x28, x29, x30, x31,
1277                    // ft0-ft7
1278                    f0, f1, f2, f3, f4, f5, f6, f7,
1279                    // fa0-fa7
1280                    f10, f11, f12, f13, f14, f15, f16, f17,
1281                    // ft8-ft11
1282                    f28, f29, f30, f31,
1283
1284                    v0, v1, v2, v3, v4, v5, v6, v7,
1285                    v8, v9, v10, v11, v12, v13, v14, v15,
1286                    v16, v17, v18, v19, v20, v21, v22, v23,
1287                    v24, v25, v26, v27, v28, v29, v30, v31,
1288                }
1289            },
1290            InlineAsmClobberAbi::RiscVE => &[InlineAsmReg::RiscV(RiscVInlineAsmReg::x1),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x5),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x6),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x7),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x10),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x11),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x12),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x13),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x14),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::x15),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f0),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f1),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f2),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f3),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f4),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f5),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f6),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f7),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f10),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f11),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f12),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f13),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f14),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f15),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f16),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f17),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f28),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f29),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f30),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::f31),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v0),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v1),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v2),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v3),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v4),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v5),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v6),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v7),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v8),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v9),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v10),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v11),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v12),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v13),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v14),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v15),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v16),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v17),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v18),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v19),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v20),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v21),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v22),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v23),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v24),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v25),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v26),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v27),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v28),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v29),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v30),
            InlineAsmReg::RiscV(RiscVInlineAsmReg::v31)]clobbered_regs! {
1291                RiscV RiscVInlineAsmReg {
1292                    // Refs:
1293                    // - ILP32E https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/draft-20240829-13bfa9f54634cb60d86b9b333e109f077805b4b3/riscv-cc.adoc#ilp32e-calling-convention
1294                    // - LP64E https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/299
1295
1296                    // ra
1297                    x1,
1298                    // t0-t2
1299                    x5, x6, x7,
1300                    // a0-a5
1301                    x10, x11, x12, x13, x14, x15,
1302                    // ft0-ft7
1303                    f0, f1, f2, f3, f4, f5, f6, f7,
1304                    // fa0-fa7
1305                    f10, f11, f12, f13, f14, f15, f16, f17,
1306                    // ft8-ft11
1307                    f28, f29, f30, f31,
1308
1309                    v0, v1, v2, v3, v4, v5, v6, v7,
1310                    v8, v9, v10, v11, v12, v13, v14, v15,
1311                    v16, v17, v18, v19, v20, v21, v22, v23,
1312                    v24, v25, v26, v27, v28, v29, v30, v31,
1313                }
1314            },
1315            InlineAsmClobberAbi::LoongArch => &[InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r1),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r4),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r5),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r6),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r7),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r8),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r9),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r10),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r11),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r12),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r13),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r14),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r15),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r16),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r17),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r18),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r19),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::r20),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f0),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f1),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f2),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f3),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f4),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f5),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f6),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f7),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f8),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f9),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f10),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f11),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f12),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f13),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f14),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f15),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f16),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f17),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f18),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f19),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f20),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f21),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f22),
            InlineAsmReg::LoongArch(LoongArchInlineAsmReg::f23)]clobbered_regs! {
1316                LoongArch LoongArchInlineAsmReg {
1317                    // ra
1318                    r1,
1319                    // a0-a7
1320                    r4, r5, r6, r7, r8, r9, r10, r11,
1321                    // t0-t8
1322                    r12, r13, r14, r15, r16, r17, r18, r19, r20,
1323                    // fa0-fa7
1324                    f0, f1, f2, f3, f4, f5, f6, f7,
1325                    // ft0-ft15
1326                    f8, f9, f10, f11, f12, f13, f14, f15,
1327                    f16, f17, f18, f19, f20, f21, f22, f23,
1328                }
1329            },
1330            InlineAsmClobberAbi::PowerPC => &[InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r0),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r3),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r4),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r5),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r6),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r7),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r8),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r9),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r10),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r11),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r12),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f0),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f1),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f2),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f3),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f4),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f5),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f6),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f7),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f8),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f9),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f10),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f11),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f12),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::f13),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs0),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs1),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs2),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs3),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs4),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs5),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs6),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs7),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs8),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs9),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs10),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs11),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs12),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs13),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs14),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs15),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs16),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs17),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs18),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs19),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs20),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs21),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs22),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs23),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs24),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs25),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs26),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs27),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs28),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs29),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs30),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::vs31),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v0),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v1),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v2),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v3),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v4),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v5),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v6),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v7),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v8),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v9),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v10),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v11),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v12),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v13),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v14),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v15),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v16),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v17),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v18),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::v19),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::cr0),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::cr1),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::cr5),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::cr6),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::cr7),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::ctr),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::lr),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::xer)]clobbered_regs! {
1331                PowerPC PowerPCInlineAsmReg {
1332                    // Refs:
1333                    // - PPC32 SysV: "3.2. Function Calling Sequence" in Power Architecture® 32-bit Application Binary Interface Supplement 1.0 - Linux® & Embedded
1334                    //   https://web.archive.org/web/20120608163804/https://www.power.org/resources/downloads/Power-Arch-32-bit-ABI-supp-1.0-Unified.pdf
1335                    // - PPC64 ELFv1: "3.2. Function Calling Sequence" in 64-bit PowerPC ELF Application Binary Interface Supplement 1.9
1336                    //   https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#FUNC-CALL
1337                    // - PPC64 ELFv2: "2.2 Function Calling Sequence" in 64-Bit ELF V2 ABI Specification: Power Architecture, Revision 1.5
1338                    //   https://openpowerfoundation.org/specifications/64bitelfabi/
1339                    // - AIX:
1340                    //   - Register usage and conventions
1341                    //     https://www.ibm.com/docs/en/aix/7.3?topic=overview-register-usage-conventions
1342                    //   - Special registers in the PowerPC®
1343                    //     https://www.ibm.com/docs/en/aix/7.3?topic=overview-special-registers-in-powerpc
1344                    //   - AIX vector programming
1345                    //     https://www.ibm.com/docs/en/aix/7.3?topic=concepts-aix-vector-programming
1346
1347                    // r0, r3-r12
1348                    r0,
1349                    r3, r4, r5, r6, r7,
1350                    r8, r9, r10, r11, r12,
1351
1352                    // f0-f13 and their vsx overlays.
1353                    f0, f1, f2, f3, f4, f5, f6, f7,
1354                    f8, f9, f10, f11, f12, f13,
1355                    vs0, vs1, vs2, vs3, vs4, vs5, vs6, vs7,
1356                    vs8, vs9, vs10, vs11, vs12, vs13,
1357
1358                    // vs14-31, the fpr portion is saved, but the rest of the register is volatile.
1359                    // We can't express that here, so mark the entire vsx register as volatile.
1360                    vs14, vs15, vs16, vs17, vs18, vs19, vs20,
1361                    vs21, vs22, vs23, vs24, vs25, vs26, vs27,
1362                    vs28, vs29, vs30, vs31,
1363
1364                    // v0-v19
1365                    v0, v1, v2, v3, v4, v5, v6, v7,
1366                    v8, v9, v10, v11, v12, v13, v14,
1367                    v15, v16, v17, v18, v19,
1368
1369                    // cr0-cr1, cr5-cr7, ctr, lr, xer
1370                    cr0, cr1,
1371                    cr5, cr6, cr7,
1372                    ctr,
1373                    lr,
1374                    xer,
1375                }
1376            },
1377            InlineAsmClobberAbi::PowerPCSPE => &[InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r0),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r3),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r4),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r5),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r6),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r7),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r8),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r9),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r10),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r11),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::r12),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::cr0),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::cr1),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::cr5),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::cr6),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::cr7),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::ctr),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::lr),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::xer),
            InlineAsmReg::PowerPC(PowerPCInlineAsmReg::spe_acc)]clobbered_regs! {
1378                PowerPC PowerPCInlineAsmReg {
1379                    // r0, r3-r12
1380                    r0,
1381                    r3, r4, r5, r6, r7,
1382                    r8, r9, r10, r11, r12,
1383
1384                    // cr0-cr1, cr5-cr7, ctr, lr, xer, spe_acc
1385                    cr0, cr1,
1386                    cr5, cr6, cr7,
1387                    ctr,
1388                    lr,
1389                    xer,
1390                    spe_acc,
1391                }
1392            },
1393            InlineAsmClobberAbi::S390x => &[InlineAsmReg::S390x(S390xInlineAsmReg::r0),
            InlineAsmReg::S390x(S390xInlineAsmReg::r1),
            InlineAsmReg::S390x(S390xInlineAsmReg::r2),
            InlineAsmReg::S390x(S390xInlineAsmReg::r3),
            InlineAsmReg::S390x(S390xInlineAsmReg::r4),
            InlineAsmReg::S390x(S390xInlineAsmReg::r5),
            InlineAsmReg::S390x(S390xInlineAsmReg::r14),
            InlineAsmReg::S390x(S390xInlineAsmReg::f0),
            InlineAsmReg::S390x(S390xInlineAsmReg::f1),
            InlineAsmReg::S390x(S390xInlineAsmReg::f2),
            InlineAsmReg::S390x(S390xInlineAsmReg::f3),
            InlineAsmReg::S390x(S390xInlineAsmReg::f4),
            InlineAsmReg::S390x(S390xInlineAsmReg::f5),
            InlineAsmReg::S390x(S390xInlineAsmReg::f6),
            InlineAsmReg::S390x(S390xInlineAsmReg::f7),
            InlineAsmReg::S390x(S390xInlineAsmReg::v0),
            InlineAsmReg::S390x(S390xInlineAsmReg::v1),
            InlineAsmReg::S390x(S390xInlineAsmReg::v2),
            InlineAsmReg::S390x(S390xInlineAsmReg::v3),
            InlineAsmReg::S390x(S390xInlineAsmReg::v4),
            InlineAsmReg::S390x(S390xInlineAsmReg::v5),
            InlineAsmReg::S390x(S390xInlineAsmReg::v6),
            InlineAsmReg::S390x(S390xInlineAsmReg::v7),
            InlineAsmReg::S390x(S390xInlineAsmReg::v8),
            InlineAsmReg::S390x(S390xInlineAsmReg::v9),
            InlineAsmReg::S390x(S390xInlineAsmReg::v10),
            InlineAsmReg::S390x(S390xInlineAsmReg::v11),
            InlineAsmReg::S390x(S390xInlineAsmReg::v12),
            InlineAsmReg::S390x(S390xInlineAsmReg::v13),
            InlineAsmReg::S390x(S390xInlineAsmReg::v14),
            InlineAsmReg::S390x(S390xInlineAsmReg::v15),
            InlineAsmReg::S390x(S390xInlineAsmReg::v16),
            InlineAsmReg::S390x(S390xInlineAsmReg::v17),
            InlineAsmReg::S390x(S390xInlineAsmReg::v18),
            InlineAsmReg::S390x(S390xInlineAsmReg::v19),
            InlineAsmReg::S390x(S390xInlineAsmReg::v20),
            InlineAsmReg::S390x(S390xInlineAsmReg::v21),
            InlineAsmReg::S390x(S390xInlineAsmReg::v22),
            InlineAsmReg::S390x(S390xInlineAsmReg::v23),
            InlineAsmReg::S390x(S390xInlineAsmReg::v24),
            InlineAsmReg::S390x(S390xInlineAsmReg::v25),
            InlineAsmReg::S390x(S390xInlineAsmReg::v26),
            InlineAsmReg::S390x(S390xInlineAsmReg::v27),
            InlineAsmReg::S390x(S390xInlineAsmReg::v28),
            InlineAsmReg::S390x(S390xInlineAsmReg::v29),
            InlineAsmReg::S390x(S390xInlineAsmReg::v30),
            InlineAsmReg::S390x(S390xInlineAsmReg::v31),
            InlineAsmReg::S390x(S390xInlineAsmReg::a2),
            InlineAsmReg::S390x(S390xInlineAsmReg::a3),
            InlineAsmReg::S390x(S390xInlineAsmReg::a4),
            InlineAsmReg::S390x(S390xInlineAsmReg::a5),
            InlineAsmReg::S390x(S390xInlineAsmReg::a6),
            InlineAsmReg::S390x(S390xInlineAsmReg::a7),
            InlineAsmReg::S390x(S390xInlineAsmReg::a8),
            InlineAsmReg::S390x(S390xInlineAsmReg::a9),
            InlineAsmReg::S390x(S390xInlineAsmReg::a10),
            InlineAsmReg::S390x(S390xInlineAsmReg::a11),
            InlineAsmReg::S390x(S390xInlineAsmReg::a12),
            InlineAsmReg::S390x(S390xInlineAsmReg::a13),
            InlineAsmReg::S390x(S390xInlineAsmReg::a14),
            InlineAsmReg::S390x(S390xInlineAsmReg::a15)]clobbered_regs! {
1394                S390x S390xInlineAsmReg {
1395                    r0, r1, r2, r3, r4, r5,
1396                    r14,
1397
1398                    // f0-f7, v0-v7
1399                    f0, f1, f2, f3, f4, f5, f6, f7,
1400                    v0, v1, v2, v3, v4, v5, v6, v7,
1401
1402                    // Technically the left halves of v8-v15 (i.e., f8-f15) are saved, but
1403                    // we have no way of expressing this using clobbers.
1404                    v8, v9, v10, v11, v12, v13, v14, v15,
1405
1406                    // Other vector registers are volatile
1407                    v16, v17, v18, v19, v20, v21, v22, v23,
1408                    v24, v25, v26, v27, v28, v29, v30, v31,
1409
1410                    // a0-a1 are reserved, other access registers are volatile
1411                    a2, a3, a4, a5, a6, a7,
1412                    a8, a9, a10, a11, a12, a13, a14, a15,
1413                }
1414            },
1415            InlineAsmClobberAbi::Bpf => &[InlineAsmReg::Bpf(BpfInlineAsmReg::r0),
            InlineAsmReg::Bpf(BpfInlineAsmReg::r1),
            InlineAsmReg::Bpf(BpfInlineAsmReg::r2),
            InlineAsmReg::Bpf(BpfInlineAsmReg::r3),
            InlineAsmReg::Bpf(BpfInlineAsmReg::r4),
            InlineAsmReg::Bpf(BpfInlineAsmReg::r5)]clobbered_regs! {
1416                Bpf BpfInlineAsmReg {
1417                    // Refs: Section 1.1 "Registers and calling convention" in BPF ABI Recommended Conventions and Guidelines v1.0
1418                    // https://www.kernel.org/doc/html/latest/bpf/standardization/abi.html#registers-and-calling-convention
1419
1420                    r0, r1, r2, r3, r4, r5,
1421                }
1422            },
1423            InlineAsmClobberAbi::Msp430 => &[InlineAsmReg::Msp430(Msp430InlineAsmReg::r11),
            InlineAsmReg::Msp430(Msp430InlineAsmReg::r12),
            InlineAsmReg::Msp430(Msp430InlineAsmReg::r13),
            InlineAsmReg::Msp430(Msp430InlineAsmReg::r14),
            InlineAsmReg::Msp430(Msp430InlineAsmReg::r15)]clobbered_regs! {
1424                Msp430 Msp430InlineAsmReg {
1425                    r11, r12, r13, r14, r15,
1426                }
1427            },
1428            InlineAsmClobberAbi::Xtensa => &[InlineAsmReg::Xtensa(XtensaInlineAsmReg::a2),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::a3),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::a4),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::a5),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::a6),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::a7),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::a8),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::a9),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::a10),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::a11),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f0),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f1),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f2),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f3),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f4),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f5),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f6),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f7),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f8),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f9),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f10),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f11),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f12),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f13),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f14),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::f15),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::sar),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::scompare1),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::lbeg),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::lend),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::lcount),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::acclo),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::acchi),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::m0),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::m1),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::m2),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::m3),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b0),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b1),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b2),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b3),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b4),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b5),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b6),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b7),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b8),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b9),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b10),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b11),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b12),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b13),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b14),
            InlineAsmReg::Xtensa(XtensaInlineAsmReg::b15)]clobbered_regs! {
1429                Xtensa XtensaInlineAsmReg {
1430                    // Refs:
1431                    // - Xtensa ISA Reference Manual, Section 8.1.4 & 8.1.6
1432                    // - "Except for LITBASE, all non-privileged special registers are
1433                    //   caller-saved."
1434
1435                    // Caller-saved general-purpose registers (a2-a11).
1436                    // a0 is the return address (reserved by LLVM).
1437                    // a1/sp is the stack pointer (reserved by LLVM).
1438                    // a12-a15 are callee-saved.
1439                    a2, a3, a4, a5, a6, a7,
1440                    a8, a9, a10, a11,
1441
1442                    // All floating-point registers are caller-saved.
1443                    f0, f1, f2, f3, f4, f5, f6, f7,
1444                    f8, f9, f10, f11, f12, f13, f14, f15,
1445
1446                    // SAR (Shift Amount Register) - caller-saved, always present.
1447                    sar,
1448
1449                    // SCOMPARE1 - caller-saved (s32c1i option).
1450                    scompare1,
1451
1452                    // Loop registers - caller-saved (loop option).
1453                    lbeg, lend, lcount,
1454
1455                    // MAC16 registers - caller-saved (mac16 option).
1456                    acclo, acchi,
1457                    m0, m1, m2, m3,
1458
1459                    // Boolean registers - caller-saved (boolean option).
1460                    b0, b1, b2, b3, b4, b5, b6, b7,
1461                    b8, b9, b10, b11, b12, b13, b14, b15,
1462                }
1463            },
1464        }
1465    }
1466}