macroop.isa (12236:126ac9da6050) | macroop.isa (12584:2af98e1fb894) |
---|---|
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 | 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 | 147 def serializeBefore(self): 148 self.serialize_before = True 149 def serializeAfter(self): 150 self.serialize_after = 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, | 151 152 def function_call(self): 153 self.function_call = True 154 def function_return(self): 155 self.function_return = True 156 157 def __init__(self, name): 158 super(X86Macroop, self).__init__(name) 159 self.directives = { 160 "adjust_env" : self.setAdjustEnv, 161 "adjust_imm" : self.adjustImm, 162 "adjust_disp" : self.adjustDisp, |
161 "serializing" : self.serializing, | 163 "serialize_before" : self.serializeBefore, 164 "serialize_after" : self.serializeAfter, |
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 ''' | 165 "function_call" : self.function_call, 166 "function_return" : self.function_return 167 } 168 self.declared = False 169 self.adjust_env = "" 170 self.init_env = "" 171 self.adjust_imm = ''' 172 uint64_t adjustedImm = IMMEDIATE; 173 //This is to pacify gcc in case the immediate isn't used. 174 adjustedImm = adjustedImm; 175 ''' 176 self.adjust_disp = ''' 177 uint64_t adjustedDisp = DISPLACEMENT; 178 //This is to pacify gcc in case the displacement isn't used. 179 adjustedDisp = adjustedDisp; 180 ''' |
178 self.serializing = False | 181 self.serialize_before = False 182 self.serialize_after = 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"] | 183 self.function_call = False 184 self.function_return = False 185 186 def getAllocator(self, env): 187 return "new X86Macroop::%s(machInst, %s)" % \ 188 (self.name, env.getAllocator()) 189 def getMnemonic(self): 190 mnemonic = self.name.lower() --- 14 unchanged lines hidden (view full) --- 205 def getDefinition(self, env): 206 #FIXME This first parameter should be the mnemonic. I need to 207 #write some code which pulls that out 208 numMicroops = len(self.microops) 209 allocMicroops = '' 210 micropc = 0 211 for op in self.microops: 212 flags = ["IsMicroop"] |
213 if micropc == 0: 214 flags.append("IsFirstMicroop") 215 216 if self.serialize_before: 217 flags.append("IsSerializing") 218 flags.append("IsSerializeBefore") 219 |
|
209 if micropc == numMicroops - 1: 210 flags.append("IsLastMicroop") 211 | 220 if micropc == numMicroops - 1: 221 flags.append("IsLastMicroop") 222 |
212 if self.serializing: | 223 if self.serialize_after: |
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") | 224 flags.append("IsSerializing") 225 flags.append("IsSerializeAfter") 226 227 if self.function_call: 228 flags.append("IsCall") 229 if self.function_return: 230 flags.append("IsReturn") 231 else: 232 flags.append("IsDelayedCommit") |
222 if micropc == 0: 223 flags.append("IsFirstMicroop") | 233 |
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 --- | 234 allocMicroops += \ 235 "microops[%d] = %s;\n" % \ 236 (micropc, op.getAllocator(flags)) 237 micropc += 1 238 if env.useStackSize: 239 useStackSize = "true" 240 else: 241 useStackSize = "false" --- 108 unchanged lines hidden --- |