Skip to main content

rustc_target/asm/
xtensa.rs

1use std::fmt;
2
3use rustc_data_structures::fx::FxIndexSet;
4use rustc_span::{Symbol, kw, sym};
5
6use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
7use crate::spec::{RelocModel, Target};
8
9#[allow(non_camel_case_types)]
pub enum XtensaInlineAsmRegClass { reg, freg, sreg, breg, }
#[automatically_derived]
#[allow(non_camel_case_types)]
impl ::core::marker::Copy for XtensaInlineAsmRegClass { }
#[automatically_derived]
#[doc(hidden)]
#[allow(non_camel_case_types)]
unsafe impl ::core::clone::TrivialClone for XtensaInlineAsmRegClass { }
#[automatically_derived]
#[allow(non_camel_case_types)]
impl ::core::clone::Clone for XtensaInlineAsmRegClass {
    #[inline]
    fn clone(&self) -> XtensaInlineAsmRegClass { *self }
}
const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for XtensaInlineAsmRegClass {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        XtensaInlineAsmRegClass::reg => { 0usize }
                        XtensaInlineAsmRegClass::freg => { 1usize }
                        XtensaInlineAsmRegClass::sreg => { 2usize }
                        XtensaInlineAsmRegClass::breg => { 3usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    XtensaInlineAsmRegClass::reg => {}
                    XtensaInlineAsmRegClass::freg => {}
                    XtensaInlineAsmRegClass::sreg => {}
                    XtensaInlineAsmRegClass::breg => {}
                }
            }
        }
    };
const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for XtensaInlineAsmRegClass {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { XtensaInlineAsmRegClass::reg }
                    1usize => { XtensaInlineAsmRegClass::freg }
                    2usize => { XtensaInlineAsmRegClass::sreg }
                    3usize => { XtensaInlineAsmRegClass::breg }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `XtensaInlineAsmRegClass`, expected 0..4, actual {0}",
                                n));
                    }
                }
            }
        }
    };
#[automatically_derived]
#[allow(non_camel_case_types)]
impl ::core::fmt::Debug for XtensaInlineAsmRegClass {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                XtensaInlineAsmRegClass::reg => "reg",
                XtensaInlineAsmRegClass::freg => "freg",
                XtensaInlineAsmRegClass::sreg => "sreg",
                XtensaInlineAsmRegClass::breg => "breg",
            })
    }
}
#[automatically_derived]
#[allow(non_camel_case_types)]
impl ::core::cmp::Eq for XtensaInlineAsmRegClass {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
#[allow(non_camel_case_types)]
impl ::core::marker::StructuralPartialEq for XtensaInlineAsmRegClass { }
#[automatically_derived]
#[allow(non_camel_case_types)]
impl ::core::cmp::PartialEq for XtensaInlineAsmRegClass {
    #[inline]
    fn eq(&self, other: &XtensaInlineAsmRegClass) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
#[allow(non_camel_case_types)]
impl ::core::cmp::PartialOrd for XtensaInlineAsmRegClass {
    #[inline]
    fn partial_cmp(&self, other: &XtensaInlineAsmRegClass)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}
#[automatically_derived]
#[allow(non_camel_case_types)]
impl ::core::hash::Hash for XtensaInlineAsmRegClass {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            XtensaInlineAsmRegClass {
            #[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 {
                    XtensaInlineAsmRegClass::reg => {}
                    XtensaInlineAsmRegClass::freg => {}
                    XtensaInlineAsmRegClass::sreg => {}
                    XtensaInlineAsmRegClass::breg => {}
                }
            }
        }
    };
impl XtensaInlineAsmRegClass {
    pub fn name(self) -> rustc_span::Symbol {
        match self {
            Self::reg => rustc_span::sym::reg,
            Self::freg => rustc_span::sym::freg,
            Self::sreg => rustc_span::sym::sreg,
            Self::breg => rustc_span::sym::breg,
        }
    }
    pub fn parse(name: rustc_span::Symbol)
        -> Result<Self, &'static [rustc_span::Symbol]> {
        match name {
            rustc_span::sym::reg => Ok(Self::reg),
            rustc_span::sym::freg => Ok(Self::freg),
            rustc_span::sym::sreg => Ok(Self::sreg),
            rustc_span::sym::breg => Ok(Self::breg),
            _ =>
                Err(&[rustc_span::sym::reg, rustc_span::sym::freg,
                                rustc_span::sym::sreg, rustc_span::sym::breg]),
        }
    }
}
pub(super) fn regclass_map()
    ->
        rustc_data_structures::fx::FxHashMap<super::InlineAsmRegClass,
        rustc_data_structures::fx::FxIndexSet<super::InlineAsmReg>> {
    use rustc_data_structures::fx::FxHashMap;
    use rustc_data_structures::fx::FxIndexSet;
    use super::InlineAsmRegClass;
    let mut map = FxHashMap::default();
    map.insert(InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg),
        FxIndexSet::default());
    map.insert(InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg),
        FxIndexSet::default());
    map.insert(InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg),
        FxIndexSet::default());
    map.insert(InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg),
        FxIndexSet::default());
    map
}def_reg_class! {
10    Xtensa XtensaInlineAsmRegClass {
11        reg,
12        freg,
13        sreg,
14        breg,
15    }
16}
17
18impl XtensaInlineAsmRegClass {
19    pub fn valid_modifiers(self, _arch: super::InlineAsmArch) -> &'static [char] {
20        &[]
21    }
22
23    pub fn suggest_class(self, _arch: InlineAsmArch, _ty: InlineAsmType) -> Option<Self> {
24        None
25    }
26
27    pub fn suggest_modifier(
28        self,
29        _arch: InlineAsmArch,
30        _ty: InlineAsmType,
31    ) -> Option<ModifierInfo> {
32        None
33    }
34
35    pub fn default_modifier(self, _arch: InlineAsmArch) -> Option<ModifierInfo> {
36        None
37    }
38
39    pub fn supported_types(
40        self,
41        _arch: InlineAsmArch,
42    ) -> &'static [(InlineAsmType, Option<Symbol>)] {
43        match self {
44            Self::reg => {
    use super::InlineAsmType::*;
    &[(I8, None), (I16, None), (I32, None)]
}types! { _: I8, I16, I32; },
45            Self::freg => {
    use super::InlineAsmType::*;
    &[(F32, Some(rustc_span::sym::fp))]
}types! { fp: F32; },
46            Self::sreg | Self::breg => &[],
47        }
48    }
49}
50
51fn has_fp(
52    _arch: InlineAsmArch,
53    _reloc_model: RelocModel,
54    target_features: &FxIndexSet<Symbol>,
55    _target: &Target,
56    _is_clobber: bool,
57) -> Result<(), &'static str> {
58    if target_features.contains(&sym::fp) {
59        Ok(())
60    } else {
61        Err("target does not support floating point registers")
62    }
63}
64
65// The frame pointer is a7 under the windowed ABI and a15 otherwise. Always
66// reject it as an inline asm operand: LLVM can force its use for variable-
67// sized stack frames (e.g. via cross-language LTO with C).
68fn frame_pointer_a7(
69    _arch: InlineAsmArch,
70    _reloc_model: RelocModel,
71    target_features: &FxIndexSet<Symbol>,
72    _target: &Target,
73    _is_clobber: bool,
74) -> Result<(), &'static str> {
75    if target_features.contains(&sym::windowed) {
76        Err("the frame pointer (a7) cannot be used as an operand for inline asm")
77    } else {
78        Ok(())
79    }
80}
81
82fn frame_pointer_a15(
83    _arch: InlineAsmArch,
84    _reloc_model: RelocModel,
85    target_features: &FxIndexSet<Symbol>,
86    _target: &Target,
87    _is_clobber: bool,
88) -> Result<(), &'static str> {
89    if !target_features.contains(&sym::windowed) {
90        Err("the frame pointer (a15) cannot be used as an operand for inline asm")
91    } else {
92        Ok(())
93    }
94}
95
96fn has_bool(
97    _arch: InlineAsmArch,
98    _reloc_model: RelocModel,
99    target_features: &FxIndexSet<Symbol>,
100    _target: &Target,
101    _is_clobber: bool,
102) -> Result<(), &'static str> {
103    if target_features.contains(&sym::bool) {
104        Ok(())
105    } else {
106        Err("target does not support boolean registers")
107    }
108}
109
110fn has_loop(
111    _arch: InlineAsmArch,
112    _reloc_model: RelocModel,
113    target_features: &FxIndexSet<Symbol>,
114    _target: &Target,
115    _is_clobber: bool,
116) -> Result<(), &'static str> {
117    if target_features.contains(&kw::Loop) {
118        Ok(())
119    } else {
120        Err("target does not support loop registers")
121    }
122}
123
124fn has_mac16(
125    _arch: InlineAsmArch,
126    _reloc_model: RelocModel,
127    target_features: &FxIndexSet<Symbol>,
128    _target: &Target,
129    _is_clobber: bool,
130) -> Result<(), &'static str> {
131    if target_features.contains(&sym::mac16) {
132        Ok(())
133    } else {
134        Err("target does not support MAC16 registers")
135    }
136}
137
138fn has_s32c1i(
139    _arch: InlineAsmArch,
140    _reloc_model: RelocModel,
141    target_features: &FxIndexSet<Symbol>,
142    _target: &Target,
143    _is_clobber: bool,
144) -> Result<(), &'static str> {
145    if target_features.contains(&sym::s32c1i) {
146        Ok(())
147    } else {
148        Err("target does not support the s32c1i instruction")
149    }
150}
151
152#[allow(unreachable_code)]
#[allow(non_camel_case_types)]
pub enum XtensaInlineAsmReg {
    a2,
    a3,
    a4,
    a5,
    a6,
    a7,
    a8,
    a9,
    a10,
    a11,
    a12,
    a13,
    a14,
    a15,
    f0,
    f1,
    f2,
    f3,
    f4,
    f5,
    f6,
    f7,
    f8,
    f9,
    f10,
    f11,
    f12,
    f13,
    f14,
    f15,
    sar,
    scompare1,
    lbeg,
    lend,
    lcount,
    acclo,
    acchi,
    m0,
    m1,
    m2,
    m3,
    b0,
    b1,
    b2,
    b3,
    b4,
    b5,
    b6,
    b7,
    b8,
    b9,
    b10,
    b11,
    b12,
    b13,
    b14,
    b15,
}
#[automatically_derived]
#[allow(unreachable_code)]
#[allow(non_camel_case_types)]
impl ::core::marker::Copy for XtensaInlineAsmReg { }
#[automatically_derived]
#[doc(hidden)]
#[allow(unreachable_code)]
#[allow(non_camel_case_types)]
unsafe impl ::core::clone::TrivialClone for XtensaInlineAsmReg { }
#[automatically_derived]
#[allow(unreachable_code)]
#[allow(non_camel_case_types)]
impl ::core::clone::Clone for XtensaInlineAsmReg {
    #[inline]
    fn clone(&self) -> XtensaInlineAsmReg { *self }
}
const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for XtensaInlineAsmReg {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        XtensaInlineAsmReg::a2 => { 0usize }
                        XtensaInlineAsmReg::a3 => { 1usize }
                        XtensaInlineAsmReg::a4 => { 2usize }
                        XtensaInlineAsmReg::a5 => { 3usize }
                        XtensaInlineAsmReg::a6 => { 4usize }
                        XtensaInlineAsmReg::a7 => { 5usize }
                        XtensaInlineAsmReg::a8 => { 6usize }
                        XtensaInlineAsmReg::a9 => { 7usize }
                        XtensaInlineAsmReg::a10 => { 8usize }
                        XtensaInlineAsmReg::a11 => { 9usize }
                        XtensaInlineAsmReg::a12 => { 10usize }
                        XtensaInlineAsmReg::a13 => { 11usize }
                        XtensaInlineAsmReg::a14 => { 12usize }
                        XtensaInlineAsmReg::a15 => { 13usize }
                        XtensaInlineAsmReg::f0 => { 14usize }
                        XtensaInlineAsmReg::f1 => { 15usize }
                        XtensaInlineAsmReg::f2 => { 16usize }
                        XtensaInlineAsmReg::f3 => { 17usize }
                        XtensaInlineAsmReg::f4 => { 18usize }
                        XtensaInlineAsmReg::f5 => { 19usize }
                        XtensaInlineAsmReg::f6 => { 20usize }
                        XtensaInlineAsmReg::f7 => { 21usize }
                        XtensaInlineAsmReg::f8 => { 22usize }
                        XtensaInlineAsmReg::f9 => { 23usize }
                        XtensaInlineAsmReg::f10 => { 24usize }
                        XtensaInlineAsmReg::f11 => { 25usize }
                        XtensaInlineAsmReg::f12 => { 26usize }
                        XtensaInlineAsmReg::f13 => { 27usize }
                        XtensaInlineAsmReg::f14 => { 28usize }
                        XtensaInlineAsmReg::f15 => { 29usize }
                        XtensaInlineAsmReg::sar => { 30usize }
                        XtensaInlineAsmReg::scompare1 => { 31usize }
                        XtensaInlineAsmReg::lbeg => { 32usize }
                        XtensaInlineAsmReg::lend => { 33usize }
                        XtensaInlineAsmReg::lcount => { 34usize }
                        XtensaInlineAsmReg::acclo => { 35usize }
                        XtensaInlineAsmReg::acchi => { 36usize }
                        XtensaInlineAsmReg::m0 => { 37usize }
                        XtensaInlineAsmReg::m1 => { 38usize }
                        XtensaInlineAsmReg::m2 => { 39usize }
                        XtensaInlineAsmReg::m3 => { 40usize }
                        XtensaInlineAsmReg::b0 => { 41usize }
                        XtensaInlineAsmReg::b1 => { 42usize }
                        XtensaInlineAsmReg::b2 => { 43usize }
                        XtensaInlineAsmReg::b3 => { 44usize }
                        XtensaInlineAsmReg::b4 => { 45usize }
                        XtensaInlineAsmReg::b5 => { 46usize }
                        XtensaInlineAsmReg::b6 => { 47usize }
                        XtensaInlineAsmReg::b7 => { 48usize }
                        XtensaInlineAsmReg::b8 => { 49usize }
                        XtensaInlineAsmReg::b9 => { 50usize }
                        XtensaInlineAsmReg::b10 => { 51usize }
                        XtensaInlineAsmReg::b11 => { 52usize }
                        XtensaInlineAsmReg::b12 => { 53usize }
                        XtensaInlineAsmReg::b13 => { 54usize }
                        XtensaInlineAsmReg::b14 => { 55usize }
                        XtensaInlineAsmReg::b15 => { 56usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    XtensaInlineAsmReg::a2 => {}
                    XtensaInlineAsmReg::a3 => {}
                    XtensaInlineAsmReg::a4 => {}
                    XtensaInlineAsmReg::a5 => {}
                    XtensaInlineAsmReg::a6 => {}
                    XtensaInlineAsmReg::a7 => {}
                    XtensaInlineAsmReg::a8 => {}
                    XtensaInlineAsmReg::a9 => {}
                    XtensaInlineAsmReg::a10 => {}
                    XtensaInlineAsmReg::a11 => {}
                    XtensaInlineAsmReg::a12 => {}
                    XtensaInlineAsmReg::a13 => {}
                    XtensaInlineAsmReg::a14 => {}
                    XtensaInlineAsmReg::a15 => {}
                    XtensaInlineAsmReg::f0 => {}
                    XtensaInlineAsmReg::f1 => {}
                    XtensaInlineAsmReg::f2 => {}
                    XtensaInlineAsmReg::f3 => {}
                    XtensaInlineAsmReg::f4 => {}
                    XtensaInlineAsmReg::f5 => {}
                    XtensaInlineAsmReg::f6 => {}
                    XtensaInlineAsmReg::f7 => {}
                    XtensaInlineAsmReg::f8 => {}
                    XtensaInlineAsmReg::f9 => {}
                    XtensaInlineAsmReg::f10 => {}
                    XtensaInlineAsmReg::f11 => {}
                    XtensaInlineAsmReg::f12 => {}
                    XtensaInlineAsmReg::f13 => {}
                    XtensaInlineAsmReg::f14 => {}
                    XtensaInlineAsmReg::f15 => {}
                    XtensaInlineAsmReg::sar => {}
                    XtensaInlineAsmReg::scompare1 => {}
                    XtensaInlineAsmReg::lbeg => {}
                    XtensaInlineAsmReg::lend => {}
                    XtensaInlineAsmReg::lcount => {}
                    XtensaInlineAsmReg::acclo => {}
                    XtensaInlineAsmReg::acchi => {}
                    XtensaInlineAsmReg::m0 => {}
                    XtensaInlineAsmReg::m1 => {}
                    XtensaInlineAsmReg::m2 => {}
                    XtensaInlineAsmReg::m3 => {}
                    XtensaInlineAsmReg::b0 => {}
                    XtensaInlineAsmReg::b1 => {}
                    XtensaInlineAsmReg::b2 => {}
                    XtensaInlineAsmReg::b3 => {}
                    XtensaInlineAsmReg::b4 => {}
                    XtensaInlineAsmReg::b5 => {}
                    XtensaInlineAsmReg::b6 => {}
                    XtensaInlineAsmReg::b7 => {}
                    XtensaInlineAsmReg::b8 => {}
                    XtensaInlineAsmReg::b9 => {}
                    XtensaInlineAsmReg::b10 => {}
                    XtensaInlineAsmReg::b11 => {}
                    XtensaInlineAsmReg::b12 => {}
                    XtensaInlineAsmReg::b13 => {}
                    XtensaInlineAsmReg::b14 => {}
                    XtensaInlineAsmReg::b15 => {}
                }
            }
        }
    };
const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for XtensaInlineAsmReg {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { XtensaInlineAsmReg::a2 }
                    1usize => { XtensaInlineAsmReg::a3 }
                    2usize => { XtensaInlineAsmReg::a4 }
                    3usize => { XtensaInlineAsmReg::a5 }
                    4usize => { XtensaInlineAsmReg::a6 }
                    5usize => { XtensaInlineAsmReg::a7 }
                    6usize => { XtensaInlineAsmReg::a8 }
                    7usize => { XtensaInlineAsmReg::a9 }
                    8usize => { XtensaInlineAsmReg::a10 }
                    9usize => { XtensaInlineAsmReg::a11 }
                    10usize => { XtensaInlineAsmReg::a12 }
                    11usize => { XtensaInlineAsmReg::a13 }
                    12usize => { XtensaInlineAsmReg::a14 }
                    13usize => { XtensaInlineAsmReg::a15 }
                    14usize => { XtensaInlineAsmReg::f0 }
                    15usize => { XtensaInlineAsmReg::f1 }
                    16usize => { XtensaInlineAsmReg::f2 }
                    17usize => { XtensaInlineAsmReg::f3 }
                    18usize => { XtensaInlineAsmReg::f4 }
                    19usize => { XtensaInlineAsmReg::f5 }
                    20usize => { XtensaInlineAsmReg::f6 }
                    21usize => { XtensaInlineAsmReg::f7 }
                    22usize => { XtensaInlineAsmReg::f8 }
                    23usize => { XtensaInlineAsmReg::f9 }
                    24usize => { XtensaInlineAsmReg::f10 }
                    25usize => { XtensaInlineAsmReg::f11 }
                    26usize => { XtensaInlineAsmReg::f12 }
                    27usize => { XtensaInlineAsmReg::f13 }
                    28usize => { XtensaInlineAsmReg::f14 }
                    29usize => { XtensaInlineAsmReg::f15 }
                    30usize => { XtensaInlineAsmReg::sar }
                    31usize => { XtensaInlineAsmReg::scompare1 }
                    32usize => { XtensaInlineAsmReg::lbeg }
                    33usize => { XtensaInlineAsmReg::lend }
                    34usize => { XtensaInlineAsmReg::lcount }
                    35usize => { XtensaInlineAsmReg::acclo }
                    36usize => { XtensaInlineAsmReg::acchi }
                    37usize => { XtensaInlineAsmReg::m0 }
                    38usize => { XtensaInlineAsmReg::m1 }
                    39usize => { XtensaInlineAsmReg::m2 }
                    40usize => { XtensaInlineAsmReg::m3 }
                    41usize => { XtensaInlineAsmReg::b0 }
                    42usize => { XtensaInlineAsmReg::b1 }
                    43usize => { XtensaInlineAsmReg::b2 }
                    44usize => { XtensaInlineAsmReg::b3 }
                    45usize => { XtensaInlineAsmReg::b4 }
                    46usize => { XtensaInlineAsmReg::b5 }
                    47usize => { XtensaInlineAsmReg::b6 }
                    48usize => { XtensaInlineAsmReg::b7 }
                    49usize => { XtensaInlineAsmReg::b8 }
                    50usize => { XtensaInlineAsmReg::b9 }
                    51usize => { XtensaInlineAsmReg::b10 }
                    52usize => { XtensaInlineAsmReg::b11 }
                    53usize => { XtensaInlineAsmReg::b12 }
                    54usize => { XtensaInlineAsmReg::b13 }
                    55usize => { XtensaInlineAsmReg::b14 }
                    56usize => { XtensaInlineAsmReg::b15 }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `XtensaInlineAsmReg`, expected 0..57, actual {0}",
                                n));
                    }
                }
            }
        }
    };
#[automatically_derived]
#[allow(unreachable_code)]
#[allow(non_camel_case_types)]
impl ::core::fmt::Debug for XtensaInlineAsmReg {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                XtensaInlineAsmReg::a2 => "a2",
                XtensaInlineAsmReg::a3 => "a3",
                XtensaInlineAsmReg::a4 => "a4",
                XtensaInlineAsmReg::a5 => "a5",
                XtensaInlineAsmReg::a6 => "a6",
                XtensaInlineAsmReg::a7 => "a7",
                XtensaInlineAsmReg::a8 => "a8",
                XtensaInlineAsmReg::a9 => "a9",
                XtensaInlineAsmReg::a10 => "a10",
                XtensaInlineAsmReg::a11 => "a11",
                XtensaInlineAsmReg::a12 => "a12",
                XtensaInlineAsmReg::a13 => "a13",
                XtensaInlineAsmReg::a14 => "a14",
                XtensaInlineAsmReg::a15 => "a15",
                XtensaInlineAsmReg::f0 => "f0",
                XtensaInlineAsmReg::f1 => "f1",
                XtensaInlineAsmReg::f2 => "f2",
                XtensaInlineAsmReg::f3 => "f3",
                XtensaInlineAsmReg::f4 => "f4",
                XtensaInlineAsmReg::f5 => "f5",
                XtensaInlineAsmReg::f6 => "f6",
                XtensaInlineAsmReg::f7 => "f7",
                XtensaInlineAsmReg::f8 => "f8",
                XtensaInlineAsmReg::f9 => "f9",
                XtensaInlineAsmReg::f10 => "f10",
                XtensaInlineAsmReg::f11 => "f11",
                XtensaInlineAsmReg::f12 => "f12",
                XtensaInlineAsmReg::f13 => "f13",
                XtensaInlineAsmReg::f14 => "f14",
                XtensaInlineAsmReg::f15 => "f15",
                XtensaInlineAsmReg::sar => "sar",
                XtensaInlineAsmReg::scompare1 => "scompare1",
                XtensaInlineAsmReg::lbeg => "lbeg",
                XtensaInlineAsmReg::lend => "lend",
                XtensaInlineAsmReg::lcount => "lcount",
                XtensaInlineAsmReg::acclo => "acclo",
                XtensaInlineAsmReg::acchi => "acchi",
                XtensaInlineAsmReg::m0 => "m0",
                XtensaInlineAsmReg::m1 => "m1",
                XtensaInlineAsmReg::m2 => "m2",
                XtensaInlineAsmReg::m3 => "m3",
                XtensaInlineAsmReg::b0 => "b0",
                XtensaInlineAsmReg::b1 => "b1",
                XtensaInlineAsmReg::b2 => "b2",
                XtensaInlineAsmReg::b3 => "b3",
                XtensaInlineAsmReg::b4 => "b4",
                XtensaInlineAsmReg::b5 => "b5",
                XtensaInlineAsmReg::b6 => "b6",
                XtensaInlineAsmReg::b7 => "b7",
                XtensaInlineAsmReg::b8 => "b8",
                XtensaInlineAsmReg::b9 => "b9",
                XtensaInlineAsmReg::b10 => "b10",
                XtensaInlineAsmReg::b11 => "b11",
                XtensaInlineAsmReg::b12 => "b12",
                XtensaInlineAsmReg::b13 => "b13",
                XtensaInlineAsmReg::b14 => "b14",
                XtensaInlineAsmReg::b15 => "b15",
            })
    }
}
#[automatically_derived]
#[allow(unreachable_code)]
#[allow(non_camel_case_types)]
impl ::core::cmp::Eq for XtensaInlineAsmReg {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
#[allow(unreachable_code)]
#[allow(non_camel_case_types)]
impl ::core::marker::StructuralPartialEq for XtensaInlineAsmReg { }
#[automatically_derived]
#[allow(unreachable_code)]
#[allow(non_camel_case_types)]
impl ::core::cmp::PartialEq for XtensaInlineAsmReg {
    #[inline]
    fn eq(&self, other: &XtensaInlineAsmReg) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
#[allow(unreachable_code)]
#[allow(non_camel_case_types)]
impl ::core::cmp::PartialOrd for XtensaInlineAsmReg {
    #[inline]
    fn partial_cmp(&self, other: &XtensaInlineAsmReg)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}
#[automatically_derived]
#[allow(unreachable_code)]
#[allow(non_camel_case_types)]
impl ::core::hash::Hash for XtensaInlineAsmReg {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            XtensaInlineAsmReg {
            #[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 {
                    XtensaInlineAsmReg::a2 => {}
                    XtensaInlineAsmReg::a3 => {}
                    XtensaInlineAsmReg::a4 => {}
                    XtensaInlineAsmReg::a5 => {}
                    XtensaInlineAsmReg::a6 => {}
                    XtensaInlineAsmReg::a7 => {}
                    XtensaInlineAsmReg::a8 => {}
                    XtensaInlineAsmReg::a9 => {}
                    XtensaInlineAsmReg::a10 => {}
                    XtensaInlineAsmReg::a11 => {}
                    XtensaInlineAsmReg::a12 => {}
                    XtensaInlineAsmReg::a13 => {}
                    XtensaInlineAsmReg::a14 => {}
                    XtensaInlineAsmReg::a15 => {}
                    XtensaInlineAsmReg::f0 => {}
                    XtensaInlineAsmReg::f1 => {}
                    XtensaInlineAsmReg::f2 => {}
                    XtensaInlineAsmReg::f3 => {}
                    XtensaInlineAsmReg::f4 => {}
                    XtensaInlineAsmReg::f5 => {}
                    XtensaInlineAsmReg::f6 => {}
                    XtensaInlineAsmReg::f7 => {}
                    XtensaInlineAsmReg::f8 => {}
                    XtensaInlineAsmReg::f9 => {}
                    XtensaInlineAsmReg::f10 => {}
                    XtensaInlineAsmReg::f11 => {}
                    XtensaInlineAsmReg::f12 => {}
                    XtensaInlineAsmReg::f13 => {}
                    XtensaInlineAsmReg::f14 => {}
                    XtensaInlineAsmReg::f15 => {}
                    XtensaInlineAsmReg::sar => {}
                    XtensaInlineAsmReg::scompare1 => {}
                    XtensaInlineAsmReg::lbeg => {}
                    XtensaInlineAsmReg::lend => {}
                    XtensaInlineAsmReg::lcount => {}
                    XtensaInlineAsmReg::acclo => {}
                    XtensaInlineAsmReg::acchi => {}
                    XtensaInlineAsmReg::m0 => {}
                    XtensaInlineAsmReg::m1 => {}
                    XtensaInlineAsmReg::m2 => {}
                    XtensaInlineAsmReg::m3 => {}
                    XtensaInlineAsmReg::b0 => {}
                    XtensaInlineAsmReg::b1 => {}
                    XtensaInlineAsmReg::b2 => {}
                    XtensaInlineAsmReg::b3 => {}
                    XtensaInlineAsmReg::b4 => {}
                    XtensaInlineAsmReg::b5 => {}
                    XtensaInlineAsmReg::b6 => {}
                    XtensaInlineAsmReg::b7 => {}
                    XtensaInlineAsmReg::b8 => {}
                    XtensaInlineAsmReg::b9 => {}
                    XtensaInlineAsmReg::b10 => {}
                    XtensaInlineAsmReg::b11 => {}
                    XtensaInlineAsmReg::b12 => {}
                    XtensaInlineAsmReg::b13 => {}
                    XtensaInlineAsmReg::b14 => {}
                    XtensaInlineAsmReg::b15 => {}
                }
            }
        }
    };
impl XtensaInlineAsmReg {
    pub fn name(self) -> &'static str {
        match self {
            Self::a2 => "a2",
            Self::a3 => "a3",
            Self::a4 => "a4",
            Self::a5 => "a5",
            Self::a6 => "a6",
            Self::a7 => "a7",
            Self::a8 => "a8",
            Self::a9 => "a9",
            Self::a10 => "a10",
            Self::a11 => "a11",
            Self::a12 => "a12",
            Self::a13 => "a13",
            Self::a14 => "a14",
            Self::a15 => "a15",
            Self::f0 => "f0",
            Self::f1 => "f1",
            Self::f2 => "f2",
            Self::f3 => "f3",
            Self::f4 => "f4",
            Self::f5 => "f5",
            Self::f6 => "f6",
            Self::f7 => "f7",
            Self::f8 => "f8",
            Self::f9 => "f9",
            Self::f10 => "f10",
            Self::f11 => "f11",
            Self::f12 => "f12",
            Self::f13 => "f13",
            Self::f14 => "f14",
            Self::f15 => "f15",
            Self::sar => "sar",
            Self::scompare1 => "scompare1",
            Self::lbeg => "lbeg",
            Self::lend => "lend",
            Self::lcount => "lcount",
            Self::acclo => "acclo",
            Self::acchi => "acchi",
            Self::m0 => "m0",
            Self::m1 => "m1",
            Self::m2 => "m2",
            Self::m3 => "m3",
            Self::b0 => "b0",
            Self::b1 => "b1",
            Self::b2 => "b2",
            Self::b3 => "b3",
            Self::b4 => "b4",
            Self::b5 => "b5",
            Self::b6 => "b6",
            Self::b7 => "b7",
            Self::b8 => "b8",
            Self::b9 => "b9",
            Self::b10 => "b10",
            Self::b11 => "b11",
            Self::b12 => "b12",
            Self::b13 => "b13",
            Self::b14 => "b14",
            Self::b15 => "b15",
        }
    }
    pub fn reg_class(self) -> XtensaInlineAsmRegClass {
        match self {
            Self::a2 => XtensaInlineAsmRegClass::reg,
            Self::a3 => XtensaInlineAsmRegClass::reg,
            Self::a4 => XtensaInlineAsmRegClass::reg,
            Self::a5 => XtensaInlineAsmRegClass::reg,
            Self::a6 => XtensaInlineAsmRegClass::reg,
            Self::a7 => XtensaInlineAsmRegClass::reg,
            Self::a8 => XtensaInlineAsmRegClass::reg,
            Self::a9 => XtensaInlineAsmRegClass::reg,
            Self::a10 => XtensaInlineAsmRegClass::reg,
            Self::a11 => XtensaInlineAsmRegClass::reg,
            Self::a12 => XtensaInlineAsmRegClass::reg,
            Self::a13 => XtensaInlineAsmRegClass::reg,
            Self::a14 => XtensaInlineAsmRegClass::reg,
            Self::a15 => XtensaInlineAsmRegClass::reg,
            Self::f0 => XtensaInlineAsmRegClass::freg,
            Self::f1 => XtensaInlineAsmRegClass::freg,
            Self::f2 => XtensaInlineAsmRegClass::freg,
            Self::f3 => XtensaInlineAsmRegClass::freg,
            Self::f4 => XtensaInlineAsmRegClass::freg,
            Self::f5 => XtensaInlineAsmRegClass::freg,
            Self::f6 => XtensaInlineAsmRegClass::freg,
            Self::f7 => XtensaInlineAsmRegClass::freg,
            Self::f8 => XtensaInlineAsmRegClass::freg,
            Self::f9 => XtensaInlineAsmRegClass::freg,
            Self::f10 => XtensaInlineAsmRegClass::freg,
            Self::f11 => XtensaInlineAsmRegClass::freg,
            Self::f12 => XtensaInlineAsmRegClass::freg,
            Self::f13 => XtensaInlineAsmRegClass::freg,
            Self::f14 => XtensaInlineAsmRegClass::freg,
            Self::f15 => XtensaInlineAsmRegClass::freg,
            Self::sar => XtensaInlineAsmRegClass::sreg,
            Self::scompare1 => XtensaInlineAsmRegClass::sreg,
            Self::lbeg => XtensaInlineAsmRegClass::sreg,
            Self::lend => XtensaInlineAsmRegClass::sreg,
            Self::lcount => XtensaInlineAsmRegClass::sreg,
            Self::acclo => XtensaInlineAsmRegClass::sreg,
            Self::acchi => XtensaInlineAsmRegClass::sreg,
            Self::m0 => XtensaInlineAsmRegClass::sreg,
            Self::m1 => XtensaInlineAsmRegClass::sreg,
            Self::m2 => XtensaInlineAsmRegClass::sreg,
            Self::m3 => XtensaInlineAsmRegClass::sreg,
            Self::b0 => XtensaInlineAsmRegClass::breg,
            Self::b1 => XtensaInlineAsmRegClass::breg,
            Self::b2 => XtensaInlineAsmRegClass::breg,
            Self::b3 => XtensaInlineAsmRegClass::breg,
            Self::b4 => XtensaInlineAsmRegClass::breg,
            Self::b5 => XtensaInlineAsmRegClass::breg,
            Self::b6 => XtensaInlineAsmRegClass::breg,
            Self::b7 => XtensaInlineAsmRegClass::breg,
            Self::b8 => XtensaInlineAsmRegClass::breg,
            Self::b9 => XtensaInlineAsmRegClass::breg,
            Self::b10 => XtensaInlineAsmRegClass::breg,
            Self::b11 => XtensaInlineAsmRegClass::breg,
            Self::b12 => XtensaInlineAsmRegClass::breg,
            Self::b13 => XtensaInlineAsmRegClass::breg,
            Self::b14 => XtensaInlineAsmRegClass::breg,
            Self::b15 => XtensaInlineAsmRegClass::breg,
        }
    }
    pub fn parse(name: &str) -> Result<Self, &'static str> {
        match name {
            "a2" => Ok(Self::a2),
            "a3" => Ok(Self::a3),
            "a4" => Ok(Self::a4),
            "a5" => Ok(Self::a5),
            "a6" => Ok(Self::a6),
            "a7" => Ok(Self::a7),
            "a8" => Ok(Self::a8),
            "a9" => Ok(Self::a9),
            "a10" => Ok(Self::a10),
            "a11" => Ok(Self::a11),
            "a12" => Ok(Self::a12),
            "a13" => Ok(Self::a13),
            "a14" => Ok(Self::a14),
            "a15" => Ok(Self::a15),
            "f0" => Ok(Self::f0),
            "f1" => Ok(Self::f1),
            "f2" => Ok(Self::f2),
            "f3" => Ok(Self::f3),
            "f4" => Ok(Self::f4),
            "f5" => Ok(Self::f5),
            "f6" => Ok(Self::f6),
            "f7" => Ok(Self::f7),
            "f8" => Ok(Self::f8),
            "f9" => Ok(Self::f9),
            "f10" => Ok(Self::f10),
            "f11" => Ok(Self::f11),
            "f12" => Ok(Self::f12),
            "f13" => Ok(Self::f13),
            "f14" => Ok(Self::f14),
            "f15" => Ok(Self::f15),
            "sar" => Ok(Self::sar),
            "scompare1" => Ok(Self::scompare1),
            "lbeg" => Ok(Self::lbeg),
            "lend" => Ok(Self::lend),
            "lcount" => Ok(Self::lcount),
            "acclo" => Ok(Self::acclo),
            "acchi" => Ok(Self::acchi),
            "m0" => Ok(Self::m0),
            "m1" => Ok(Self::m1),
            "m2" => Ok(Self::m2),
            "m3" => Ok(Self::m3),
            "b0" => Ok(Self::b0),
            "b1" => Ok(Self::b1),
            "b2" => Ok(Self::b2),
            "b3" => Ok(Self::b3),
            "b4" => Ok(Self::b4),
            "b5" => Ok(Self::b5),
            "b6" => Ok(Self::b6),
            "b7" => Ok(Self::b7),
            "b8" => Ok(Self::b8),
            "b9" => Ok(Self::b9),
            "b10" => Ok(Self::b10),
            "b11" => Ok(Self::b11),
            "b12" => Ok(Self::b12),
            "b13" => Ok(Self::b13),
            "b14" => Ok(Self::b14),
            "b15" => Ok(Self::b15),
            "a0" =>
                Err("a0 is used internally by LLVM and cannot be used as an operand for inline asm"),
            "sp" | "a1" =>
                Err("sp is used internally by LLVM and cannot be used as an operand for inline asm"),
            _ => Err("unknown register"),
        }
    }
    pub fn validate(self, _arch: super::InlineAsmArch,
        _reloc_model: crate::spec::RelocModel,
        _target_features: &rustc_data_structures::fx::FxIndexSet<Symbol>,
        _target: &crate::spec::Target, _is_clobber: bool)
        -> Result<(), &'static str> {
        match self {
            Self::a2 => { Ok(()) }
            Self::a3 => { Ok(()) }
            Self::a4 => { Ok(()) }
            Self::a5 => { Ok(()) }
            Self::a6 => { Ok(()) }
            Self::a7 => {
                frame_pointer_a7(_arch, _reloc_model, _target_features,
                        _target, _is_clobber)?;
                Ok(())
            }
            Self::a8 => { Ok(()) }
            Self::a9 => { Ok(()) }
            Self::a10 => { Ok(()) }
            Self::a11 => { Ok(()) }
            Self::a12 => { Ok(()) }
            Self::a13 => { Ok(()) }
            Self::a14 => { Ok(()) }
            Self::a15 => {
                frame_pointer_a15(_arch, _reloc_model, _target_features,
                        _target, _is_clobber)?;
                Ok(())
            }
            Self::f0 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f1 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f2 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f3 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f4 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f5 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f6 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f7 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f8 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f9 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f10 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f11 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f12 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f13 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f14 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::f15 => {
                has_fp(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::sar => { Ok(()) }
            Self::scompare1 => {
                has_s32c1i(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::lbeg => {
                has_loop(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::lend => {
                has_loop(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::lcount => {
                has_loop(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::acclo => {
                has_mac16(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::acchi => {
                has_mac16(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::m0 => {
                has_mac16(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::m1 => {
                has_mac16(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::m2 => {
                has_mac16(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::m3 => {
                has_mac16(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b0 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b1 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b2 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b3 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b4 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b5 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b6 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b7 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b8 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b9 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b10 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b11 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b12 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b13 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b14 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
            Self::b15 => {
                has_bool(_arch, _reloc_model, _target_features, _target,
                        _is_clobber)?;
                Ok(())
            }
        }
    }
}
pub(super) fn fill_reg_map(_arch: super::InlineAsmArch,
    _reloc_model: crate::spec::RelocModel,
    _target_features: &rustc_data_structures::fx::FxIndexSet<Symbol>,
    _target: &crate::spec::Target,
    _map:
        &mut rustc_data_structures::fx::FxHashMap<super::InlineAsmRegClass,
        rustc_data_structures::fx::FxIndexSet<super::InlineAsmReg>>) {
    #[allow(unused_imports)]
    use super::{InlineAsmReg, InlineAsmRegClass};
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a2));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a3));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a4));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a5));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a6));
        }
    }
    if frame_pointer_a7(_arch, _reloc_model, _target_features, _target,
                    false).is_ok() && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a7));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a8));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a9));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a10));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a11));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a12));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a13));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a14));
        }
    }
    if frame_pointer_a15(_arch, _reloc_model, _target_features, _target,
                    false).is_ok() && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::reg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::a15));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f0));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f1));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f2));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f3));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f4));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f5));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f6));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f7));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f8));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f9));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f10));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f11));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f12));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f13));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f14));
        }
    }
    if has_fp(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::freg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::f15));
        }
    }
    if true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::sar));
        }
    }
    if has_s32c1i(_arch, _reloc_model, _target_features, _target,
                    false).is_ok() && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::scompare1));
        }
    }
    if has_loop(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::lbeg));
        }
    }
    if has_loop(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::lend));
        }
    }
    if has_loop(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::lcount));
        }
    }
    if has_mac16(_arch, _reloc_model, _target_features, _target,
                    false).is_ok() && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::acclo));
        }
    }
    if has_mac16(_arch, _reloc_model, _target_features, _target,
                    false).is_ok() && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::acchi));
        }
    }
    if has_mac16(_arch, _reloc_model, _target_features, _target,
                    false).is_ok() && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::m0));
        }
    }
    if has_mac16(_arch, _reloc_model, _target_features, _target,
                    false).is_ok() && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::m1));
        }
    }
    if has_mac16(_arch, _reloc_model, _target_features, _target,
                    false).is_ok() && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::m2));
        }
    }
    if has_mac16(_arch, _reloc_model, _target_features, _target,
                    false).is_ok() && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::sreg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::m3));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b0));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b1));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b2));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b3));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b4));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b5));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b6));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b7));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b8));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b9));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b10));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b11));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b12));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b13));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b14));
        }
    }
    if has_bool(_arch, _reloc_model, _target_features, _target, false).is_ok()
            && true {
        if let Some(set) =
                _map.get_mut(&InlineAsmRegClass::Xtensa(XtensaInlineAsmRegClass::breg))
            {
            set.insert(InlineAsmReg::Xtensa(XtensaInlineAsmReg::b15));
        }
    }
}def_regs! {
153    Xtensa XtensaInlineAsmReg XtensaInlineAsmRegClass {
154        a2: reg = ["a2"],
155        a3: reg = ["a3"],
156        a4: reg = ["a4"],
157        a5: reg = ["a5"],
158        a6: reg = ["a6"],
159        a7: reg = ["a7"] % frame_pointer_a7,
160        a8: reg = ["a8"],
161        a9: reg = ["a9"],
162        a10: reg = ["a10"],
163        a11: reg = ["a11"],
164        a12: reg = ["a12"],
165        a13: reg = ["a13"],
166        a14: reg = ["a14"],
167        a15: reg = ["a15"] % frame_pointer_a15,
168        f0: freg = ["f0"] % has_fp,
169        f1: freg = ["f1"] % has_fp,
170        f2: freg = ["f2"] % has_fp,
171        f3: freg = ["f3"] % has_fp,
172        f4: freg = ["f4"] % has_fp,
173        f5: freg = ["f5"] % has_fp,
174        f6: freg = ["f6"] % has_fp,
175        f7: freg = ["f7"] % has_fp,
176        f8: freg = ["f8"] % has_fp,
177        f9: freg = ["f9"] % has_fp,
178        f10: freg = ["f10"] % has_fp,
179        f11: freg = ["f11"] % has_fp,
180        f12: freg = ["f12"] % has_fp,
181        f13: freg = ["f13"] % has_fp,
182        f14: freg = ["f14"] % has_fp,
183        f15: freg = ["f15"] % has_fp,
184        // Clobber-only special registers (caller-saved per ISA ยง8.1.7, except
185        // LITBASE); needed for `clobber_abi`.
186        sar: sreg = ["sar"],
187        scompare1: sreg = ["scompare1"] % has_s32c1i,
188        lbeg: sreg = ["lbeg"] % has_loop,
189        lend: sreg = ["lend"] % has_loop,
190        lcount: sreg = ["lcount"] % has_loop,
191        acclo: sreg = ["acclo"] % has_mac16,
192        acchi: sreg = ["acchi"] % has_mac16,
193        m0: sreg = ["m0"] % has_mac16,
194        m1: sreg = ["m1"] % has_mac16,
195        m2: sreg = ["m2"] % has_mac16,
196        m3: sreg = ["m3"] % has_mac16,
197        // Clobber-only boolean registers.
198        b0: breg = ["b0"] % has_bool,
199        b1: breg = ["b1"] % has_bool,
200        b2: breg = ["b2"] % has_bool,
201        b3: breg = ["b3"] % has_bool,
202        b4: breg = ["b4"] % has_bool,
203        b5: breg = ["b5"] % has_bool,
204        b6: breg = ["b6"] % has_bool,
205        b7: breg = ["b7"] % has_bool,
206        b8: breg = ["b8"] % has_bool,
207        b9: breg = ["b9"] % has_bool,
208        b10: breg = ["b10"] % has_bool,
209        b11: breg = ["b11"] % has_bool,
210        b12: breg = ["b12"] % has_bool,
211        b13: breg = ["b13"] % has_bool,
212        b14: breg = ["b14"] % has_bool,
213        b15: breg = ["b15"] % has_bool,
214
215        #error = ["a0"] => "a0 is used internally by LLVM and cannot be used as an operand for inline asm",
216        #error = ["sp", "a1"] => "sp is used internally by LLVM and cannot be used as an operand for inline asm",
217    }
218}
219
220impl XtensaInlineAsmReg {
221    pub fn emit(
222        self,
223        out: &mut dyn fmt::Write,
224        _arch: InlineAsmArch,
225        _modifier: Option<char>,
226    ) -> fmt::Result {
227        out.write_str(self.name())
228    }
229}