1. A method for generating a result vector, comprising: receiving a first input vector, a second input vector, a control vector, and a predicate vector, wherein each vector includes a same number of elements, and wherein the predicate vector identifies which elements of the vectors are active elements; recording a base value from an element at a key element position in the first input vector, wherein the key element position is a leftmost element position of element positions for which both the control vector and the predicate vector are active; and generating the result vector, wherein generating the result vector comprises, for each active element in the result vector to the right of the key element position: generating a shifted base value that is equal to the base value shifted by a number of bit positions equal to a sum of relevant elements of the second input vector from the key element position to and including a predetermined element position in the second input vector, wherein a relevant element is an element for which a corresponding element in the control vector is active; correcting the shifted base value by adding 1 to the shifted base value when a first predetermined condition is met; setting the active element of the result vector equal to the shifted base value when the first predetermined condition is not met; and setting the active element of the result vector equal to the corrected, shifted base value when the first predetermined condition is met.