pub trait FlagGroup: Sized + Clone + Copy {
    type FlagType: Flag;
    type FlagClass: FlagClass;

    fn name(&self) -> Cow<'_, str>;
    fn id(&self) -> u32;
    fn flags_required(&self) -> Vec<Self::FlagType>;
    fn flag_conditions(&self) -> HashMap<Self::FlagClass, FlagCondition>;
}

Required Associated Types

Required Methods

Unique identifier for this FlagGroup.

MUST be in the range [0, 0x7fff_ffff]

Returns the list of flags that need to be resolved in order to take the clean flag resolution path – at time of writing, all required flags must have been set by the same instruction, and the ‘querying’ instruction must be reachable from one instruction that sets all of these flags.

Returns the mapping of Semantic Flag Classes to Flag Conditions, in the context of this Flag Group.

Example:

If we have a group representing cr1_lt (as in PowerPC), we would have multiple Semantic Flag Classes used by the different Flag Write Types to represent the different comparisons, so for cr1_lt we would return a mapping along the lines of:

cr1_signed -> LLFC_SLT,
cr1_unsigned -> LLFC_ULT,

This allows the core to recover the semantics of the comparison and inline it into conditional branches when appropriate.

Implementors