2 ms·
I'd love for you to dive into this one and see where you get. I think this example has a number of confusing layers. My conclusion after staring at it a long t
by nkurz 12y ago
I'd love for you to dive into this one and see where you get. I think this example has a number of confusing layers. My conclusion after staring at it a long time was that the difference between SBB and SUB is that SUB/JNE allows macro fusion and leaves the loop with 4 µops, whereas SBB JNE does not fuse, leaving the loop with 5 µops. Having 5 µops slows the loop down by a cycle, which as you guessed, saves us from a problem caused by issuing the load too soon after the store, although from measuring events, I'm pretty sure this isn't related to store-forwarding. The relevant sections in the Intel Optimization manual are 3.4.2.5 for the µop multiples of 4, and 3.6.5.2 for the load too quickly after store. I'd love to understand better what's actually happening during that delay. Measurements seem to say that it causes the load to be re-executed multiple times.