Efficient stack utilization for compiling and executing nested if-else constructs in a vector data processing system
First Claim
1. A method for compiling a nested conditional construct for a vector data processor, comprising the computer-implemented steps of:
- providing a first program for the vector data processor in a first software language, the program including the nested conditional construct;
initiating translation of the first program for the vector data processor from the first software language to a second program in a second software language by a data processor;
recognizing the nested conditional construct in the first program;
translating a first portion of the first program for the vector data processor from the first software language to a first portion of the second program in the second software language, the first portion of the second program determining when a condition in the nested conditional construct is true and when the condition in the nested conditional construct is false;
providing a second portion of the second program wherein a first vector instruction set stores a first state of each of a plurality of processing elements of the vector data processor in a first vector register when the condition in the nested conditional construct is true;
providing a third portion of the second program wherein a second vector instruction set deactivates each of the plurality of processing elements for which the nested conditional construct is false;
providing a fourth portion of the software program wherein a third vector instruction set which logically combines a second state of each of the plurality of processing elements with the first state of each of the plurality of processing elements of the vector data processor; and
providing a fifth portion of the software program wherein a fourth vector instruction set retrieves a first register value from the first vector register to provide a third state for each of the plurality of processing elements of the vector data processor.
6 Assignments
0 Petitions
Accused Products
Abstract
A computer-implemented method is provided for compiling software code that performs nested conditional constructs in vector data processors (10). A vector bit stack (128) to record which processing elements (16) were activated and which processing elements were deactivated during execution of a nested conditional construct. Subsequently, when an end of a first nested conditional construct is encountered, a state of the processing elements at a point in time in which the first nested conditional construct was initiated may be popped off of the vector bit stack and a second conditional construct or any other operation may be executed. Therefore, conditional constructs may be executed while ensuring the proper state of the processing elements. The compiler program effectively utilizes the vector bit stack to store prior states of each of the processing elements of the vector data processor such that the processing elements may be efficiently restored to a correct intermediate value.
52 Citations
25 Claims
-
1. A method for compiling a nested conditional construct for a vector data processor, comprising the computer-implemented steps of:
-
providing a first program for the vector data processor in a first software language, the program including the nested conditional construct; initiating translation of the first program for the vector data processor from the first software language to a second program in a second software language by a data processor; recognizing the nested conditional construct in the first program; translating a first portion of the first program for the vector data processor from the first software language to a first portion of the second program in the second software language, the first portion of the second program determining when a condition in the nested conditional construct is true and when the condition in the nested conditional construct is false; providing a second portion of the second program wherein a first vector instruction set stores a first state of each of a plurality of processing elements of the vector data processor in a first vector register when the condition in the nested conditional construct is true; providing a third portion of the second program wherein a second vector instruction set deactivates each of the plurality of processing elements for which the nested conditional construct is false; providing a fourth portion of the software program wherein a third vector instruction set which logically combines a second state of each of the plurality of processing elements with the first state of each of the plurality of processing elements of the vector data processor; and providing a fifth portion of the software program wherein a fourth vector instruction set retrieves a first register value from the first vector register to provide a third state for each of the plurality of processing elements of the vector data processor. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method for compiling a nested conditional construct for a vector data processor, comprising the computer-implemented steps of:
-
providing a first program for the vector data processor in a first software language, the program including the nested conditional construct; initiating translation of the first program for the vector data processor from the first software language to a second program in a second software language by a data processor; recognizing the nested conditional construct in the first program; enabling the data processor to determine if the nested conditional construct may be optimized for the vector data processor; translating the first program for the vector data processor from the first software language to the second program in the second software language in a first set of steps when the nested conditional construct may not be optimized, the first set of steps comprising the steps of; translating a first portion of the first program for the vector data processor from the first software language to a first portion of the second program in the second software language, the first portion of the second program determining when a condition in the nested conditional construct is true and when the condition in the nested conditional construct is false; providing a second portion of the second program wherein a first vector instruction set stores a first state of each of a plurality of processing elements of the vector data processor in a first vector register when the condition in the nested conditional construct is true; providing a third portion of the second program wherein a second vector instruction set deactivates each of the plurality of processing elements for which the nested conditional construct is false; providing a fourth portion of the software program wherein a third vector instruction set which logically combines a second state of each of the plurality of processing elements with the first state of each of the plurality of processing elements of the vector data processor; and providing a fifth portion of the software program wherein a fourth vector instruction set retrieves a first register value from the first vector register to provide a third state for each of the plurality of processing elements of the vector data processor; translating the first program for the vector data processor from the first software language to the second program in the second software language in a second set of steps when the nested conditional construct may be optimized, the second set of steps comprising the steps of; determining when each of the plurality of processing elements is active in the first state; translating a sixth portion of the software program wherein a fifth vector instruction set programs the vector data processor to execute a first optimized function when each of the plurality of processing elements is active in the first state; determining when a nested conditional construct is a predetermined nested conditional construct form which may be optimized when each of the plurality of processing elements is not active in the first state; and translating a seventh portion of the software program wherein a sixth vector instruction set programs the vector data processor to execute a second optimized function when the nested conditional construct is the predetermined nested conditional construct form. - View Dependent Claims (9, 10, 11, 12, 13, 14, 15, 16, 17)
-
-
18. A method for compiling a nested conditional construct for a vector data processor, comprising the computer-implemented steps of:
-
providing a first program for the vector data processor in a first software language, the program including the nested conditional construct; initiating translation of the first program for the vector data processor from the first software language to a second program in a second software language by a data processor; recognizing the nested conditional construct in the first program; enabling the data processor to determine if the nested conditional construct may be optimized for the vector data processor; translating the first program in the first software language to the second program in the second software language using a general vector conditional construct program; and optimizing a translation of the first program to the second program such that the first program in the first software language is translated to the second program in the second software language using an optimized vector conditional construct program. - View Dependent Claims (19, 20, 21, 22, 23, 24, 25)
-
Specification