changeset 418145f4d7a6 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=418145f4d7a6
description:
        X86: Make sure immediate values are truncated properly.
        Register values will be "picked" which will assure they don't have junk 
beyond
        the part we're using. Immediate values don't go through a similar 
process, so
        we should truncate them explicitly.

diffstat:

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

diffs (21 lines):

diff -r 59108c231208 -r 418145f4d7a6 src/arch/x86/isa/microops/regop.isa
--- a/src/arch/x86/isa/microops/regop.isa       Wed Aug 05 03:04:17 2009 -0700
+++ b/src/arch/x86/isa/microops/regop.isa       Wed Aug 05 03:06:01 2009 -0700
@@ -525,7 +525,7 @@
             uint64_t hiResult;
             uint64_t psrc1_h = psrc1 / shifter;
             uint64_t psrc1_l = psrc1 & mask(halfSize);
-            uint64_t psrc2_h = op2 / shifter;
+            uint64_t psrc2_h = (op2 / shifter) & mask(halfSize);
             uint64_t psrc2_l = op2 & mask(halfSize);
             hiResult = ((psrc1_l * psrc2_h + psrc1_h * psrc2_l +
                         ((psrc1_l * psrc2_l) / shifter)) /shifter) +
@@ -545,7 +545,7 @@
             uint64_t shifter = (1ULL << halfSize);
             uint64_t psrc1_h = psrc1 / shifter;
             uint64_t psrc1_l = psrc1 & mask(halfSize);
-            uint64_t psrc2_h = op2 / shifter;
+            uint64_t psrc2_h = (op2 / shifter) & mask(halfSize);
             uint64_t psrc2_l = op2 & mask(halfSize);
             ProdHi = ((psrc1_l * psrc2_h + psrc1_h * psrc2_l +
                       ((psrc1_l * psrc2_l) / shifter)) / shifter) +
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to