changeset cc8568cfce8f in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=cc8568cfce8f
description:
        X86: Handle left rotations that go all the way around or more.

diffstat:

1 file changed, 4 insertions(+), 3 deletions(-)
src/arch/x86/isa/microops/regop.isa |    7 ++++---

diffs (19 lines):

diff -r 647111272094 -r cc8568cfce8f src/arch/x86/isa/microops/regop.isa
--- a/src/arch/x86/isa/microops/regop.isa       Wed Aug 05 02:58:20 2009 -0700
+++ b/src/arch/x86/isa/microops/regop.isa       Wed Aug 05 02:58:54 2009 -0700
@@ -796,11 +796,12 @@
         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
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to