ARM: Make VMSR, RFE PC/LR etc non speculative, and serializing
authorAli Saidi <Ali.Saidi@ARM.com>
Thu, 26 Aug 2010 00:10:43 +0000 (19:10 -0500)
committerAli Saidi <Ali.Saidi@ARM.com>
Thu, 26 Aug 2010 00:10:43 +0000 (19:10 -0500)
src/arch/arm/isa/insts/data.isa
src/arch/arm/isa/insts/fp.isa
src/arch/arm/isa/insts/ldr.isa
src/arch/arm/isa/insts/macromem.isa
src/arch/arm/isa/insts/misc.isa

index 5cb9e545bf9377e760b78cc65f245460fa5bb5fd..74eeee3b2eff0c3b91dd3c381421a361eabac22b 100644 (file)
@@ -106,7 +106,7 @@ let {{
     regRegOp2 = "shift_rm_rs(Op2, Shift<7:0>, shiftType, CondCodes<29:>)"
 
     def buildImmDataInst(mnem, code, flagType = "logic", suffix = "Imm", \
-                         buildCc = True, buildNonCc = True):
+                         buildCc = True, buildNonCc = True, instFlags = []):
         cCode = carryCode[flagType]
         vCode = overflowCode[flagType]
         negBit = 31
@@ -125,11 +125,11 @@ let {{
         immCode = secondOpRe.sub(immOp2, code)
         immIop = InstObjParams(mnem, mnem.capitalize() + suffix, "DataImmOp",
                                {"code" : immCode,
-                                "predicate_test": predicateTest})
+                                "predicate_test": predicateTest}, instFlags)
         immIopCc = InstObjParams(mnem + "s", mnem.capitalize() + suffix + "Cc",
                                  "DataImmOp",
                                  {"code" : immCode + immCcCode,
-                                  "predicate_test": condPredicateTest})
+                                  "predicate_test": condPredicateTest}, instFlags)
 
         def subst(iop):
             global header_output, decoder_output, exec_output
@@ -143,7 +143,7 @@ let {{
             subst(immIopCc)
 
     def buildRegDataInst(mnem, code, flagType = "logic", suffix = "Reg", \
-                         buildCc = True, buildNonCc = True):
+                         buildCc = True, buildNonCc = True, instFlags = []):
         cCode = carryCode[flagType]
         vCode = overflowCode[flagType]
         negBit = 31
@@ -162,11 +162,12 @@ let {{
         regCode = secondOpRe.sub(regOp2, code)
         regIop = InstObjParams(mnem, mnem.capitalize() + suffix, "DataRegOp",
                                {"code" : regCode,
-                                "predicate_test": predicateTest})
+                                "predicate_test": predicateTest}, instFlags)
         regIopCc = InstObjParams(mnem + "s", mnem.capitalize() + suffix + "Cc",
                                  "DataRegOp",
                                  {"code" : regCode + regCcCode,
-                                  "predicate_test": condPredicateTest})
+                                  "predicate_test": condPredicateTest},
+                                  instFlags)
 
         def subst(iop):
             global header_output, decoder_output, exec_output
@@ -240,9 +241,11 @@ let {{
             CondCodes = CondCodesMask & newCpsr;
             '''
             buildImmDataInst(mnem + 's', code, flagType,
-                             suffix = "ImmPclr", buildCc = False)
+                             suffix = "ImmPclr", buildCc = False,
+                             instFlags = ["IsSerializeAfter","IsNonSpeculative"])
             buildRegDataInst(mnem + 's', code, flagType,
-                             suffix = "RegPclr", buildCc = False)
+                             suffix = "RegPclr", buildCc = False,
+                             instFlags = ["IsSerializeAfter","IsNonSpeculative"])
 
     buildDataInst("and", "Dest = resTemp = Op1 & secondOp;")
     buildDataInst("eor", "Dest = resTemp = Op1 ^ secondOp;")
index 6ba4ac3bf0c5dafccd29806269f87e2dac2349c3..6d91ebf53d4a0d676f12dad3039368947d14e0c5 100644 (file)
@@ -194,7 +194,8 @@ let {{
     vmsrIop = InstObjParams("vmsr", "Vmsr", "FpRegRegOp",
                             { "code": vmsrEnabledCheckCode + \
                                       "MiscDest = Op1;",
-                              "predicate_test": predicateTest }, [])
+                              "predicate_test": predicateTest },
+                             ["IsSerializeAfter","IsNonSpeculative"])
     header_output += FpRegRegOpDeclare.subst(vmsrIop);
     decoder_output += FpRegRegOpConstructor.subst(vmsrIop);
     exec_output += PredOpExecute.subst(vmsrIop);
index 38a458b2367584f54940a5da0081246abed29e0e..dc043ed8e64ba06d7ff8e6dfc3469d77e4b2519e 100644 (file)
@@ -67,7 +67,7 @@ let {{
             self.memFlags = ["ArmISA::TLB::MustBeOne"]
             self.codeBlobs = {"postacc_code" : ""}
 
-        def emitHelper(self, base = 'Memory', wbDecl = None):
+        def emitHelper(self, base = 'Memory', wbDecl = None, instFlags = []):
 
             global header_output, decoder_output, exec_output
 
@@ -76,7 +76,7 @@ let {{
             (newHeader,
              newDecoder,
              newExec) = self.fillTemplates(self.name, self.Name, codeBlobs,
-                                           self.memFlags, [], base, wbDecl)
+                                           self.memFlags, instFlags, base, wbDecl)
 
             header_output += newHeader
             decoder_output += newDecoder
@@ -118,7 +118,7 @@ let {{
             wbDecl = None
             if self.writeback:
                 wbDecl = "MicroAddiUop(machInst, base, base, %d);" % wbDiff
-            self.emitHelper('RfeOp', wbDecl)
+            self.emitHelper('RfeOp', wbDecl, ["IsSerializeAfter", "IsNonSpeculative"])
 
     class LoadImmInst(LoadInst):
         def __init__(self, *args, **kargs):
index f595f4043423768d5b3ec84c8b938d8eee3c2bce..6bf789efd0be546ec47dfdfa3d8df8651fb94a70 100644 (file)
@@ -101,7 +101,7 @@ let {{
                                        'ea_code':
                                           'EA = Rb + (up ? imm : -imm);',
                                        'predicate_test': condPredicateTest},
-                                      ['IsMicroop'])
+                                      ['IsMicroop','IsNonSpeculative','IsSerializeAfter'])
 
     microStrUopCode = "Mem = cSwap(Ra.uw, ((CPSR)Cpsr).e);"
     microStrUopIop = InstObjParams('str_uop', 'MicroStrUop',
index 1203726037c83e1453c0746015bc707f3a446d25..089b7bc86397d8888ec3cfc63f4d7a22ebec8282 100644 (file)
@@ -490,7 +490,7 @@ let {{
     '''
     wfeIop = InstObjParams("wfe", "WfeInst", "PredOp", \
             { "code" : wfeCode, "predicate_test" : predicateTest },
-            ["IsNonSpeculative", "IsQuiesce"])
+            ["IsNonSpeculative", "IsQuiesce", "IsSerializeAfter"])
     header_output += BasicDeclare.subst(wfeIop)
     decoder_output += BasicConstructor.subst(wfeIop)
     exec_output += PredOpExecute.subst(wfeIop)
@@ -517,14 +517,15 @@ let {{
     '''
     sevIop = InstObjParams("sev", "SevInst", "PredOp", \
             { "code" : sevCode, "predicate_test" : predicateTest },
-            ["IsNonSpeculative", "IsQuiesce"])
+            ["IsNonSpeculative", "IsQuiesce", "IsSerializeAfter"])
     header_output += BasicDeclare.subst(sevIop)
     decoder_output += BasicConstructor.subst(sevIop)
     exec_output += PredOpExecute.subst(sevIop)
 
     itIop = InstObjParams("it", "ItInst", "PredOp", \
             { "code" : "Itstate = machInst.newItstate;",
-              "predicate_test" : predicateTest })
+              "predicate_test" : predicateTest },
+            ["IsNonSpeculative", "IsSerializeAfter"])
     header_output += BasicDeclare.subst(itIop)
     decoder_output += BasicConstructor.subst(itIop)
     exec_output += PredOpExecute.subst(itIop)
@@ -663,7 +664,8 @@ let {{
     '''
     setendIop = InstObjParams("setend", "Setend", "ImmOp",
                               { "code": setendCode,
-                                "predicate_test": predicateTest }, [])
+                                "predicate_test": predicateTest },
+                              ["IsSerializeAfter","IsNonSpeculative"])
     header_output += ImmOpDeclare.subst(setendIop)
     decoder_output += ImmOpConstructor.subst(setendIop)
     exec_output += PredOpExecute.subst(setendIop)