This commit is contained in:
Daniel Lubarov 2022-07-20 09:45:05 -07:00
parent 78fb34a9b6
commit c7ba4eb6ee
2 changed files with 5 additions and 2 deletions

View File

@ -104,7 +104,7 @@ ec_add_snd_zero:
JUMPDEST JUMPDEST
// stack: x0, y0, x1, y1, retdest // stack: x0, y0, x1, y1, retdest
// Just return (x1,y1) // Just return (x0,y0)
%stack (x0, y0, x1, y1, retdest) -> (retdest, x0, y0) %stack (x0, y0, x1, y1, retdest) -> (retdest, x0, y0)
JUMP JUMP

View File

@ -214,8 +214,11 @@ impl StackOp {
// This is just a rough estimate; we can update it after implementing PUSH. // This is just a rough estimate; we can update it after implementing PUSH.
(bytes, bytes) (bytes, bytes)
} }
Pop => (1, 1), // A POP takes one cycle, and doesn't involve memory, it just decrements a pointer.
Pop => (1, 0),
// A DUP takes one cycle, and a read and a write.
StackOp::Dup(_) => (1, 2), StackOp::Dup(_) => (1, 2),
// A SWAP takes one cycle with four memory ops, to read both values then write to them.
StackOp::Swap(_) => (1, 4), StackOp::Swap(_) => (1, 4),
}; };