pub struct Narrowed {
pub name: &'static str,
pub into: &'static str,
pub writes: u32,
}Expand description
One instruction that writes a constant, and the narrower one that writes the same register.
Narrower means fewer bytes of the number written out, and on this machine it also means fewer bytes of instruction: the sixty-four bit move carries a prefix byte saying so and the thirty-two bit move does not, and a number too wide to sign extend from thirty-two bits is written out whole where the narrower instruction writes four bytes of it.
It says the same thing only for the numbers the narrower instruction can hold and only on a
machine where writing part of a register clears the rest of it, which is why Narrowed::writes
is here rather than the pass working the range out from the name.
Fields§
§name: &'static strThe opcode that takes the constant.
into: &'static strThe opcode that takes the same constant in fewer bytes.
writes: u32How many bits of the register the narrower opcode writes. The rest of the register is cleared rather than left alone, so the two say the same thing for a number that is not negative and fits in this many bits, and disagree for every other number.