aklomp / base64

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

enc: asm: add memory and flags as clobbers #118

Closed aklomp closed 1 year ago

aklomp commented 1 year ago

Add the memory and flags ("cc") as clobbers to all assembly encoder implementations. This informs the compiler that the assembly will access an unspecified amount of memory and will modify the flags. The compiler will not use any dangling references to memory or keep a cached copy of the flags register.

In tests, the compilers seem to output the exact same code as before, so this should have no functional impact beyond ensuring correctness.