use core::fmt;
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum NumberBase {
Hexadecimal = 0,
Decimal = 1,
Octal = 2,
Binary = 3,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_NUMBER_BASE: [&str; 4] = [
"Hexadecimal",
"Decimal",
"Octal",
"Binary",
];
impl fmt::Debug for NumberBase {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_NUMBER_BASE[*self as usize])?;
Ok(())
}
}
impl Default for NumberBase {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
NumberBase::Hexadecimal
}
}
#[allow(missing_copy_implementations)]
#[allow(missing_debug_implementations)]
pub struct FormatMnemonicOptions;
impl FormatMnemonicOptions {
pub const NONE: u32 = 0x0000_0000;
pub const NO_PREFIXES: u32 = 0x0000_0001;
pub const NO_MNEMONIC: u32 = 0x0000_0002;
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[cfg_attr(all(not(feature = "exhaustive_enums"), has_non_exhaustive), non_exhaustive)]
#[allow(missing_docs)]
pub enum PrefixKind {
ES = 0,
CS = 1,
SS = 2,
DS = 3,
FS = 4,
GS = 5,
Lock = 6,
Rep = 7,
Repe = 8,
Repne = 9,
OperandSize = 10,
AddressSize = 11,
HintNotTaken = 12,
HintTaken = 13,
Bnd = 14,
Notrack = 15,
Xacquire = 16,
Xrelease = 17,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_PREFIX_KIND: [&str; 18] = [
"ES",
"CS",
"SS",
"DS",
"FS",
"GS",
"Lock",
"Rep",
"Repe",
"Repne",
"OperandSize",
"AddressSize",
"HintNotTaken",
"HintTaken",
"Bnd",
"Notrack",
"Xacquire",
"Xrelease",
];
impl fmt::Debug for PrefixKind {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_PREFIX_KIND[*self as usize])?;
Ok(())
}
}
impl Default for PrefixKind {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
PrefixKind::ES
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[cfg_attr(all(not(feature = "exhaustive_enums"), has_non_exhaustive), non_exhaustive)]
pub enum DecoratorKind {
Broadcast = 0,
RoundingControl = 1,
SuppressAllExceptions = 2,
ZeroingMasking = 3,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_DECORATOR_KIND: [&str; 4] = [
"Broadcast",
"RoundingControl",
"SuppressAllExceptions",
"ZeroingMasking",
];
impl fmt::Debug for DecoratorKind {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_DECORATOR_KIND[*self as usize])?;
Ok(())
}
}
impl Default for DecoratorKind {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
DecoratorKind::Broadcast
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[cfg_attr(all(not(feature = "exhaustive_enums"), has_non_exhaustive), non_exhaustive)]
#[allow(missing_docs)]
pub enum NumberKind {
Int8 = 0,
UInt8 = 1,
Int16 = 2,
UInt16 = 3,
Int32 = 4,
UInt32 = 5,
Int64 = 6,
UInt64 = 7,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_NUMBER_KIND: [&str; 8] = [
"Int8",
"UInt8",
"Int16",
"UInt16",
"Int32",
"UInt32",
"Int64",
"UInt64",
];
impl fmt::Debug for NumberKind {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_NUMBER_KIND[*self as usize])?;
Ok(())
}
}
impl Default for NumberKind {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
NumberKind::Int8
}
}
#[derive(Copy, Clone, Eq, PartialEq)]
#[allow(dead_code)]
pub(crate) enum FormatterFlowControl {
AlwaysShortBranch,
ShortBranch,
NearBranch,
NearCall,
FarBranch,
FarCall,
Xbegin,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_FORMATTER_FLOW_CONTROL: [&str; 7] = [
"AlwaysShortBranch",
"ShortBranch",
"NearBranch",
"NearCall",
"FarBranch",
"FarCall",
"Xbegin",
];
impl fmt::Debug for FormatterFlowControl {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_FORMATTER_FLOW_CONTROL[*self as usize])?;
Ok(())
}
}
impl Default for FormatterFlowControl {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
FormatterFlowControl::AlwaysShortBranch
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_b {
b = 0,
c = 1,
nae = 2,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_B: [&str; 3] = [
"b",
"c",
"nae",
];
impl fmt::Debug for CC_b {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_B[*self as usize])?;
Ok(())
}
}
impl Default for CC_b {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_b::b
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_ae {
ae = 0,
nb = 1,
nc = 2,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_AE: [&str; 3] = [
"ae",
"nb",
"nc",
];
impl fmt::Debug for CC_ae {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_AE[*self as usize])?;
Ok(())
}
}
impl Default for CC_ae {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_ae::ae
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_e {
e = 0,
z = 1,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_E: [&str; 2] = [
"e",
"z",
];
impl fmt::Debug for CC_e {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_E[*self as usize])?;
Ok(())
}
}
impl Default for CC_e {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_e::e
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_ne {
ne = 0,
nz = 1,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_NE: [&str; 2] = [
"ne",
"nz",
];
impl fmt::Debug for CC_ne {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_NE[*self as usize])?;
Ok(())
}
}
impl Default for CC_ne {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_ne::ne
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_be {
be = 0,
na = 1,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_BE: [&str; 2] = [
"be",
"na",
];
impl fmt::Debug for CC_be {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_BE[*self as usize])?;
Ok(())
}
}
impl Default for CC_be {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_be::be
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_a {
a = 0,
nbe = 1,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_A: [&str; 2] = [
"a",
"nbe",
];
impl fmt::Debug for CC_a {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_A[*self as usize])?;
Ok(())
}
}
impl Default for CC_a {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_a::a
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_p {
p = 0,
pe = 1,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_P: [&str; 2] = [
"p",
"pe",
];
impl fmt::Debug for CC_p {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_P[*self as usize])?;
Ok(())
}
}
impl Default for CC_p {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_p::p
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_np {
np = 0,
po = 1,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_NP: [&str; 2] = [
"np",
"po",
];
impl fmt::Debug for CC_np {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_NP[*self as usize])?;
Ok(())
}
}
impl Default for CC_np {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_np::np
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_l {
l = 0,
nge = 1,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_L: [&str; 2] = [
"l",
"nge",
];
impl fmt::Debug for CC_l {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_L[*self as usize])?;
Ok(())
}
}
impl Default for CC_l {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_l::l
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_ge {
ge = 0,
nl = 1,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_GE: [&str; 2] = [
"ge",
"nl",
];
impl fmt::Debug for CC_ge {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_GE[*self as usize])?;
Ok(())
}
}
impl Default for CC_ge {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_ge::ge
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_le {
le = 0,
ng = 1,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_LE: [&str; 2] = [
"le",
"ng",
];
impl fmt::Debug for CC_le {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_LE[*self as usize])?;
Ok(())
}
}
impl Default for CC_le {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_le::le
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(non_camel_case_types)]
pub enum CC_g {
g = 0,
nle = 1,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CC_G: [&str; 2] = [
"g",
"nle",
];
impl fmt::Debug for CC_g {
#[inline]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
write!(f, "{}", GEN_DEBUG_CC_G[*self as usize])?;
Ok(())
}
}
impl Default for CC_g {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CC_g::g
}
}