From: Gabe Black Date: Wed, 5 Aug 2009 09:58:54 +0000 (-0700) Subject: X86: Handle left rotations that go all the way around or more. X-Git-Tag: Calvin_Submission~179 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7f9a3af25014dd8f022968047a9f6f5198079a16;p=gem5.git X86: Handle left rotations that go all the way around or more. --- diff --git a/src/arch/x86/isa/microops/regop.isa b/src/arch/x86/isa/microops/regop.isa index 5461223a3..447939abd 100644 --- a/src/arch/x86/isa/microops/regop.isa +++ b/src/arch/x86/isa/microops/regop.isa @@ -796,11 +796,12 @@ let {{ code = ''' uint8_t shiftAmt = (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 = - bits(psrc1, dataSize * 8 - 1, dataSize * 8 - shiftAmt); + bits(psrc1, dataSize * 8 - 1, dataSize * 8 - realShiftAmt); DestReg = merge(DestReg, top | bottom, dataSize); } else