pub enum Undo {
AddLeft,
SubRight,
SubLeft,
Neg,
Not,
Xor,
Zext(u32),
Sext(u32),
}Expand description
Which operation an inverse is being asked for.
Only the ones whose inverse is exact and cheap are here. An and, an or and a multiply have inverses that are either everything or an expensive approximation of everything, and section 10.4’s advice about the ones not worth having applies to them: a wrong answer is a miscompilation and a vague answer is a slow program, so the vague one is what this gives.
Variants§
AddLeft
The left operand of an addition, given the other one.
SubRight
The right operand of a subtraction, given the left one.
SubLeft
The left operand of a subtraction, given the right one.
Neg
The operand of a negation.
Not
The operand of a complement.
Xor
The operand of an exclusive or, given the other one.
Zext(u32)
The operand of a zero extension, at the narrower width.
Sext(u32)
The operand of a sign extension, at the narrower width.