ldstop.isa (4587:2c9a2534a489) ldstop.isa (4601:38c989d15fef)
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

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

54// Authors: Gabe Black
55
56//////////////////////////////////////////////////////////////////////////
57//
58// LdStOp Microop templates
59//
60//////////////////////////////////////////////////////////////////////////
61
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

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

54// Authors: Gabe Black
55
56//////////////////////////////////////////////////////////////////////////
57//
58// LdStOp Microop templates
59//
60//////////////////////////////////////////////////////////////////////////
61
62
63// Load templates
64
65output header {{
66 /**
67 * Base class for load and store ops
68 */
69 class LdStOp : public X86MicroopBase
70 {
71 protected:
72 const uint8_t scale;

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

114 printReg(response, index);
115 response << " + ";
116 printReg(response, base);
117 ccprintf(response, " + %#x]", disp);
118 return response.str();
119 }
120}};
121
62output header {{
63 /**
64 * Base class for load and store ops
65 */
66 class LdStOp : public X86MicroopBase
67 {
68 protected:
69 const uint8_t scale;

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

111 printReg(response, index);
112 response << " + ";
113 printReg(response, base);
114 ccprintf(response, " + %#x]", disp);
115 return response.str();
116 }
117}};
118
119// LEA template
120
121def template MicroLeaExecute {{
122 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
123 Trace::InstRecord *traceData) const
124 {
125 Fault fault = NoFault;
126 Addr EA;
127
128 %(op_decl)s;
129 %(op_rd)s;
130 %(ea_code)s;
131 DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA);
132
133 %(code)s;
134 if(fault == NoFault)
135 {
136 %(op_wb)s;
137 }
138
139 return fault;
140 }
141}};
142
143def template MicroLeaDeclare {{
144 class %(class_name)s : public %(base_class)s
145 {
146 protected:
147 void buildMe();
148
149 public:
150 %(class_name)s(ExtMachInst _machInst,
151 const char * instMnem,
152 bool isMicro, bool isDelayed, bool isFirst, bool isLast,
153 uint8_t _scale, RegIndex _index, RegIndex _base,
154 uint64_t _disp, uint8_t _segment,
155 RegIndex _data,
156 uint8_t _dataSize, uint8_t _addressSize);
157
158 %(class_name)s(ExtMachInst _machInst,
159 const char * instMnem,
160 uint8_t _scale, RegIndex _index, RegIndex _base,
161 uint64_t _disp, uint8_t _segment,
162 RegIndex _data,
163 uint8_t _dataSize, uint8_t _addressSize);
164
165 %(BasicExecDeclare)s
166 };
167}};
168
169// Load templates
170
122def template MicroLoadExecute {{
123 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
124 Trace::InstRecord *traceData) const
125 {
126 Fault fault = NoFault;
127 Addr EA;
128
129 %(op_decl)s;

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

406 {"code": code, "ea_code": calculateEA})
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):
171def template MicroLoadExecute {{
172 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
173 Trace::InstRecord *traceData) const
174 {
175 Fault fault = NoFault;
176 Addr EA;
177
178 %(op_decl)s;

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

455 {"code": code, "ea_code": calculateEA})
456 header_output += MicroLdStOpDeclare.subst(iop)
457 decoder_output += MicroLdStOpConstructor.subst(iop)
458 exec_output += MicroStoreExecute.subst(iop)
459 exec_output += MicroStoreInitiateAcc.subst(iop)
460 exec_output += MicroStoreCompleteAcc.subst(iop)
461
462 class StoreOp(LdStOp):
414 def __init__(self, data, addr, segment):
415 super(LoadOp, self).__init__(data, addr, segment)
463 def __init__(self, data, segment, addr, disp = 0):
464 super(LoadOp, self).__init__(data, segment, addr, disp)
416 self.className = Name
417 self.mnemonic = name
418
419 microopClasses[name] = StoreOp
420
421 defineMicroLoadOp('St', 'Mem = Data;')
465 self.className = Name
466 self.mnemonic = name
467
468 microopClasses[name] = StoreOp
469
470 defineMicroLoadOp('St', 'Mem = Data;')
471
472 iop = InstObjParams("lea", "Lea", 'LdStOp',
473 {"code": "Data = merge(Data, EA, dataSize);", "ea_code": calculateEA})
474 header_output += MicroLeaDeclare.subst(iop)
475 decoder_output += MicroLdStOpConstructor.subst(iop)
476 exec_output += MicroLeaExecute.subst(iop)
477
478 class LeaOp(LdStOp):
479 def __init__(self, data, segment, addr, disp = 0):
480 super(LeaOp, self).__init__(data, segment, addr, disp)
481 self.className = "Lea"
482 self.mnemonic = "lea"
483
484 microopClasses["lea"] = LeaOp
422}};
423
485}};
486