X86: Fix completeAcc get call.
authorGabe Black <gblack@eecs.umich.edu>
Mon, 10 Nov 2008 05:55:43 +0000 (21:55 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Mon, 10 Nov 2008 05:55:43 +0000 (21:55 -0800)
src/arch/x86/insts/microldstop.hh
src/arch/x86/isa/microops/ldstop.isa

index 5b1210d6969632267d4e5a87902f91429d70aafb..eccd37dc2c57093763c23993f32e196cc36ec44c 100644 (file)
@@ -59,6 +59,7 @@
 #define __ARCH_X86_INSTS_MICROLDSTOP_HH__
 
 #include "arch/x86/insts/microop.hh"
+#include "mem/packet.hh"
 
 namespace X86ISA
 {
@@ -149,6 +150,25 @@ namespace X86ISA
             }
             return fault;
         }
+
+        uint64_t
+        get(PacketPtr pkt) const
+        {
+            switch(dataSize)
+            {
+              case 1:
+                return pkt->get<uint8_t>();
+              case 2:
+                return pkt->get<uint16_t>();
+              case 4:
+                return pkt->get<uint32_t>();
+              case 8:
+                return pkt->get<uint64_t>();
+              default:
+                panic("Bad operand size %d for read at %#x.\n",
+                        dataSize, pkt->getAddr());
+            }
+        }
     };
 }
 
index cb63e7cd9f1e78d2a2d917819d59218f38552c13..30a7c8801098d8a33f0cfd93c3686db8aef1f1f2 100644 (file)
@@ -194,7 +194,7 @@ def template MicroLoadCompleteAcc {{
         %(op_decl)s;
         %(op_rd)s;
 
-        Mem = pkt->get<typeof(Mem)>();
+        Mem = get(pkt);
 
         %(code)s;