Make sttw and sttwa use the twin memory operations.
authorGabe Black <gblack@eecs.umich.edu>
Sun, 11 Mar 2007 22:12:33 +0000 (18:12 -0400)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 11 Mar 2007 22:12:33 +0000 (18:12 -0400)
--HG--
extra : convert_revision : 368d1c57a46fd5ca15461cb5ee8e05fd1e080daa

src/arch/sparc/isa/decoder.isa
src/arch/sparc/isa/formats/mem/util.isa
src/base/bigint.hh
src/cpu/simple/atomic.cc
src/cpu/simple/timing.cc

index 04534cb347b07a4a02b3dd4acf8098ee47ac192d..0edb959f0414e7a0cbeabd88058b51e109e80783 100644 (file)
@@ -1320,7 +1320,10 @@ decode OP default Unknown::unknown()
             0x04: stw({{Mem.uw = Rd.sw;}});
             0x05: stb({{Mem.ub = Rd.sb;}});
             0x06: sth({{Mem.uhw = Rd.shw;}});
-            0x07: sttw({{Mem.udw = RdLow<31:0> | (RdHigh<31:0> << 32);}});
+            0x07: sttw({{
+                      (Mem.tuw).a = RdLow<31:0>;
+                      (Mem.tuw).b = RdHigh<31:0>;
+                  }});
         }
         format Load {
             0x08: ldsw({{Rd = (int32_t)Mem.sw;}});
@@ -1410,7 +1413,10 @@ decode OP default Unknown::unknown()
             0x14: stwa({{Mem.uw = Rd;}}, {{EXT_ASI}});
             0x15: stba({{Mem.ub = Rd;}}, {{EXT_ASI}});
             0x16: stha({{Mem.uhw = Rd;}}, {{EXT_ASI}});
-            0x17: sttwa({{Mem.udw = RdLow<31:0> | RdHigh<31:0> << 32;}}, {{EXT_ASI}});
+            0x17: sttwa({{
+                      (Mem.tuw).a = RdLow<31:0>;
+                      (Mem.tuw).b = RdHigh<31:0>;
+                  }}, {{EXT_ASI}});
         }
         format LoadAlt {
             0x18: ldswa({{Rd = (int32_t)Mem.sw;}}, {{EXT_ASI}});
index 1d884d6c32460f9b224e9e1d82f1a643b35bd0c1..dfe937371119fbb52906f0a8c6d080c86a8cad2e 100644 (file)
@@ -224,7 +224,7 @@ def template StoreExecute {{
             }
             if(storeCond && fault == NoFault)
             {
-                fault = xc->write((uint%(mem_acc_size)s_t)Mem,
+                fault = xc->write((%(mem_acc_type)s%(mem_acc_size)s_t)Mem,
                         EA, %(asi_val)s, 0);
             }
             if(fault == NoFault)
@@ -257,7 +257,7 @@ def template StoreInitiateAcc {{
             }
             if(storeCond && fault == NoFault)
             {
-                fault = xc->write((uint%(mem_acc_size)s_t)Mem,
+                fault = xc->write((%(mem_acc_type)s%(mem_acc_size)s_t)Mem,
                         EA, %(asi_val)s, 0);
             }
             if(fault == NoFault)
index ed48c67fe2f758672941d190edb82d5d46c0fbdf..d6068423144d690e5504d9448be1e9f2edef423d 100644 (file)
@@ -28,6 +28,8 @@
  * Authors: Ali Saidi
  */
 
+#include "base/misc.hh"
+
 #include <iostream>
 
 #ifndef __BASE_BIGINT_HH__
@@ -49,6 +51,12 @@ struct m5_twin64_t {
         b = x;
         return *this;
     }
+
+    operator uint64_t()
+    {
+        panic("Tried to cram a twin64_t into an integer!\n");
+        return a;
+    }
 };
 
 struct m5_twin32_t {
@@ -67,6 +75,12 @@ struct m5_twin32_t {
         b = x;
         return *this;
     }
+
+    operator uint32_t()
+    {
+        panic("Tried to cram a twin32_t into an integer!\n");
+        return a;
+    }
 };
 
 
index ca4627bbff9239ca0bfc17f8abd9c9becf0fef75..6a14a8aa588450d47be8773521987e4d9f5c2d8c 100644 (file)
@@ -446,6 +446,17 @@ AtomicSimpleCPU::write(T data, Addr addr, unsigned flags, uint64_t *res)
 
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+template
+Fault
+AtomicSimpleCPU::write(Twin32_t data, Addr addr,
+                       unsigned flags, uint64_t *res);
+
+template
+Fault
+AtomicSimpleCPU::write(Twin64_t data, Addr addr,
+                       unsigned flags, uint64_t *res);
+
 template
 Fault
 AtomicSimpleCPU::write(uint64_t data, Addr addr,
index 2e602648ae18e651976f8646c8ca825fc34d2779..45da7c3ebd283fd657f066f162899a6d8cfa79ca 100644 (file)
@@ -396,6 +396,16 @@ TimingSimpleCPU::write(T data, Addr addr, unsigned flags, uint64_t *res)
 
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
+template
+Fault
+TimingSimpleCPU::write(Twin32_t data, Addr addr,
+                       unsigned flags, uint64_t *res);
+
+template
+Fault
+TimingSimpleCPU::write(Twin64_t data, Addr addr,
+                       unsigned flags, uint64_t *res);
+
 template
 Fault
 TimingSimpleCPU::write(uint64_t data, Addr addr,