FS#2069 - Way faster memset() and memcpy() in assembler

Attached to Project: Rockbox
Opened by Jens Arnold (amiconn) - Tuesday, 16 March 2004, 07:56 GMT
Last edited by Jörg Hohensohn (hohensoh) - Thursday, 18 March 2004, 22:23 GMT
Task Type Patches
Status Closed
Assigned To Jörg Hohensohn (hohensoh)
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


New memset(), in assembler:

- approx 50% faster for small blocks (0..4 bytes): less
- 2.2x as fast for long aligned large blocks
- almost 13x as fast for not long aligned large blocks
- 1.9x / 8x for typical 112 byte block
- 28 bytes smaller :)

New memcpy(), in assembler:

- 20..30% fast for small blocks (0..8 bytes): less overhead
- 1,2x to 6.6x as fast for large blocks (depends on source
and destination alignment
- 62 bytes larger :(

Detailed timing test results for both routines can be
found in the attached spreadsheet (open office format).
This task depends upon

Closed by  Jörg Hohensohn (hohensoh)
Thursday, 18 March 2004, 22:23 GMT
Reason for closing:  Accepted
Comment by Jens Arnold (amiconn) - Thursday, 18 March 2004, 00:50 GMT

- Shortened memset() by 4 bytes (stupid thinking)
- Corrected same stupid thinking for memcpy() (no shortening
- Updated timing spreadsheet