ARM: Fix SRS instruction to micro-code memory operation and register update.
authorAli Saidi <Ali.Saidi@ARM.com>
Mon, 15 Nov 2010 20:04:03 +0000 (14:04 -0600)
committerAli Saidi <Ali.Saidi@ARM.com>
Mon, 15 Nov 2010 20:04:03 +0000 (14:04 -0600)
Previously the SRS instruction attempted to writeback in initiateAcc() which
worked until a recent change, but was incorrect.

src/arch/arm/isa/insts/str.isa

index ff98c58d219570372a37f536017278d71691cbe9..c26488eba8ec142934340c9626f774e552f76b37 100644 (file)
@@ -112,8 +112,6 @@ let {{
             Mem.ud = (uint64_t)cSwap(LR.uw, cpsr.e) |
                      ((uint64_t)cSwap(Spsr.uw, cpsr.e) << 32);
             '''
-            if self.writeback:
-                accCode += "SpMode = SpMode + %s;\n" % wbDiff
 
             global header_output, decoder_output, exec_output
 
@@ -122,11 +120,18 @@ let {{
                           "postacc_code": "" }
             codeBlobs["predicate_test"] = pickPredicate(codeBlobs)
 
+            wbDecl = None
+            if self.writeback:
+                wbDecl = '''MicroAddiUop(machInst,
+                              intRegInMode((OperatingMode)regMode, INTREG_SP),
+                              intRegInMode((OperatingMode)regMode, INTREG_SP),
+                              %d);''' % wbDiff
+
             (newHeader,
              newDecoder,
              newExec) = self.fillTemplates(self.name, self.Name, codeBlobs,
                  ["ArmISA::TLB::AlignWord", "ArmISA::TLB::MustBeOne"], [],
-                 base = 'SrsOp')
+                 'SrsOp', wbDecl)
 
             header_output += newHeader
             decoder_output += newDecoder