shz_memcpy
SHZ_INLINE void* shz_memcpy( void* SHZ_RESTRICT dst, const void* SHZ_RESTRICT src, size_t bytes) SHZ_NOEXCEPT;Generic drop-in fast memcpy() replacement.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
dst | void *SHZ_RESTRICT | |
src | const void *SHZ_RESTRICT | |
bytes | size_t |
Returns
Section titled “Returns”void *
Details
Section titled “Details”Copies bytes from src to dst, determining the most efficient specialization to call into at run-time, returning dst.
There are no alignment or size requirements for this routine, but it is specifically optimized for 2-, 4-, 8-, and 32-byte alignments, with bigger alignments bringing bigger gainz.
- When you know of and can control the
srcanddstalignments and batch sizes, you can micro-optimize by calling into the most specific memcpy() specialization for your given scenario, over just using this generic implementation, which must choose which one to use at run-time.
Warnings
Section titled “Warnings”dstandsrcbuffers should not be overlapping.
Availability
Section titled “Availability”- C++ equivalent:
shz::memcpy - Type-generic form: none
- Back-ends: SH4: dedicated SH4 implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_mem.h:75 - Module: Memory, section "C stdlib Replacements"
See also
Section titled “See also”shz_memcpy1, shz_memcpy2, shz_memcpy4, shz_memcpy8, shz_memcpy32, shz_memcpy64, shz_memcpy128