pub fn encode_op(spec: &OpSpec, rd: u8, rs1: u8, rs2: u8, imm: i32) -> u32Expand description
Encode op with the given operands. Operands not used by the format are
ignored (e.g. rs2 for Fmt::I, imm for Fmt::Unary). For shift
formats the low bits of imm are the shift amount; for Fmt::U, imm is
the 20-bit upper immediate.