Multiple execution of instruction loops within a processor without accessing program memory
AssigneeSTMicroelectronics S.r.l.
InventorsLaurent Wojcieszak, Andrew Cofler
Life of this patent
Estimating the term…
Abstract
A method of executing loops in a computer system is described. The computer system has a sequence of instructions held in program memory and a prefetch buffer which holds instructions fetched from the memory ready for supply to a decoder of the computer system. If the size of the loop to be executed is such that it can by holly contained within the prefetch buffer, this is detected and a lock is put on the prefetch buffer to retain the loop within it while the loop is executed a requisite number of times. This thus allows power to be saved and reduces the overhead on the memory access buffers. According to another aspect, loops can be “skipped” by holding a value of zero in the loop counter register.
Claims12
A computer system for executing loops comprising:
- a program memory holding a sequence of instructions including at least one loop sequence having a set of loop instructions to be executed a predetermined number of times;
- a prefetch buffer for fetching instructions from the program memory;
- means for detecting whether all of the loop instructions of the set are in the prefetch buffer and for locking the prefetch buffer against further accesses to the program memory solely in response to detecting that all of the loop instructions are in the prefetch buffer;
- and
- means for detecting when the loop sequence has been executed said predetermined number of times and releasing the lock on the prefetch buffer to allow further accesses to the program memory in response to detecting that the loop sequence has been executed said predetermined number of times, comprising a loop count register for holding a value representing said predetermined number and a counter operative to decrement the value in response to each time a last instruction in the loop sequence is reached.
A method of executing loops in a computer system, each loop comprising a sequence of loop instructions to be executed a predetermined number of times, the method comprising:
- fetching instructions from a program memory into a prefetch buffer;
- detecting whether all of the loop instructions of the sequence are in the prefetch buffer and, solely in response to detecting that all of the loop instructions are in the prefetch buffer, locking the prefetch buffer against further accesses to the program memory;
- detecting when the loop has been executed said predetermined number of times, comprising holding a value representing said predetermined number in a loop count register and decrementing the value each time a last instruction in the loop is reached;
- and
- in response to the detecting when the loop has been executed said predetermined number of times, releasing the lock on the prefetch buffer to allow further accesses to the program memory.
A computer system for executing loops comprising:
- a program memory holding a sequence of instructions including at least one loop sequence having a set of loop instructions to be executed a predetermined number of times;
- a prefetch buffer for fetching instructions from the program memory;
- a loop instruction detector to detect whether all of the loop instructions of the set are in the prefetch buffer, and to lock the prefetch buffer against further accesses to the program memory solely in response to detecting that all of loop instructions are in the prefetch buffer;
- and
- a loop execution detector to detect when the loop sequence has been executed said predetermined number of times and to release the lock on the prefetch buffer to allow further accesses to the program memory in response to such detection,
- wherein said loop execution detector comprises a loop count register for holding a value representing said predetermined number and a counter operative to decrement the value in response to each time a last instruction in the loop sequence is reached.
Dependencies are inferred from the claim text.