摘要:
A method and system for reducing overhead on a loop of a plurality of instructions is disclosed. The loop is performed a particular number of times. The method and system include a mask register and addition logic. The mask register provides a carry mask having a first value for the loop being performed at least the particular number of times minus one time and a second value for at least a last instruction of the loop being performed a last time. The addition logic is coupled with the mask register and determines which of the plurality of instructions is to be executed. The carry mask and a current instruction of the plurality of instructions correspond to inputs of the addition logic. A resultant of the addition logic corresponds to a next instruction of the plurality of instructions unless the current instruction is the last instruction. The resultant of the addition logic corresponds to the first instruction if the current instruction is the last instruction and the loop is being performed less than the particular number of times.