1. A non-transitory machine readable medium storing an instruction, which when executed by a hardware processor causes the processor to perform a method comprising: decoding an instruction having fields for a first operand, a second operand, and a third operand; and executing the decoded instruction to individually perform a shift operation by at least one bit for each of a plurality of packed data elements stored in a storage location identified by the second operand field, for each of the data elements that has an overflow in response to the shift operation, carrying over the overflow into an adjacent packed data element based on a mask obtained from the identified third operand field, generating a final result, and storing the final result in a storage location identified by the first operand field.