5 ms·
How many processors have hardware support for loops ? I expect it to be a different, more efficient infrastructure than Comparison/Jump, maybe something similar
by agumonkey 12y ago
How many processors have hardware support for loops ? I expect it to be a different, more efficient infrastructure than Comparison/Jump, maybe something similar to DisplayLists in old OpenGL ?
- spatular 12y agoWell, full translation would be "hardware support for loops, including pipelining". How exactly is pipelining implemented is not clear.
- Zardoz84 12y agox86 LOOP
- revelation 12y agoOr just REP.
- ddingus 12y agoWhich CPU is this for?
- Sanddancer 12y agox86/x64 -- http://web.itu.edu.tr/kesgin/mul06/intel/instr/rep.html http://web.itu.edu.tr/kesgin/mul06/intel/instr/rep.html
- ddingus 12y agoThanks!
- kazinator 12y agoDBcc instructions in Motorola 68000.
- rzzzt 12y agoIntel's Itanium line had the following hardware support for loops: * Register rotation [1]: referenced registers inside the loop are cycled on each iteration * Branch prediction [2]: with a dedicated loop count register, the CPU can tell with complete certainty when not to take the jump to the beginning (no mispredictions at the exit) [1] http://www.cs.nmsu.edu/~rvinyard/itanium/register_rotation.htm http://www.cs.nmsu.edu/~rvinyard/itanium/register_rotation.h... [2] http://www.cs.nmsu.edu/~rvinyard/itanium/branching.htm http://www.cs.nmsu.edu/~rvinyard/itanium/branching.htm
- petjuh 12y agoBranch prediction is already extremely efficient for loops, it simply assumes the last comparison will be the same. For loops this is true for all but the first and last iteration.
- SamReidHughes 12y agoEven if it's perfect it still takes up branch prediction overhead in the processor, and hurts the performance of other branches. Also, getting the first or last iteration wrong is pretty bad for a ton of for loops out there.
- jevinskie 12y agoQualcomm Hexagon DSPs have "instruction packets" that have hardware loop support. http://en.wikipedia.org/wiki/Qualcomm_Hexagon#Code_sample http://en.wikipedia.org/wiki/Qualcomm_Hexagon#Code_sample