ldstop.isa (4706:4ede9a05bb42) | ldstop.isa (4712:79b4c64296ce) |
---|---|
1// Copyright (c) 2007 The Hewlett-Packard Development Company 2// All rights reserved. 3// 4// Redistribution and use of this software in source and binary forms, 5// with or without modification, are permitted provided that the 6// following conditions are met: 7// 8// The software must be used only for Non-Commercial Use which means any --- 311 unchanged lines hidden (view full) --- 320 _dataSize, _addressSize, %(op_class)s) 321 { 322 buildMe(); 323 } 324}}; 325 326let {{ 327 class LdStOp(X86Microop): | 1// Copyright (c) 2007 The Hewlett-Packard Development Company 2// All rights reserved. 3// 4// Redistribution and use of this software in source and binary forms, 5// with or without modification, are permitted provided that the 6// following conditions are met: 7// 8// The software must be used only for Non-Commercial Use which means any --- 311 unchanged lines hidden (view full) --- 320 _dataSize, _addressSize, %(op_class)s) 321 { 322 buildMe(); 323 } 324}}; 325 326let {{ 327 class LdStOp(X86Microop): |
328 def __init__(self, data, segment, addr, disp): | 328 def __init__(self, data, segment, addr, disp, dataSize): |
329 self.data = data 330 [self.scale, self.index, self.base] = addr 331 self.disp = disp 332 self.segment = segment | 329 self.data = data 330 [self.scale, self.index, self.base] = addr 331 self.disp = disp 332 self.segment = segment |
333 self.dataSize = "env.dataSize" | 333 self.dataSize = dataSize |
334 self.addressSize = "env.addressSize" 335 336 def getAllocator(self, *microFlags): 337 allocator = '''new %(class_name)s(machInst, mnemonic 338 %(flags)s, %(scale)s, %(index)s, %(base)s, 339 %(disp)s, %(segment)s, %(data)s, 340 %(dataSize)s, %(addressSize)s)''' % { 341 "class_name" : self.className, --- 29 unchanged lines hidden (view full) --- 371 {"code": code, "ea_code": calculateEA}) 372 header_output += MicroLdStOpDeclare.subst(iop) 373 decoder_output += MicroLdStOpConstructor.subst(iop) 374 exec_output += MicroLoadExecute.subst(iop) 375 exec_output += MicroLoadInitiateAcc.subst(iop) 376 exec_output += MicroLoadCompleteAcc.subst(iop) 377 378 class LoadOp(LdStOp): | 334 self.addressSize = "env.addressSize" 335 336 def getAllocator(self, *microFlags): 337 allocator = '''new %(class_name)s(machInst, mnemonic 338 %(flags)s, %(scale)s, %(index)s, %(base)s, 339 %(disp)s, %(segment)s, %(data)s, 340 %(dataSize)s, %(addressSize)s)''' % { 341 "class_name" : self.className, --- 29 unchanged lines hidden (view full) --- 371 {"code": code, "ea_code": calculateEA}) 372 header_output += MicroLdStOpDeclare.subst(iop) 373 decoder_output += MicroLdStOpConstructor.subst(iop) 374 exec_output += MicroLoadExecute.subst(iop) 375 exec_output += MicroLoadInitiateAcc.subst(iop) 376 exec_output += MicroLoadCompleteAcc.subst(iop) 377 378 class LoadOp(LdStOp): |
379 def __init__(self, data, segment, addr, disp = 0): 380 super(LoadOp, self).__init__(data, segment, addr, disp) | 379 def __init__(self, data, segment, addr, 380 disp = 0, dataSize="env.dataSize"): 381 super(LoadOp, self).__init__(data, segment, 382 addr, disp, dataSize) |
381 self.className = Name 382 self.mnemonic = name 383 384 microopClasses[name] = LoadOp 385 386 defineMicroLoadOp('Ld', 'Data = merge(Data, Mem, dataSize);') 387 388 def defineMicroStoreOp(mnemonic, code): --- 9 unchanged lines hidden (view full) --- 398 {"code": code, "ea_code": calculateEA}) 399 header_output += MicroLdStOpDeclare.subst(iop) 400 decoder_output += MicroLdStOpConstructor.subst(iop) 401 exec_output += MicroStoreExecute.subst(iop) 402 exec_output += MicroStoreInitiateAcc.subst(iop) 403 exec_output += MicroStoreCompleteAcc.subst(iop) 404 405 class StoreOp(LdStOp): | 383 self.className = Name 384 self.mnemonic = name 385 386 microopClasses[name] = LoadOp 387 388 defineMicroLoadOp('Ld', 'Data = merge(Data, Mem, dataSize);') 389 390 def defineMicroStoreOp(mnemonic, code): --- 9 unchanged lines hidden (view full) --- 400 {"code": code, "ea_code": calculateEA}) 401 header_output += MicroLdStOpDeclare.subst(iop) 402 decoder_output += MicroLdStOpConstructor.subst(iop) 403 exec_output += MicroStoreExecute.subst(iop) 404 exec_output += MicroStoreInitiateAcc.subst(iop) 405 exec_output += MicroStoreCompleteAcc.subst(iop) 406 407 class StoreOp(LdStOp): |
406 def __init__(self, data, segment, addr, disp = 0): 407 super(StoreOp, self).__init__(data, segment, addr, disp) | 408 def __init__(self, data, segment, addr, 409 disp = 0, dataSize="env.dataSize"): 410 super(StoreOp, self).__init__(data, segment, 411 addr, disp, dataSize) |
408 self.className = Name 409 self.mnemonic = name 410 411 microopClasses[name] = StoreOp 412 413 defineMicroStoreOp('St', 'Mem = Data;') 414 415 iop = InstObjParams("lea", "Lea", 'X86ISA::LdStOp', 416 {"code": "Data = merge(Data, EA, dataSize);", "ea_code": calculateEA}) 417 header_output += MicroLeaDeclare.subst(iop) 418 decoder_output += MicroLdStOpConstructor.subst(iop) 419 exec_output += MicroLeaExecute.subst(iop) 420 421 class LeaOp(LdStOp): | 412 self.className = Name 413 self.mnemonic = name 414 415 microopClasses[name] = StoreOp 416 417 defineMicroStoreOp('St', 'Mem = Data;') 418 419 iop = InstObjParams("lea", "Lea", 'X86ISA::LdStOp', 420 {"code": "Data = merge(Data, EA, dataSize);", "ea_code": calculateEA}) 421 header_output += MicroLeaDeclare.subst(iop) 422 decoder_output += MicroLdStOpConstructor.subst(iop) 423 exec_output += MicroLeaExecute.subst(iop) 424 425 class LeaOp(LdStOp): |
422 def __init__(self, data, segment, addr, disp = 0): 423 super(LeaOp, self).__init__(data, segment, addr, disp) | 426 def __init__(self, data, segment, addr, 427 disp = 0, dataSize="env.dataSize"): 428 super(LeaOp, self).__init__(data, segment, 429 addr, disp, dataSize) |
424 self.className = "Lea" 425 self.mnemonic = "lea" 426 427 microopClasses["lea"] = LeaOp 428}}; 429 | 430 self.className = "Lea" 431 self.mnemonic = "lea" 432 433 microopClasses["lea"] = LeaOp 434}}; 435 |