4 ms·
A great technical article, enjoyed reading it and finding out some more details of the platform. Though I think some of the flow graphs are a bit confusing with
by daemin 6y ago
A great technical article, enjoyed reading it and finding out some more details of the platform. Though I think some of the flow graphs are a bit confusing with some of them having signs that I think should be the other way.
Some things I learned from this or was not aware of before:
The instruction "rep stosb" does an optimised 64 byte store if the size is large enough on some platforms, but only if aligned. This makes sense since it should be able to work with whole cache entries at a time.
Compiler unrolling 63 byte memset even when optimising for size (127 byte of less when optimising for speed). I would have thought that this unrolling would produce a larger executable, but I guess it's still worth it for the runtime speedup.
The trick of using multiple unconditional writes to fill a smaller range with values, where the middle portion is overwritten. So writing anywhere from 8 to 15 bytes using two 8 byte write instructions, or doing anywhere from 16 to 63 bytes using 4 16 byte instructions. This is a little bit of a revelation for me on how it was put together, like I knew some of the parts of the solution but might not have figured out how to put it together for a long time.