Skip to main content

encode_candidates

Function encode_candidates 

Source
pub fn encode_candidates(
    specs: &[EncodingSpec],
    candidate_indices: &[u16],
    operands: &[Operand],
) -> Result<InstructionCode, EncodeError>
Expand description

Encodes one mnemonic using a generated shortlist of candidate variant indices.

The shortlist is expected to contain only variants for the same mnemonic. This function keeps strict validation and ambiguity handling while avoiding a full linear scan over all mnemonic variants.

ยงErrors

Returns EncodeError when no candidate can be encoded unambiguously.