Methods and apparatus for early loop bottom detection in digital signal processors
AssigneeAnalog Devices, Inc.
InventorChristopher M. Mayer
Life of this patent
Estimating the term…
Abstract
Methods and apparatus are provided for processing variable width instructions in a pipelined processor. The apparatus includes an instruction decoder configured to decode a loop setup instruction, having a loop setup instruction address, to obtain a loop bottom offset and configured to decode instructions following the loop setup instruction, each having an instruction address, to obtain an instruction width, registers for holding the loop setup instruction address and the loop bottom offset, and a loop bottom detector, responsive to a current instruction address, a current instruction width, the loop setup instruction address and the loop bottom offset, configured to determine if a next instruction is a loop bottom instruction.
Claims12
A method for processing variable width instructions in a pipelined processor, comprising:
- decoding instructions to identify a loop setup instruction having a loop setup instruction address to determine a loop top offset indicative of a loop top instruction address of a loop top instruction and a loop bottom offset indicative of a loop bottom instruction address of a loop bottom instruction;
- decoding variable width instructions following the loop setup instruction to detect the loop bottom instruction, a width of each of the variable width instructions being determined during decoding;
- decoding a current instruction of the variable width instructions, the current instruction having a current instruction address and a current instruction width;
- fetching a next instruction of the variable width instructions;
- determining if the next instruction to be decoded is the loop bottom instruction based, at least in part, on the current instruction address, the current instruction width, the loop setup instruction address and the loop bottom offset, the determination being made prior to decoding the next instruction;
- and
- providing the loop top instruction address to an instruction fetch stage of the pipelined processor if it is determined that the next instruction is the loop bottom instruction.
A method for processing variable width instructions in a pipelined processor, comprising:
- decoding instructions to identify a loop setup instruction having a loop setup instruction address and containing a loop bottom offset;
- decoding instructions following the loop setup instruction, each having an instruction address and containing an instruction width;
- for each instruction following the loop setup instruction, using a current instruction address, a current instruction width, the loop setup instruction address and the loop bottom offset to determine if the next instruction is a loop bottom instruction, wherein determining if the next instruction is a loop bottom instruction comprises determining if the current instruction address plus the current instruction width plus the loop setup instruction address inverted plus the loop bottom offset inverted plus 1 is equal to negative 1;
- and
- changing a state of a loop bottom register if it is determined that the next instruction is the loop bottom instruction to indicate to the pipelined processor that a loop top instruction should be fetched.
Apparatus for processing variable width instructions in a pipeline processor, comprising:
- an instruction decoder configured to decode a loop setup instruction, having a loop setup instruction address, to obtain a loop top offset indicative of a loop top instruction address of a loop top instruction and a loop bottom offset indicative of a loop bottom instruction address of a loop bottom instruction and configured to decode variable width instructions following the loop setup instruction to determine an instruction width of each of the variable width instructions;
- an instruction fetch stage configured to fetch instructions to be decoded by the instruction decoder;
- registers for holding the loop setup instruction address and the loop bottom offset, respectively;
- and
- a loop bottom detector configured to determine if a next instruction to be decoded and currently in the instruction fetch stage is the loop bottom instruction prior to decoding the next instruction, the determination based, at least in part, on a current instruction address and current instruction width of a current instruction being decoded by the instruction decoder, the loop bottom detector configured to provide the loop top instruction to the instruction fetch stage if the loop bottom detector determines the next instruction is the loop bottom instruction.
Apparatus for processing variable width instructions in a pipeline processor, comprising:
- an instruction decoder configured to decode a loop setup instruction, having a loop setup instruction address, to obtain a loop bottom offset and configured to decode instructions following the loop setup instruction, each having an instruction address, to obtain an instruction width;
- registers for holding the loop setup instruction address and the loop bottom offset;
- a loop bottom register for holding a state indicative of whether a loop bottom instruction has been detected;
- and
- a loop bottom detector, responsive to a current instruction address, a current instruction width, the loop setup instruction address and the loop bottom offset, configured to determine if a next instruction is a loop bottom instruction, wherein the loop bottom detector is configured to determine if the current instruction address plus the current instruction width plus the loop setup instruction address inverted plus the loop bottom offset inverted plus one is equal to negative one, and wherein the loop bottom detector is configured to change the state of the loop bottom register if it is determined that the next instruction is the loop bottom instruction.
Apparatus for processing variable width instructions in a pipelined processor, comprising:
- means for decoding a loop setup instruction, having a loop setup instruction address, to obtain a loop top offset indicative of a loop top instruction address of a loop top instruction and a loop bottom offset indicative of a loop bottom instruction address of a loop bottom instruction and for decoding variable width instructions following the loop setup instruction to determine an instruction width of each of the variable width instructions;
- means for fetching instructions to be decoded by the means for decoding;
- means for holding the loop setup instruction address and the loop bottom offset;
- and
- means for determining if a next instruction to be decoded is the loop bottom instruction prior to decoding the next instruction, the determination based, at least in part, on a current instruction address and current instruction width of a current instruction being decoded by the means for decoding, and configured to provide the loop top instruction to the means for fetching instructions if the next instruction is determined to be the loop bottom instruction.
Apparatus for processing variable width instructions in a pipelined processor, comprising:
- means for decoding a loop setup instruction, having a loop setup instruction address, to obtain a loop bottom offset and for decoding instructions following the loop setup instruction, each having an instruction address, to obtain an instruction width;
- means for holding the loop setup instruction address and the loop bottom offset;
- means, responsive to a current instruction address, a current instruction width, the loop setup instruction address and the loop bottom offset, for determining if a next instruction is a loop bottom instruction, wherein the means for determining if a next instruction is a loop bottom instruction comprises means for determining if the current instruction address plus the current instruction width plus the loop setup instruction address inverted plus the loop bottom offset inverted plus one is equal to negative 1;
- and
- means for changing a state of a loop bottom register when it is determined that the next instruction is the loop bottom instruction.
Dependencies are inferred from the claim text.