On Thu, May 06, 2021, Jacob Xu wrote: > > memset() takes a void *, which it casts to an char, i.e. it works on one byte at > a time. > Huh, TIL. Based on this I'd thought that I don't need a cast at all, > but doing so actually results in a movaps instruction. Ewwww. That's likely because emulator.c does: #define memset __builtin_memset and the compiler is clever enough to know that __attribute__((vector_size(16))) means the variable is (supposed to be) aligned. > I've changed the cast back to (uint8_t *). I assume removing the above #define and grabbing memset() from string.c fixes the movaps generation? If so, that has my vote, as opposed to fudging around the compiler by casting to uint8_t *. As evidenced by this issue, using the compiler's memset() in kvm-unit-tests seems inherently dangerous since the tests are often doing intentionally stupid things.