3 ms·
I've just tried it and for me GCC 9.2.1 produced either movdqa or movdqu depending on which x64 CPU it is asked to tune for. That seems like it's doing what it
by jlokier 7y ago
I've just tried it and for me GCC 9.2.1 produced either movdqa or movdqu depending on which x64 CPU it is asked to tune for.
That seems like it's doing what it's supposed to.
I also tried a tiny change to the C code using __attribute__((packed)), and it made the compiler output movdqu on the CPU where it was previously using movdqa, admittedly also producing slightly less efficient code.
So again, seems like GCC is doing what it's supposed to.
I'm surprised the author of the article went into obscure arch-specific GCC attributes, and tried things like memcpy(), but didn't try __attribute__((packed)) on a single-element struct, which is arch-independent.