Vectorized table lookup
First Claim
1. A method for performing a lookup operation for a table stored in a computer memory, comprising the steps of:
- storing an index vector containing multiple index values which respectively designate locations in the table;
performing a plurality of permute operations on different respective sets of data within said table, in accordance with the values in said index vector, to produce a plurality of intermediate result vectors; and
performing at least one select operation on said intermediate result vectors to produce a final result vector of entries from said data table.
1 Assignment
0 Petitions
Accused Products
Abstract
A lookup operation is carried out on a data table by logically dividing the data table into a number of smaller sets of data that can be indexed with a single byte of data. Each set of data consists of two vectors, which constitute the operands for a permute instruction. Only a limited number of bits are required to index into the table during the execution of this instruction. The remaining bits of each index are used as masks into a series of select instructions. The select instruction chooses between two vector components, based on the mask, and places the selected components into a new vector. The mask is generated by shifting one of the higher order bits of the index to the most significant position, and then propagating that bit throughout a byte, for example by means of an arithmetic shift. This procedure is carried out for all of the index bytes in the vector, to generate a select mask. The select mask is then used during a select operation, to choose between the results of permute instructions on different ones of the logically divided sets of data. Multi-byte table entries are retrieved by replicating each index value and adding consecutive values to form multiple consecutive index values that are then used in multiple permute operations.
-
Citations
31 Claims
-
1. A method for performing a lookup operation for a table stored in a computer memory, comprising the steps of:
-
storing an index vector containing multiple index values which respectively designate locations in the table;
performing a plurality of permute operations on different respective sets of data within said table, in accordance with the values in said index vector, to produce a plurality of intermediate result vectors; and
performing at least one select operation on said intermediate result vectors to produce a final result vector of entries from said data table. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A method for performing a lookup operation for a table stored in a computer memory, comprising the steps of:
-
storing an index vector containing multiple original index values which respectively designate locations in the table;
duplicating the original index values in said index vector to produce multiple copies of each original index value;
adding consecutive values to the respective copies of the index values to produce consecutive index values; and
performing permute operations in accordance with each of said consecutive index values to retrieve data at consecutive locations within said table. - View Dependent Claims (11, 12, 14, 15, 16, 18, 19, 20, 21, 22, 24, 25, 27, 28, 29, 30, 31)
-
-
13. A computer-readable medium containing a program which executes the steps of:
-
performing a plurality of permute operations on different respective sets of data within a data table, in accordance with values in an index vector containing multiple index values which respectively designate locations in the table, to produce a plurality of intermediate result vectors; and
performing at least one select operation on said intermediate result vectors to produce a final result vector containing entries from said data table.
-
-
17. A method for performing a lookup operation in a table stored in a computer memory, comprising the steps of:
-
storing an index vector containing multiple index values which respectively designate locations in the table;
performing a plurality of permute operations on different respective sets of data within said table, in accordance with the values in said index vector, to produce a plurality of intermediate result vectors;
generating a selection mask from at least one data bit in each index value, and performing at least one select operation on said intermediate result vectors in accordance with said selection mask, to produce a final result vector of entries from said table.
-
-
23. A computer-readable medium containing a program which executes the steps of:
-
duplicating index values in an index vector containing multiple original index values which respectively designate locations in a data table, to produce multiple copies of each original index value;
adding consecutive values to the respective copies of the index values to produce consecutive index values; and
performing permute operations in accordance with each of said consecutive index values to retrieve data at consecutive locations within said table.
-
-
26. A computer system, comprising:
-
a memory which stores a table of data values;
a first register which stores a vector of index values that respectively designate locations in a table stored in said memory; and
a vector processing unit which performs plural permute operations on different respective sets of data stored in said memory, in accordance with the index values stored in said first register, to load values from said memory into a plurality of intermediate result registers;
processes at least one data bit of each index value in said first register to generate a mask; and
performs a select operation on the values in said intermediate result registers in accordance with said mask to selectively load data values from a stored table into a final result register.
-
Specification