acompiled

The catalog contains seeded project examples. Your workspace stores your own projects and conversations.

yuki-ito/neon-mem

Public
Star6

memcpy and memset for AArch64, from overlapping loads and LDP/STP Q pairs. Every build checks every size up to 1,024 bytes at all 64 alignments.

8 commits on ca7b8c3c43138e91dbcd35907d31ce7bd24053eb

Commits on Aug 26, 2026

memset: a 65..128 class, like memcpy's
…
The loop starts at the first 16-byte boundary past dst, up to 16 bytes in, so its first 64 bytes can end 80 bytes in. With dst on a 16-byte boundary, every size from 65 to 79 wrote past the end, and each byte of misalignment takes one size off that range: 480 calls in latch's test. memcpy_neon has had this class since it started aligning its loop, for the same reason.
yuki-itoopcode-7agentcommitted

Commits on Aug 25, 2026

Size test: every size from 0 to 1,024 at all 64 alignments
…
Both routines, every size from 0 to 1,024 bytes, at every destination alignment from 0 to 63, with 0xEE guard bytes on both sides of the buffer: 131,200 calls. There is no libc for the target, so the test is freestanding and talks to Linux through svc. The build links it statically and runs it on Linux.

The build is red. 480 memset calls write past the end of the buffer, all of them between 65 and 79 bytes long. memcpy passes every call.
latchagentcommitted

Commits on Aug 18, 2026

memset, built the same way
…
dup puts the byte in every lane of q0. Below 16 bytes it is stored from x6 as overlapping scalars, and 16..64 bytes take two to four overlapping Q stores. Above 64, the first 16 bytes go out unaligned and a 64-byte loop of STP Q pairs starts at the first 16-byte boundary past dst.
opcode-7agentcommitted

Commits on Aug 9, 2026

memcpy: align the destination before the long loop
…
Above 128 bytes, the first 16 bytes go out unaligned and the loop starts at the first 16-byte boundary in dst, so every store in the loop lands on one.

The loop can now start up to 15 bytes in, so its first 64 bytes can end 79 bytes in, past the end of anything shorter. 65..128 gets a class of its own: four Q pairs, two from each end.
yuki-itocommitted

Commits on Aug 2, 2026

memcpy: 64-byte loop of LDP/STP Q pairs
…
Two LDP Q and two STP Q per iteration move 64 bytes, where the old loop moved 16. 33..64 bytes get a class of their own, one Q pair from each end, so the loop only starts above 64 bytes and its first iteration is always whole.
opcode-7agentcommitted

Commits on Jul 25, 2026

memcpy: small sizes from overlapping loads
…
No copy of 32 bytes or fewer runs a loop. 0..16 bytes move as two overlapping scalar loads and stores, one from each end, with 1..3 done as the first, middle and last byte. 17..32 move as two Q registers. Longer copies run 16 bytes at a time and finish with the last 16 bytes from the end.
yuki-itocommitted