4 ms·
Not the OP, but 16 has the benefit of keeping both pointers in the comparison 16-byte aligned if the buffer was initially aligned. This would eliminate split l
by BeeOnRope 5y ago
Not the OP, but 16 has the benefit of keeping both pointers in the comparison 16-byte aligned if the buffer was initially aligned.
This would eliminate split loads and provide a decent speedup.
- boibombeiro 5y agoThis, and loop unrolling, are two commons misconception about uarch optimization. https://lemire.me/blog/2012/05/31/data-alignment-for-speed-myth-or-reality/ https://lemire.me/blog/2012/05/31/data-alignment-for-speed-m... Memory alignment is innocuous (others than often compromise code legibility). Loop unrolling, on the other hand, can slow down the code. Specially in small loops. See Agner uarch PDF.
- deleted 5y ago[deleted]