Skip to content

Commit da6217f

Browse files
committed
saving
1 parent 5900525 commit da6217f

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

cppcon2025/cppcon_2025_slides.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -680,27 +680,7 @@ int fast_digit_count_64(uint64_t x) {
680680
681681
# Could use SIMD if we wanted to
682682
683-
**Don't try to understand:**
684-
```cpp
685-
__m128i to_string_avx512ifma(uint64_t n) {
686-
uint64_t n_15_08 = n / 100000000;
687-
uint64_t n_07_00 = n % 100000000;
688-
__m512i bcstq_h = _mm512_set1_epi64(n_15_08);
689-
__m512i bcstq_l = _mm512_set1_epi64(n_07_00);
690-
__m512i zmmzero = _mm512_castsi128_si512(_mm_cvtsi64_si128(0x1A1A400));
691-
__m512i zmmTen = _mm512_set1_epi64(10);
692-
__m512i asciiZero = _mm512_set1_epi64('0');
693-
__m512i ifma_const = _mm512_setr_epi64(0x00000000002af31dc, ...);
694-
__m512i permb_const = _mm512_castsi128_si512(_mm_set_epi8(0x78, ...));
695-
__m512i lowbits_h = _mm512_madd52lo_epu64(zmmzero, bcstq_h, ifma_const);
696-
__m512i lowbits_l = _mm512_madd52lo_epu64(zmmzero, bcstq_l, ifma_const);
697-
__m512i highbits_h = _mm512_madd52hi_epu64(asciiZero, zmmTen, lowbits_h);
698-
__m512i highbits_l = _mm512_madd52hi_epu64(asciiZero, zmmTen, lowbits_l);
699-
__m512i perm = _mm512_permutex2var_epi8(highbits_h, permb_const, highbits_l);
700-
__m128i digits_15_0 = _mm512_castsi512_si128(perm);
701-
return digits_15_0;
702-
}
703-
```
683+
- Daniel Lemire, "Converting integers to decimal strings faster with AVX-512," in Daniel Lemire's blog, March 28, 2022, https://lemire.me/blog/2022/03/28/converting-integers-to-decimal-strings-faster-with-avx-512/.
704684
705685
---
706686

0 commit comments

Comments
 (0)