mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-06 15:53:10 +00:00
Move empty_check inside final iteration
This commit is contained in:
parent
605932d149
commit
5d5628b59d
@ -55,8 +55,8 @@ global memcpy_bytes:
|
||||
// Handle small case
|
||||
DUP7
|
||||
// stack: count, DST, SRC, count, retdest
|
||||
%lt_const(0x20)
|
||||
// stack: count < 32, DST, SRC, count, retdest
|
||||
%lt_const(0x21)
|
||||
// stack: count <= 32, DST, SRC, count, retdest
|
||||
%jumpi(memcpy_bytes_finish)
|
||||
|
||||
// We will pack 32 bytes into a U256 from the source, and then unpack it at the destination.
|
||||
|
||||
@ -4,20 +4,11 @@
|
||||
global memset:
|
||||
// stack: DST, count, retdest
|
||||
|
||||
// Handle empty case
|
||||
DUP4
|
||||
// stack: count, DST, count, retdest
|
||||
ISZERO
|
||||
// stack: count == 0, DST, count, retdest
|
||||
%jumpi(memset_bytes_empty)
|
||||
|
||||
// stack: DST, count, retdest
|
||||
|
||||
// Handle small case
|
||||
DUP4
|
||||
// stack: count, DST, count, retdest
|
||||
%lt_const(0x20)
|
||||
// stack: count < 32, DST, count, retdest
|
||||
%lt_const(0x21)
|
||||
// stack: count <= 32, DST, count, retdest
|
||||
%jumpi(memset_finish)
|
||||
|
||||
// stack: DST, count, retdest
|
||||
@ -43,6 +34,15 @@ global memset:
|
||||
%jump(memset)
|
||||
|
||||
memset_finish:
|
||||
// stack: DST, final_count, retdest
|
||||
|
||||
// Handle empty case
|
||||
DUP4
|
||||
// stack: final_count, DST, final_count, retdest
|
||||
ISZERO
|
||||
// stack: final_count == 0, DST, final_count, retdest
|
||||
%jumpi(memset_bytes_empty)
|
||||
|
||||
// stack: DST, final_count, retdest
|
||||
DUP4
|
||||
PUSH 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user