Deleted Added
sdiff udiff text old ( 12236:126ac9da6050 ) new ( 12584:2af98e1fb894 )
full compact
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

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

139 microop.micropc = len(self.microops)
140 self.microops.append(microop)
141 def setAdjustEnv(self, val):
142 self.adjust_env = val
143 def adjustImm(self, val):
144 self.adjust_imm += val
145 def adjustDisp(self, val):
146 self.adjust_disp += val
147 def serializing(self):
148 self.serializing = True
149
150 def function_call(self):
151 self.function_call = True
152 def function_return(self):
153 self.function_return = True
154
155 def __init__(self, name):
156 super(X86Macroop, self).__init__(name)
157 self.directives = {
158 "adjust_env" : self.setAdjustEnv,
159 "adjust_imm" : self.adjustImm,
160 "adjust_disp" : self.adjustDisp,
161 "serializing" : self.serializing,
162 "function_call" : self.function_call,
163 "function_return" : self.function_return
164 }
165 self.declared = False
166 self.adjust_env = ""
167 self.init_env = ""
168 self.adjust_imm = '''
169 uint64_t adjustedImm = IMMEDIATE;
170 //This is to pacify gcc in case the immediate isn't used.
171 adjustedImm = adjustedImm;
172 '''
173 self.adjust_disp = '''
174 uint64_t adjustedDisp = DISPLACEMENT;
175 //This is to pacify gcc in case the displacement isn't used.
176 adjustedDisp = adjustedDisp;
177 '''
178 self.serializing = False
179 self.function_call = False
180 self.function_return = False
181
182 def getAllocator(self, env):
183 return "new X86Macroop::%s(machInst, %s)" % \
184 (self.name, env.getAllocator())
185 def getMnemonic(self):
186 mnemonic = self.name.lower()

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

201 def getDefinition(self, env):
202 #FIXME This first parameter should be the mnemonic. I need to
203 #write some code which pulls that out
204 numMicroops = len(self.microops)
205 allocMicroops = ''
206 micropc = 0
207 for op in self.microops:
208 flags = ["IsMicroop"]
209 if micropc == numMicroops - 1:
210 flags.append("IsLastMicroop")
211
212 if self.serializing:
213 flags.append("IsSerializing")
214 flags.append("IsSerializeAfter")
215
216 if self.function_call:
217 flags.append("IsCall")
218 if self.function_return:
219 flags.append("IsReturn")
220 else:
221 flags.append("IsDelayedCommit")
222 if micropc == 0:
223 flags.append("IsFirstMicroop")
224 allocMicroops += \
225 "microops[%d] = %s;\n" % \
226 (micropc, op.getAllocator(flags))
227 micropc += 1
228 if env.useStackSize:
229 useStackSize = "true"
230 else:
231 useStackSize = "false"

--- 108 unchanged lines hidden ---