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
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
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
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
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;")
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);
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
(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
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):
'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',
'''
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)
'''
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)
'''
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)