A method for a microprocessor, having architectural condition flags that include an architectural carry flag and other architectural condition flags, to perform an architectural instruction that instructs the microprocessor to perform a shift operation on a first source operand to generate a first result, to perform a second operation on the first result and a second operand to generate a second result, and to write the second result to a destination register and update the condition flags only if the architectural condition flags satisfy a condition specified in the architectural instruction, the method comprising:
- translating the architectural instruction into first and second microinstructions, wherein said translating is performed by a hardware instruction translator of the microprocessor;
- and
- executing the first and second microinstructions received from the hardware instruction translator, wherein said executing is performed by an execution pipeline of the microprocessor;
- wherein said executing the first microinstruction comprises:
- performing the shift operation on the first source operand to generate the first result and a carry flag value;
- and
- updating a non-architectural carry flag with the generated carry flag value;
- wherein said executing the second microinstruction comprises:
- performing the second operation on the first result and the second operand to generate the second result and new condition flag values based on the second result;
- if the architectural condition flags satisfy the condition, updating the architectural carry flag with the non-architectural carry flag value and updating at least one of the other architectural condition flags with the corresponding generated new condition flag values;
- and
- if the architectural condition flags do not satisfy the condition, updating the architectural condition flags with the current value of the architectural condition flags.