macroop.isa (7620:3d8a23caa1ef) macroop.isa (7621:3a6468fa514f)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007 The Hewlett-Packard Development Company
4// All rights reserved.
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

--- 125 unchanged lines hidden (view full) ---

134 microop.micropc = len(self.microops)
135 self.microops.append(microop)
136 def setAdjustEnv(self, val):
137 self.adjust_env = val
138 def adjustImm(self, val):
139 self.adjust_imm += val
140 def adjustDisp(self, val):
141 self.adjust_disp += val
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007 The Hewlett-Packard Development Company
4// All rights reserved.
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

--- 125 unchanged lines hidden (view full) ---

134 microop.micropc = len(self.microops)
135 self.microops.append(microop)
136 def setAdjustEnv(self, val):
137 self.adjust_env = val
138 def adjustImm(self, val):
139 self.adjust_imm += val
140 def adjustDisp(self, val):
141 self.adjust_disp += val
142 def serializing(self):
143 self.serializing = True
142 def __init__(self, name):
143 super(X86Macroop, self).__init__(name)
144 self.directives = {
145 "adjust_env" : self.setAdjustEnv,
146 "adjust_imm" : self.adjustImm,
144 def __init__(self, name):
145 super(X86Macroop, self).__init__(name)
146 self.directives = {
147 "adjust_env" : self.setAdjustEnv,
148 "adjust_imm" : self.adjustImm,
147 "adjust_disp" : self.adjustDisp
149 "adjust_disp" : self.adjustDisp,
150 "serializing" : self.serializing
148 }
149 self.declared = False
150 self.adjust_env = ""
151 self.init_env = ""
152 self.adjust_imm = '''
153 uint64_t adjustedImm = IMMEDIATE;
154 //This is to pacify gcc in case the immediate isn't used.
155 adjustedImm = adjustedImm;
156 '''
157 self.adjust_disp = '''
158 uint64_t adjustedDisp = DISPLACEMENT;
159 //This is to pacify gcc in case the displacement isn't used.
160 adjustedDisp = adjustedDisp;
161 '''
151 }
152 self.declared = False
153 self.adjust_env = ""
154 self.init_env = ""
155 self.adjust_imm = '''
156 uint64_t adjustedImm = IMMEDIATE;
157 //This is to pacify gcc in case the immediate isn't used.
158 adjustedImm = adjustedImm;
159 '''
160 self.adjust_disp = '''
161 uint64_t adjustedDisp = DISPLACEMENT;
162 //This is to pacify gcc in case the displacement isn't used.
163 adjustedDisp = adjustedDisp;
164 '''
165 self.serializing = False
162 def getAllocator(self, env):
163 return "new X86Macroop::%s(machInst, %s)" % \
164 (self.name, env.getAllocator())
165 def getMnemonic(self):
166 mnemonic = self.name.lower()
167 mnemonic = re.match(r'[^_]*', mnemonic).group(0)
168 return mnemonic
169 def getDeclaration(self):

--- 13 unchanged lines hidden (view full) ---

183 #write some code which pulls that out
184 numMicroops = len(self.microops)
185 allocMicroops = ''
186 micropc = 0
187 for op in self.microops:
188 flags = ["IsMicroop"]
189 if micropc == numMicroops - 1:
190 flags.append("IsLastMicroop")
166 def getAllocator(self, env):
167 return "new X86Macroop::%s(machInst, %s)" % \
168 (self.name, env.getAllocator())
169 def getMnemonic(self):
170 mnemonic = self.name.lower()
171 mnemonic = re.match(r'[^_]*', mnemonic).group(0)
172 return mnemonic
173 def getDeclaration(self):

--- 13 unchanged lines hidden (view full) ---

187 #write some code which pulls that out
188 numMicroops = len(self.microops)
189 allocMicroops = ''
190 micropc = 0
191 for op in self.microops:
192 flags = ["IsMicroop"]
193 if micropc == numMicroops - 1:
194 flags.append("IsLastMicroop")
195 if self.serializing:
196 flags.append("IsSerializing")
197 flags.append("IsSerializeAfter")
191 else:
192 flags.append("IsDelayedCommit")
193 if micropc == 0:
194 flags.append("IsFirstMicroop")
195 allocMicroops += \
196 "microops[%d] = %s;\n" % \
197 (micropc, op.getAllocator(flags))
198 micropc += 1

--- 112 unchanged lines hidden ---
198 else:
199 flags.append("IsDelayedCommit")
200 if micropc == 0:
201 flags.append("IsFirstMicroop")
202 allocMicroops += \
203 "microops[%d] = %s;\n" % \
204 (micropc, op.getAllocator(flags))
205 micropc += 1

--- 112 unchanged lines hidden ---