Move empty_check inside final iteration

This commit is contained in:
Robin Salen 2023-11-07 13:29:17 -05:00 committed by Robin Salen
parent 605932d149
commit 5d5628b59d
2 changed files with 13 additions and 13 deletions

View File

@ -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.

View File

@ -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