Move empty check inside final iteration

This commit is contained in:
Robin Salen 2023-10-30 08:18:47 -04:00
parent 0258ad4a3d
commit c96a8700af
No known key found for this signature in database
GPG Key ID: FB87BACFB3CB2007

View File

@ -52,15 +52,6 @@ global memcpy:
global memcpy_bytes:
// stack: DST, SRC, count, retdest
// Handle empty case
DUP7
// stack: count, DST, SRC, count, retdest
ISZERO
// stack: count == 0, DST, SRC, count, retdest
%jumpi(memcpy_finish)
// stack: DST, SRC, count, retdest
// Handle small case
DUP7
// stack: count, DST, SRC, count, retdest
@ -104,6 +95,15 @@ global memcpy_bytes:
memcpy_bytes_finish:
// stack: DST, SRC, count, retdest
// Handle empty case
DUP7
// stack: count, DST, SRC, count, retdest
ISZERO
// stack: count == 0, DST, SRC, count, retdest
%jumpi(memcpy_finish)
// stack: DST, SRC, count, retdest
// Copy the last chunk of `count` bytes.
DUP7
DUP1