3 ms·
There is a reason why loop is (was made) slow: It was (in the 90s) explicitly made slow because it was used for timing loops. Making it faster would have broken
by wolfgke 6y ago
There is a reason why loop is (was made) slow: It was (in the 90s) explicitly made slow because it was used for timing loops. Making it faster would have broken existing software.
Source: https://stackoverflow.com/a/35743699 https://stackoverflow.com/a/35743699
See also https://stackoverflow.com/questions/35742570/why-is-the-loop-instruction-slow-couldnt-intel-have-implemented-it-efficiently https://stackoverflow.com/questions/35742570/why-is-the-loop...
- CJefferson 6y agoThe things you link to don't seem to say that at all, they seem to say it got slow because it was hard to implement and no-one cared about it.
- wolfgke 6y ago"IIRC LOOP was used in some software for timing loops; there was (important) software that did not work on CPUs where LOOP was too fast (this was in the early 90s or so). So CPU makers learned to make LOOP slow." "(My opinion: Intel is probably still making it slow on purpose, and hasn't bothered to rewrite their microcode for it for a long time. Modern CPUs are probably too fast for anything using loop in a naive way to work correctly.)"