mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 14:23:07 +00:00
Also for memset
This commit is contained in:
parent
83054b0ffe
commit
60811d083f
@ -131,7 +131,7 @@ memcpy_bytes_finish:
|
||||
JUMP
|
||||
|
||||
memcpy_bytes_empty:
|
||||
// stack: DST, SRC, count, retdest
|
||||
// stack: DST, SRC, 0, retdest
|
||||
%pop7
|
||||
// stack: retdest
|
||||
JUMP
|
||||
|
||||
@ -2,12 +2,22 @@
|
||||
// DST = (dst_ctx, dst_segment, dst_addr).
|
||||
// This tuple definition is used for brevity in the stack comments below.
|
||||
global memset:
|
||||
// Handle empty case
|
||||
DUP7
|
||||
// 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
|
||||
%jumpi(memset_finish)
|
||||
|
||||
// stack: DST, count, retdest
|
||||
PUSH 32
|
||||
PUSH 0
|
||||
@ -43,3 +53,9 @@ memset_finish:
|
||||
%pop4
|
||||
// stack: retdest
|
||||
JUMP
|
||||
|
||||
memset_bytes_empty:
|
||||
// stack: DST, 0, retdest
|
||||
%pop4
|
||||
// stack: retdest
|
||||
JUMP
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user