Charged native pointwise signed array operations #
Both operands are read before the output store, so exact input/output aliases are valid. The enclosing array loop is responsible for proving that earlier stores preserve unread input cells. The numerical premises here concern only the two original values and addresses.
The arithmetic workspace, index and address are the only body modifications.
Instances For
@[instance_reducible]
theorem Cslib.WordRAM.Signed.ArrayArithmetic.exec_body {w : ℕ} (subtract : Bool) (x : Data 16) (a b : ℤ) (ha : GenericRAM.Signed.Fits w a) (hb : GenericRAM.Signed.Fits w b) (hA : x.mem (x.regs Reg.inputA + x.regs Reg.index) = encode a) (hB : x.mem (x.regs Reg.inputB + x.regs Reg.index) = encode b) (haddrA : Fits (w + 2) (x.regs Reg.inputA + x.regs Reg.index)) (haddrB : Fits (w + 2) (x.regs Reg.inputB + x.regs Reg.index)) (haddrOut : Fits (w + 2) (x.regs Reg.output + x.regs Reg.index)) (hnext : Fits (w + 2) (x.regs Reg.index + 1)) (hone : x.regs Reg.one = 1) :
One complete pointwise operation costs at most twenty-four native instructions.