| 319 | #pragma optimize("", off) |
| 320 | #endif |
| 321 | SZ_PUBLIC void sz_fill_serial(sz_ptr_t target, sz_size_t length, sz_u8_t value) { |
| 322 | sz_ptr_t end = target + length; |
| 323 | // Dealing with short strings, a single sequential pass would be faster. |
| 324 | // If the size is larger than 2 words, then at least 1 of them will be aligned. |
| 325 | // But just one aligned word may not be worth SWAR. |
| 326 | if (length < SZ_SWAR_THRESHOLD) |
| 327 | while (target != end) *(target++) = value; |
| 328 | |
| 329 | // In case of long strings, skip unaligned bytes, and then fill the rest in 64-bit chunks. |
| 330 | else { |
| 331 | sz_u64_t value64 = (sz_u64_t)value * 0x0101010101010101ull; |
| 332 | while ((sz_size_t)target & 7ull) *(target++) = value; |
| 333 | while (target + 8 <= end) *(sz_u64_t *)target = value64, target += 8; |
| 334 | while (target != end) *(target++) = value; |
| 335 | } |
| 336 | } |
| 337 | #if defined(_MSC_VER) && defined(SZ_OVERRIDE_LIBC) && SZ_OVERRIDE_LIBC |
| 338 | #pragma optimize("", on) |
| 339 | #endif |
no outgoing calls
no test coverage detected
searching dependent graphs…