X86: Fix the carry flag for shl.

This commit is contained in:
Gabe Black 2009-08-05 02:56:38 -07:00
parent df2c862a07
commit 22a5f66820

View file

@ -648,8 +648,10 @@ let {{
ccFlagBits = ccFlagBits & ~(ext & (CFBit | ECFBit | OFBit)); ccFlagBits = ccFlagBits & ~(ext & (CFBit | ECFBit | OFBit));
int CFBits = 0; int CFBits = 0;
//Figure out if we -would- set the CF bits if requested. //Figure out if we -would- set the CF bits if requested.
if (bits(SrcReg1, dataSize * 8 - shiftAmt)) if (shiftAmt <= dataSize * 8 &&
bits(SrcReg1, dataSize * 8 - shiftAmt)) {
CFBits = 1; CFBits = 1;
}
//If some combination of the CF bits need to be set, set them. //If some combination of the CF bits need to be set, set them.
if ((ext & (CFBit | ECFBit)) && CFBits) if ((ext & (CFBit | ECFBit)) && CFBits)
ccFlagBits = ccFlagBits | (ext & (CFBit | ECFBit)); ccFlagBits = ccFlagBits | (ext & (CFBit | ECFBit));