aklomp / base64

Fast Base64 stream encoder/decoder in C99, with SIMD acceleration
BSD 2-Clause "Simplified" License
865 stars 162 forks source link

AVX: enc: add inline asm codepath #108

Closed aklomp closed 1 year ago

aklomp commented 1 year ago

Issue #104 introduced an inline assembly version of the AVX2 base64 encoder. It turns out that we can reuse this implementation almost verbatim for AVX if we replace the 256-bit AVX2 registers with 128-bit AVX registers. Some small changes are needed, such as changing the stride widths and removing the special handling of the first round, but overall the code remains the same.