ldstop.isa (5027:e96b8a4f4d96) | ldstop.isa (5118:f1b1cb6d0fbe) |
---|---|
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 --- 109 unchanged lines hidden (view full) --- 118 Fault fault = NoFault; 119 Addr EA; 120 121 %(op_decl)s; 122 %(op_rd)s; 123 %(ea_code)s; 124 DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA); 125 | 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 --- 109 unchanged lines hidden (view full) --- 118 Fault fault = NoFault; 119 Addr EA; 120 121 %(op_decl)s; 122 %(op_rd)s; 123 %(ea_code)s; 124 DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA); 125 |
126 fault = read(xc, EA, Mem, 0); | 126 fault = read(xc, EA, Mem, (%(mem_flags)s) | (1 << segment)); |
127 128 if(fault == NoFault) 129 { 130 %(code)s; 131 } 132 if(fault == NoFault) 133 { 134 %(op_wb)s; --- 10 unchanged lines hidden (view full) --- 145 Fault fault = NoFault; 146 Addr EA; 147 148 %(op_decl)s; 149 %(op_rd)s; 150 %(ea_code)s; 151 DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA); 152 | 127 128 if(fault == NoFault) 129 { 130 %(code)s; 131 } 132 if(fault == NoFault) 133 { 134 %(op_wb)s; --- 10 unchanged lines hidden (view full) --- 145 Fault fault = NoFault; 146 Addr EA; 147 148 %(op_decl)s; 149 %(op_rd)s; 150 %(ea_code)s; 151 DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA); 152 |
153 fault = read(xc, EA, Mem, 0); | 153 fault = read(xc, EA, Mem, (%(mem_flags)s) | (1 << segment)); |
154 155 return fault; 156 } 157}}; 158 159def template MicroLoadCompleteAcc {{ 160 Fault %(class_name)s::completeAcc(PacketPtr pkt, 161 %(CPU_exec_context)s * xc, --- 30 unchanged lines hidden (view full) --- 192 %(op_rd)s; 193 %(ea_code)s; 194 DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA); 195 196 %(code)s; 197 198 if(fault == NoFault) 199 { | 154 155 return fault; 156 } 157}}; 158 159def template MicroLoadCompleteAcc {{ 160 Fault %(class_name)s::completeAcc(PacketPtr pkt, 161 %(CPU_exec_context)s * xc, --- 30 unchanged lines hidden (view full) --- 192 %(op_rd)s; 193 %(ea_code)s; 194 DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA); 195 196 %(code)s; 197 198 if(fault == NoFault) 199 { |
200 fault = write(xc, Mem, EA, 0); | 200 fault = write(xc, Mem, EA, (%(mem_flags)s) | (1 << segment)); |
201 if(fault == NoFault) 202 { 203 %(op_wb)s; 204 } 205 } 206 207 return fault; 208 } --- 10 unchanged lines hidden (view full) --- 219 %(op_rd)s; 220 %(ea_code)s; 221 DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA); 222 223 %(code)s; 224 225 if(fault == NoFault) 226 { | 201 if(fault == NoFault) 202 { 203 %(op_wb)s; 204 } 205 } 206 207 return fault; 208 } --- 10 unchanged lines hidden (view full) --- 219 %(op_rd)s; 220 %(ea_code)s; 221 DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA); 222 223 %(code)s; 224 225 if(fault == NoFault) 226 { |
227 fault = write(xc, Mem, EA, 0); | 227 fault = write(xc, Mem, EA, (%(mem_flags)s) | (1 << segment)); |
228 if(fault == NoFault) 229 { 230 %(op_wb)s; 231 } 232 } 233 return fault; 234 } 235}}; --- 117 unchanged lines hidden (view full) --- 353 # Make these empty strings so that concatenating onto 354 # them will always work. 355 header_output = "" 356 decoder_output = "" 357 exec_output = "" 358 359 calculateEA = "EA = SegBase + scale * Index + Base + disp;" 360 | 228 if(fault == NoFault) 229 { 230 %(op_wb)s; 231 } 232 } 233 return fault; 234 } 235}}; --- 117 unchanged lines hidden (view full) --- 353 # Make these empty strings so that concatenating onto 354 # them will always work. 355 header_output = "" 356 decoder_output = "" 357 exec_output = "" 358 359 calculateEA = "EA = SegBase + scale * Index + Base + disp;" 360 |
361 def defineMicroLoadOp(mnemonic, code): | 361 def defineMicroLoadOp(mnemonic, code, mem_flags=0): |
362 global header_output 363 global decoder_output 364 global exec_output 365 global microopClasses 366 Name = mnemonic 367 name = mnemonic.lower() 368 369 # Build up the all register version of this micro op 370 iop = InstObjParams(name, Name, 'X86ISA::LdStOp', | 362 global header_output 363 global decoder_output 364 global exec_output 365 global microopClasses 366 Name = mnemonic 367 name = mnemonic.lower() 368 369 # Build up the all register version of this micro op 370 iop = InstObjParams(name, Name, 'X86ISA::LdStOp', |
371 {"code": code, "ea_code": calculateEA}) | 371 {"code": code, 372 "ea_code": calculateEA, 373 "mem_flags": mem_flags}) |
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, 380 disp = 0, dataSize="env.dataSize"): 381 super(LoadOp, self).__init__(data, segment, 382 addr, disp, dataSize) 383 self.className = Name 384 self.mnemonic = name 385 386 microopClasses[name] = LoadOp 387 388 defineMicroLoadOp('Ld', 'Data = merge(Data, Mem, dataSize);') | 374 header_output += MicroLdStOpDeclare.subst(iop) 375 decoder_output += MicroLdStOpConstructor.subst(iop) 376 exec_output += MicroLoadExecute.subst(iop) 377 exec_output += MicroLoadInitiateAcc.subst(iop) 378 exec_output += MicroLoadCompleteAcc.subst(iop) 379 380 class LoadOp(LdStOp): 381 def __init__(self, data, segment, addr, 382 disp = 0, dataSize="env.dataSize"): 383 super(LoadOp, self).__init__(data, segment, 384 addr, disp, dataSize) 385 self.className = Name 386 self.mnemonic = name 387 388 microopClasses[name] = LoadOp 389 390 defineMicroLoadOp('Ld', 'Data = merge(Data, Mem, dataSize);') |
391 defineMicroLoadOp('Ldst', 'Data = merge(Data, Mem, dataSize);', 'StoreCheck') |
|
389 defineMicroLoadOp('Ldfp', 'FpData.uqw = Mem;') 390 | 392 defineMicroLoadOp('Ldfp', 'FpData.uqw = Mem;') 393 |
391 def defineMicroStoreOp(mnemonic, code): | 394 def defineMicroStoreOp(mnemonic, code, mem_flags=0): |
392 global header_output 393 global decoder_output 394 global exec_output 395 global microopClasses 396 Name = mnemonic 397 name = mnemonic.lower() 398 399 # Build up the all register version of this micro op 400 iop = InstObjParams(name, Name, 'X86ISA::LdStOp', | 395 global header_output 396 global decoder_output 397 global exec_output 398 global microopClasses 399 Name = mnemonic 400 name = mnemonic.lower() 401 402 # Build up the all register version of this micro op 403 iop = InstObjParams(name, Name, 'X86ISA::LdStOp', |
401 {"code": code, "ea_code": calculateEA}) | 404 {"code": code, 405 "ea_code": calculateEA, 406 "mem_flags": mem_flags}) |
402 header_output += MicroLdStOpDeclare.subst(iop) 403 decoder_output += MicroLdStOpConstructor.subst(iop) 404 exec_output += MicroStoreExecute.subst(iop) 405 exec_output += MicroStoreInitiateAcc.subst(iop) 406 exec_output += MicroStoreCompleteAcc.subst(iop) 407 408 class StoreOp(LdStOp): 409 def __init__(self, data, segment, addr, --- 4 unchanged lines hidden (view full) --- 414 self.mnemonic = name 415 416 microopClasses[name] = StoreOp 417 418 defineMicroStoreOp('St', 'Mem = Data;') 419 defineMicroStoreOp('Stfp', 'Mem = FpData.uqw;') 420 421 iop = InstObjParams("lea", "Lea", 'X86ISA::LdStOp', | 407 header_output += MicroLdStOpDeclare.subst(iop) 408 decoder_output += MicroLdStOpConstructor.subst(iop) 409 exec_output += MicroStoreExecute.subst(iop) 410 exec_output += MicroStoreInitiateAcc.subst(iop) 411 exec_output += MicroStoreCompleteAcc.subst(iop) 412 413 class StoreOp(LdStOp): 414 def __init__(self, data, segment, addr, --- 4 unchanged lines hidden (view full) --- 419 self.mnemonic = name 420 421 microopClasses[name] = StoreOp 422 423 defineMicroStoreOp('St', 'Mem = Data;') 424 defineMicroStoreOp('Stfp', 'Mem = FpData.uqw;') 425 426 iop = InstObjParams("lea", "Lea", 'X86ISA::LdStOp', |
422 {"code": "Data = merge(Data, EA, dataSize);", "ea_code": calculateEA}) | 427 {"code": "Data = merge(Data, EA, dataSize);", 428 "ea_code": calculateEA, 429 "mem_flags": 0}) |
423 header_output += MicroLeaDeclare.subst(iop) 424 decoder_output += MicroLdStOpConstructor.subst(iop) 425 exec_output += MicroLeaExecute.subst(iop) 426 427 class LeaOp(LdStOp): 428 def __init__(self, data, segment, addr, 429 disp = 0, dataSize="env.dataSize"): 430 super(LeaOp, self).__init__(data, segment, 431 addr, disp, dataSize) 432 self.className = "Lea" 433 self.mnemonic = "lea" 434 435 microopClasses["lea"] = LeaOp 436}}; 437 | 430 header_output += MicroLeaDeclare.subst(iop) 431 decoder_output += MicroLdStOpConstructor.subst(iop) 432 exec_output += MicroLeaExecute.subst(iop) 433 434 class LeaOp(LdStOp): 435 def __init__(self, data, segment, addr, 436 disp = 0, dataSize="env.dataSize"): 437 super(LeaOp, self).__init__(data, segment, 438 addr, disp, dataSize) 439 self.className = "Lea" 440 self.mnemonic = "lea" 441 442 microopClasses["lea"] = LeaOp 443}}; 444 |