#include <fast_mem.h>
Nevrax France
Definition at line 44 of file fast_mem.h.
Static Public Member Functions | |
void * | memcpySSE (void *dst, const void *src, size_t nbytes) |
void | precache (const void *src, uint nbytes) |
void | precacheMMX (const void *src, uint nbytes) |
void | precacheSSE (const void *src, uint nbytes) |
Static Public Attributes | |
void *(* | memcpy )(void *dts, const void *src, size_t nbytes) |
|
Fast memcpy using SSE instructions: prefetchnta and movntq. Can be called only if SSE and MMX is supported NB: Copy per block of 4K through L1 cache Result is typically 420 Mo/s instead of 150 Mo/s. Definition at line 205 of file fast_mem.cpp.
00206 { 00207 // Use std memcpy. 00208 return memcpy(dst, src, nbytes); 00209 } |
|
Fast precaching of memory in L1 cache using SSE or MMX where available (NB: others methods don't do the test) nbytes should not override 4K Definition at line 218 of file fast_mem.cpp.
00219 {
00220 // no-op.
00221 }
|
|
Fast precaching of memory in L1 cache using MMX instructions only: movq Result is typically 720 Mo/s (surely slower because of overhead). Hence prefer precacheSSE() when available. nbytes should not override 4K Definition at line 214 of file fast_mem.cpp.
00215 {
00216 // no-op.
00217 }
|
|
Fast precaching of memory in L1 cache using MMX/SSE instructions: movq and prefetchnta Result is typically 880 Mo/s (surely slower because of overhead). nbytes should not override 4K Definition at line 210 of file fast_mem.cpp.
00211 {
00212 // no-op.
00213 }
|
|
This is a function pointer that points on the best memcpy function available depending of the OS and proc. In the best case, it will use memcpySSE(), and in worst case, it'll use the libc memcpy() Simply use it this way: CFastMem::memcpy(dst, src, size); Definition at line 239 of file fast_mem.cpp. Referenced by NLSOUND::CContextSoundContainer< NbJoker, UseRandom, Shift >::init(), and memcpySSE(). |