Patent ID: 8418154
Filing Date: 2013-04-09
Classification: G06F

Abstract:
1. A computer-implemented method to avoid pipeline stalls associated with conditional statements in scalar source code by converting the conditional statements into at least bitwise vector operations, the method comprising: receiving the scalar source code containing a conditional statement, wherein each branch of the conditional statement specifies: (i) a scalar data structure and (ii) a scalar operation operating on the scalar data structure; generating vector masking source code from the received scalar source code by operation of one or more computer processors and to avoid pipeline stalls associated with the conditional statement in the received scalar source code, by converting the conditional statement into at least one bitwise vector operation, wherein the generated vector masking source code does not include any conditional statement and includes: (i) for each branch of the conditional statement, a vector data structure that corresponds to the scalar data structure in the respective branch of the conditional statement; (ii) for each branch of the conditional statement, a vector operation that corresponds to the scalar operation in the respective branch of the conditional statement, wherein the scalar operation operates on the scalar data structure and wherein the vector operation operates on the vector data structure to compute a result for the respective branch of the conditional statement; and (iii) the at least one bitwise vector operation, which is configured to compute a final result based on the respective results for each branch of the conditional statement; and outputting the generated vector masking source code.