#[repr(u8)]pub enum Condition {
Show 16 variants
Eq = 0,
Ne = 1,
Cs = 2,
Cc = 3,
Mi = 4,
Pl = 5,
Vs = 6,
Vc = 7,
Hi = 8,
Ls = 9,
Ge = 10,
Lt = 11,
Gt = 12,
Le = 13,
Al = 14,
Nv = 15,
}Expand description
AArch64 4-bit condition field (B.<cond>, CSEL, CCMP, …).
name() emits the ARM preferred spelling (cs/cc); differential
comparison additionally accepts the hs/lo synonyms.
Variants§
Eq = 0
Equal (Z == 1).
Ne = 1
Not equal (Z == 0).
Cs = 2
Carry set / unsigned higher-or-same (hs).
Cc = 3
Carry clear / unsigned lower (lo).
Mi = 4
Negative.
Pl = 5
Positive or zero.
Vs = 6
Overflow set.
Vc = 7
Overflow clear.
Hi = 8
Unsigned higher.
Ls = 9
Unsigned lower or same.
Ge = 10
Signed greater than or equal.
Lt = 11
Signed less than.
Gt = 12
Signed greater than.
Le = 13
Signed less than or equal.
Al = 14
Always.
Nv = 15
Always (never as a real condition; B.NV decodes as B.AL).
Implementations§
Source§impl Condition
impl Condition
Sourcepub const fn from_bits(bits: u8) -> Condition
pub const fn from_bits(bits: u8) -> Condition
The condition encoded in a 4-bit field (only the low 4 bits are used).
This is total: every value 0..=15 maps to a variant, and any high bits
of bits are masked off first.
Sourcepub const fn from_u4(bits: u8) -> Condition
pub const fn from_u4(bits: u8) -> Condition
Decode the 4-bit condition field. Alias of Condition::from_bits using
the ARM ARM’s cond<3:0> naming.
Sourcepub const fn as_u4(self) -> u8
pub const fn as_u4(self) -> u8
The raw 4-bit encoding of this condition (0b0000 for EQ …
0b1111 for NV).
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
The ARM-preferred lowercase spelling ("eq", "cs", …), a
&'static str.
Sourcepub const fn invert(self) -> Condition
pub const fn invert(self) -> Condition
The inverted condition, with its low bit flipped (EQ<->NE,
CS<->CC, GE<->LT, …). AL<->NV.
This matches the ARM ARM InvertCond used by alias selection
(CSET/CSETM, CSINC/CINC, …): the encoded value is XORed with 1.
Sourcepub const fn inverted(self) -> Condition
pub const fn inverted(self) -> Condition
Compatibility alias of Condition::invert.