IP Library Granted Patent US 12,032,961
Granted Patent B2
US 12,032,961 · App. 18/191,066 · Granted Jul 9, 2024

Vector maximum and minimum with indexing

Inventors: Duc Bui (Grand Prairie, TX); Peter Richard Dent (Bournemouth, GB); Timothy D. Anderson (University Park, TX)
Assignee: Texas Instruments Incorporated
G06F9/3013G06F9/30036G06F9/30105
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,032,961
App. No.
18/191,066
Granted
Jul 9, 2024
Kind
B2
Abstract

A method to compare first and second source data in a processor in response to a vector maximum with indexing instruction includes specifying first and second source registers containing first and second source data, a destination register storing compared data, and a predicate register. Each of the registers includes a plurality of lanes. The method includes executing the instruction by, for each lane in the first and second source register, comparing a value in the lane of the first source register to a value in the corresponding lane of the second source register to identify a maximum value, storing the maximum value in a corresponding lane of the destination register, asserting a corresponding lane of the predicate register if the maximum value is from the first source register, and de-asserting the corresponding lane of the predicate register if the maximum value is from the second source register.

Claims (78)

1. A circuit device comprising:

a first register configured to store a first vector that includes a first set of vector elements;

a second register configured to store a second vector that includes a second set of vector elements;

a functional unit coupled to the first register and to the second register;

an instruction fetch circuit configured to receive a vector maximum instruction that specifies the first register and the second register and a second instruction; and

an instruction decode circuit coupled to the instruction fetch circuit and the functional unit and configured to cause the functional unit to:

based on the vector maximum instruction,

compare each vector element of the first set of vector elements to a respective vector element of the second set of vector elements to determine a respective vector element of a third set of vector elements that is a greater of the respective vector element of the first set of vector elements and the respective vector element of the second set of vector elements;

for each vector element of the third set of vector elements, store a respective indicator in a predicate register that specifies whether the respective vector element of the third set of vector elements is associated with the first vector or the second vector; and

store the third set of vector elements in the second register; and

based on the second instruction,

cause an operation to be performed on a subset of a third vector determined based on the indicators stored in the predicate register.

2. The circuit device of claim 1 , wherein the vector maximum instruction includes a first field that specifies the first register and a second field that specifies the second register.

3. The circuit device of claim 2 , wherein:

the circuit device further comprises a set of functional units that includes the functional unit; and

the vector maximum instruction includes a third field that specifies the functional unit from among the set of functional units.

4. The circuit device of claim 1 , wherein the vector maximum instruction specifies whether the first vector and the second vector include signed or unsigned values.

5. The circuit device of claim 1 , wherein:

the circuit device comprises a scalar datapath and a vector datapath; and

the vector maximum instruction specifies whether to execute the vector maximum instruction using the scalar datapath or the vector datapath.

6. The circuit device of claim 1 , wherein:

the instruction fetch circuit is configured to receive a vector minimum instruction that specifies the first register and the second register; and

the instruction decode circuit is configured to cause the functional unit to:

based on the vector minimum instruction, compare each vector element of the first set of vector elements to a respective vector element of the second set of vector elements to determine a respective vector element of a fourth set of vector elements that is a lesser of the respective vector element of the first set of vector elements and the respective vector element of the second set of vector elements.

7. The circuit of claim 6 , wherein the vector minimum instruction includes a first field that specifies the first register and a second field that specifies the second register.

8. A circuit device comprising:

a first register configured to store a first vector that includes a first set of vector elements;

a second register configured to store a second vector that includes a second set of vector elements;

a functional unit coupled to the first register and to the second register;

an instruction fetch circuit configured to receive a vector minimum instruction that specifies the first register and the second register and a second instruction; and

an instruction decode circuit coupled to the instruction fetch circuit and the functional unit and configured to cause the functional unit to:

based on the vector minimum instruction,

compare each vector element of the first set of vector elements to a respective vector element of the second set of vector elements to determine a respective vector element of a third set of vector elements that is a lesser of the respective vector element of the first set of vector elements and the respective vector element of the second set of vector elements;

for each vector element of the third set of vector elements, store a respective indicator in a predicate register that specifies whether the respective vector element of the third set of vector elements is associated with the first vector or the second vector; and

store the third set of vector elements in the second register; and

based on the second instruction, cause the functional unit to:

cause an operation to be performed on a subset of a third vector determined based on the indicators stored in the predicate register.

9. The circuit device of claim 8 , wherein the vector minimum instruction includes a first field that specifies the first register and a second field that specifies the second register.

10. The circuit device of claim 9 , wherein:

the circuit device further comprises a set of functional units that includes the functional unit; and

the vector minimum instruction includes a third field that specifies the functional unit from among the set of functional units.

11. The circuit device of claim 8 , wherein the vector minimum instruction specifies whether the first vector and the second vector include signed or unsigned values.

12. The circuit device of claim 8 , wherein:

the circuit device comprises a scalar datapath and a vector datapath; and

the vector minimum instruction specifies whether to execute the vector minimum instruction using the scalar datapath or the vector datapath.

13. The circuit device of claim 8 , wherein:

the instruction fetch circuit is configured to receive a vector maximum instruction that specifies the first register and the second register; and

the instruction decode circuit is configured to cause the functional unit to:

based on the vector maximum instruction, compare each vector element of the first set of vector elements to a respective vector element of the second set of vector elements to determine a respective vector element of a fourth set of vector elements that is a greater of the respective vector element of the first set of vector elements and the respective vector element of the second set of vector elements.

14. The circuit device of claim 13 , wherein the vector maximum instruction includes a first field that specifies the first register and a second field that specifies the second register.

15. A method comprising:

storing a first vector that includes a first set of vector elements in a first register;

storing a second vector that includes a second set of vector elements in a second register;

receiving a vector maximum instruction that specifies the first register and the second register; and

based on the vector maximum instruction, causing a functional unit of a processor to:

compare each vector element of the first set of vector elements to a respective vector element of the second set of vector elements to determine a respective vector element of a third set of vector elements that is a greater of the respective vector element of the first set of vector elements and the respective vector element of the second set of vector elements;

for each vector element of the third set of vector elements, store a respective indicator in a predicate register that specifies whether the respective vector element of the third set of vector elements is associated with the first vector or the second vector; and

store the third set of vector elements in the second register; and

performing an operation on a subset of a third vector determined based on the indicators stored in the predicate register.

16. The method of claim 15 , further comprising:

receiving a vector minimum instruction that specifies the first register and the second register; and

based on the vector minimum instruction, causing the functional unit of the processor to:

compare each vector element of the first set of vector elements to a respective vector element of the second set of vector elements to determine a respective vector element of a fourth set of vector elements that is a lesser of the respective vector element of the first set of vector elements and the respective vector element of the second set of vector elements.

17. The method of claim 16 , wherein the vector minimum instruction includes a first field that specifies the first register and a second field that specifies the second register.

18. A method comprising:

storing a first vector that includes a first set of vector elements in a first register;

storing a second vector that includes a second set of vector elements in a second register;

receiving a vector minimum instruction that specifies the first register and the second register; and

based on the vector minimum instruction, causing a functional unit of a processor to:

compare each vector element of the first set of vector elements to a respective vector element of the second set of vector elements to determine a respective vector element of a third set of vector elements that is a lesser of the respective vector element of the first set of vector elements and the respective vector element of the second set of vector elements;

for each vector element of the third set of vector elements, store a respective indicator in a predicate register that specifies whether the respective vector element of the third set of vector elements is associated with the first vector or the second vector; and

store the third set of vector elements in the second register; and

performing an operation on a subset of a third vector determined based on the indicators stored in the predicate register.

19. The method of claim 18 , further comprising:

receiving a vector maximum instruction that specifies the first register and the second register; and

based on the vector maximum instruction, causing the functional unit of the processor to:

compare each vector element of the first set of vector elements to a respective vector element of the second set of vector elements to determine a respective vector element of a fourth set of vector elements that is a greater of the respective vector element of the first set of vector elements and the respective vector element of the second set of vector elements.

20. The method of claim 19 , wherein the vector maximum instruction includes a first field that specifies the first register and a second field that specifies the second register.

Continuity (3)
Continuation 17215013 · Mar 29, 2021
Continuation 16422501 · May 24, 2019
Related Publication 20230367598A1 · Nov 16, 2023