1. A method for generating a result vector with shifted values, comprising: in a processor, performing operations for: receiving a first input vector, a second input vector, and a control vector, and optionally receiving a predicate vector, wherein each vector includes a same number of elements; capturing a base value contained in an element of the second input vector at a key element position; and generating the result vector, wherein generating the result vector involves, if the predicate vector is received, for each element in the result vector to the right of the key element position for which a corresponding element in the predicate vector is active, otherwise, for each element in the result vector to the right of the key element position, setting the element in the result vector equal to the base value shifted in a predetermined direction a number of bit positions equal to a sum of a value in each relevant element of the first input vector from an element at the key element position to and including a predetermined element in the first input vector, wherein a relevant element in the first input vector is an element in the first input vector for which a corresponding element in the control vector is active.