Patent ID: 8051226

Claim:
A method for generating a control vector for accessing a circular buffer in a data processing system, the circular buffer comprising a plurality of storage elements that are arranged sequentially from a designated first storage element to a designated last storage element, and when the designated last storage element of the plurality of storage elements is accessed, the access continuing in a sequential order continuing with the designated first storage element, the method comprising: determining a beginning storage element of the plurality of storage elements to be accessed; determining an offset value of the beginning storage element, the offset value determined to be a predetermined number of storage elements from the designated first storage element to the beginning storage element; determining the control vector based on the offset value, the control vector comprising a plurality of index values, each of the plurality of index values corresponding to one of the plurality of storage elements to be accessed in the sequential order from the beginning storage element to an ending storage element; providing a first source register for storing the control vector; providing at least one other source register for storing a plurality of circular buffer data values corresponding to the plurality of index values; determining a plurality of locations in a destination register for storing the plurality of circular buffer data values based on the plurality of index values; using the plurality of index values to store the plurality of circular buffer data values from the at least one other source register to corresponding locations in the destination register; using the plurality of circular buffer data values in the destination register in an execution unit of the data processing system; determining that one or more of the plurality of index values are outside of a predetermined range; and setting the circular buffer data values in one or more destination register locations corresponding to one or more locations of the first source register which store the one or more of the plurality of index values which are outside of the predetermined range to a predetermined constant value.