cranelift_codegen::ir::condcodes

Trait CondCode

Source
pub trait CondCode: Copy {
    // Required methods
    fn complement(self) -> Self;
    fn swap_args(self) -> Self;
}
Expand description

Common traits of condition codes.

Required Methods§

Source

fn complement(self) -> Self

Get the complemented condition code of self.

The complemented condition code produces the opposite result for all comparisons. That is, cmp CC, x, y is true if and only if cmp CC.complement(), x, y is false.

Source

fn swap_args(self) -> Self

Get the swapped args condition code for self.

The swapped args condition code produces the same result as swapping x and y in the comparison. That is, cmp CC, x, y is the same as cmp CC.swap_args(), y, x.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§