1. A method for executing a vector instruction in a processor, comprising: receiving a first input vector, a second input vector, and optionally receiving a predicate vector, wherein each vector includes N elements; and generating a result vector, wherein generating the result vector comprises: if the predicate vector was received, for each element of the result vector for which a corresponding element of the predicate vector is active, otherwise, for each element of the result vector, determining elements that are to be set in the result vector based on values in elements in the first input vector and the second input vector, wherein the determining comprises identifying a closest neighboring element on a predetermined side of a key element in the second input vector that indicates a dependency on the key element or any element between the neighboring element and the key element; and setting the determined elements of the result vector to a first predetermined value.