Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request 0xPolygonZero#1316 from topos-protocol/memcpy_tiny
Browse files Browse the repository at this point in the history
Move empty check inside final iteration of memcpy_bytes
  • Loading branch information
Nashtare authored Oct 30, 2023
2 parents af4935c + c96a870 commit 0f299d4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions evm/src/cpu/kernel/asm/memory/memcpy.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0f299d4

Please sign in to comment.