mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-02-21 22:33:09 +00:00
Change add_or_fault macro
This commit is contained in:
parent
1f39c555a9
commit
17a7c57d03
@ -313,14 +313,15 @@ global sys_basefee:
|
||||
%jumpi(fault_exception)
|
||||
%endmacro
|
||||
|
||||
// Adds the two top elements of the stack, and faults in case of overflow.
|
||||
%macro add_or_fault
|
||||
// stack: offset, size, kexit_info, offset, size
|
||||
DUP1
|
||||
%ensure_reasonable_offset
|
||||
// stack: offset, size, kexit_info, offset, size
|
||||
DUP2
|
||||
// stack: size, offset, size, kexit_info, offset, size
|
||||
%ensure_reasonable_offset
|
||||
// stack: offset, size, kexit_info, offset, size
|
||||
ADD
|
||||
// stack: x, y
|
||||
DUP2 ADD
|
||||
// stack: sum, y
|
||||
DUP1 SWAP2
|
||||
// stack: y, sum, sum
|
||||
GT
|
||||
// stack: is_overflow, sum
|
||||
%jumpi(fault_exception)
|
||||
// stack: sum
|
||||
%endmacro
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user