diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-05-21 11:34:41 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-05-21 11:34:41 -0500 |
commit | 30fe807316ebc4b6c37ca522b3cfd6c592ca9003 (patch) | |
tree | 12f5e529771617cf5c1ce93ea0200a5cf4a4a45e /src/arch/x86/isa/macroop.isa | |
parent | fba40864aab3015009efe4ade7599c07bc28ab1a (diff) | |
download | gem5-30fe807316ebc4b6c37ca522b3cfd6c592ca9003.tar.xz |
x86: mark instructions for being function call/return
Currently call and return instructions are marked as IsCall and IsReturn. Thus, the
branch predictor does not use RAS for these instructions. Similarly, the number of
function calls that took place is recorded as 0. This patch marks these instructions
as they should be.
Diffstat (limited to 'src/arch/x86/isa/macroop.isa')
-rw-r--r-- | src/arch/x86/isa/macroop.isa | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/arch/x86/isa/macroop.isa b/src/arch/x86/isa/macroop.isa index 94b17ff4c..d510a0c7c 100644 --- a/src/arch/x86/isa/macroop.isa +++ b/src/arch/x86/isa/macroop.isa @@ -141,13 +141,21 @@ let {{ self.adjust_disp += val def serializing(self): self.serializing = True + + def function_call(self): + self.function_call = True + def function_return(self): + self.function_return = True + def __init__(self, name): super(X86Macroop, self).__init__(name) self.directives = { "adjust_env" : self.setAdjustEnv, "adjust_imm" : self.adjustImm, "adjust_disp" : self.adjustDisp, - "serializing" : self.serializing + "serializing" : self.serializing, + "function_call" : self.function_call, + "function_return" : self.function_return } self.declared = False self.adjust_env = "" @@ -163,6 +171,9 @@ let {{ adjustedDisp = adjustedDisp; ''' self.serializing = False + self.function_call = False + self.function_return = False + def getAllocator(self, env): return "new X86Macroop::%s(machInst, %s)" % \ (self.name, env.getAllocator()) @@ -192,9 +203,15 @@ let {{ flags = ["IsMicroop"] if micropc == numMicroops - 1: flags.append("IsLastMicroop") + if self.serializing: flags.append("IsSerializing") flags.append("IsSerializeAfter") + + if self.function_call: + flags.append("IsCall") + if self.function_return: + flags.append("IsReturn") else: flags.append("IsDelayedCommit") if micropc == 0: |