MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / memset64_optimized

Function memset64_optimized

LibLemon/src/gfx/graphics.cpp:22–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22inline void memset64_optimized(void* _dest, uint64_t c, size_t count) {
23 uint64_t* dest = reinterpret_cast<uint64_t*>(_dest);
24 if(((size_t)dest & 0x7)){
25 while(count--){
26 *(dest++) = c;
27 }
28 return;
29 }
30
31 size_t overflow = (count & 0x7); // Amount of overflow bytes
32 size_t size_aligned = (count - overflow); // Size rounded DOWN to lowest multiple of 128 bits
33
34 memset64_sse2(dest, c, size_aligned >> 3);
35
36 while(overflow--){
37 *(dest++) = c;
38 }
39}
40
41extern "C"
42void memcpy_optimized(void* dest, void* src, size_t count);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected