X86: Handle left rotations that go all the way around or more.

This commit is contained in:
Gabe Black 2009-08-05 02:58:54 -07:00
parent 99adfd9dae
commit 7f9a3af250

View file

@ -796,11 +796,12 @@ let {{
code = ''' code = '''
uint8_t shiftAmt = uint8_t shiftAmt =
(op2 & ((dataSize == 8) ? mask(6) : mask(5))); (op2 & ((dataSize == 8) ? mask(6) : mask(5)));
if(shiftAmt) uint8_t realShiftAmt = shiftAmt % (dataSize * 8);
if(realShiftAmt)
{ {
uint64_t top = psrc1 << shiftAmt; uint64_t top = psrc1 << realShiftAmt;
uint64_t bottom = uint64_t bottom =
bits(psrc1, dataSize * 8 - 1, dataSize * 8 - shiftAmt); bits(psrc1, dataSize * 8 - 1, dataSize * 8 - realShiftAmt);
DestReg = merge(DestReg, top | bottom, dataSize); DestReg = merge(DestReg, top | bottom, dataSize);
} }
else else