Deleted Added
sdiff udiff text old ( 9761:f2102d45a753 ) new ( 9765:da0e0df0ba97 )
full compact
1// Copyright (c) 2007 The Hewlett-Packard Development Company
2// Copyright (c) 2012-2013 Mark D. Hill and David A. Wood
3// All rights reserved.
4//
5// The license below extends only to copyright in the software and shall
6// not be construed as granting a license to any other intellectual
7// property including but not limited to intellectual property relating
8// to a hardware implementation of the functionality of the software

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

52 DPRINTF(X86, "The data size is %d\n", dataSize);
53 %(op_decl)s;
54 %(op_rd)s;
55
56 if(%(cond_check)s)
57 {
58 %(code)s;
59 %(flag_code)s;
60 %(top_code)s;
61 }
62 else
63 {
64 %(else_code)s;
65 }
66
67 //Write the resulting state to the execution context

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

123 if flag_code is not "" or cond_check is not "true":
124 self.buildCppClasses(name, Name, suffix,
125 code, "", "true", else_code, op_class)
126 suffix = "Flags" + suffix
127
128 base = "X86ISA::FpOp"
129
130 # Get everything ready for the substitution
131 iop_top = InstObjParams(name, Name + suffix + "Top", base,
132 {"code" : code,
133 "flag_code" : flag_code,
134 "cond_check" : cond_check,
135 "else_code" : else_code,
136 "top_code" : "TOP = (TOP + spm + 8) % 8;",
137 "op_class" : op_class})
138 iop = InstObjParams(name, Name + suffix, base,
139 {"code" : code,
140 "flag_code" : flag_code,
141 "cond_check" : cond_check,
142 "else_code" : else_code,
143 "top_code" : ";",
144 "op_class" : op_class})
145
146 # Generate the actual code (finally!)
147 header_output += MicroFpOpDeclare.subst(iop_top)
148 decoder_output += MicroFpOpConstructor.subst(iop_top)
149 exec_output += MicroFpOpExecute.subst(iop_top)
150 header_output += MicroFpOpDeclare.subst(iop)
151 decoder_output += MicroFpOpConstructor.subst(iop)
152 exec_output += MicroFpOpExecute.subst(iop)
153
154

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

186
187 # Default template parameter values
188 flag_code = ""
189 cond_check = "true"
190 else_code = ";"
191 op_class = "FloatAddOp"
192
193 def __init__(self, dest, src1, spm=0, \
194 SetStatus=False, dataSize="env.dataSize"):
195 self.dest = dest
196 self.src1 = src1
197 self.src2 = "InstRegIndex(0)"
198 self.spm = spm
199 self.dataSize = dataSize
200 if SetStatus:
201 self.className += "Flags"
202 if spm:
203 self.className += "Top"
204
205 def getAllocator(self, microFlags):
206 return '''new %(class_name)s(machInst, macrocodeBlock,
207 %(flags)s, %(src1)s, %(src2)s, %(dest)s,
208 %(dataSize)s, %(spm)d)''' % {
209 "class_name" : self.className,
210 "flags" : self.microFlagsText(microFlags),
211 "src1" : self.src1, "src2" : self.src2,

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

220
221 # Default template parameter values
222 flag_code = ""
223 cond_check = "true"
224 else_code = ";"
225 op_class = "FloatAddOp"
226
227 def __init__(self, dest, src1, src2, spm=0, \
228 SetStatus=False, dataSize="env.dataSize"):
229 self.dest = dest
230 self.src1 = src1
231 self.src2 = src2
232 self.spm = spm
233 self.dataSize = dataSize
234 if SetStatus:
235 self.className += "Flags"
236 if spm:
237 self.className += "Top"
238
239 def getAllocator(self, microFlags):
240 return '''new %(class_name)s(machInst, macrocodeBlock,
241 %(flags)s, %(src1)s, %(src2)s, %(dest)s,
242 %(dataSize)s, %(spm)d)''' % {
243 "class_name" : self.className,
244 "flags" : self.microFlagsText(microFlags),
245 "src1" : self.src1, "src2" : self.src2,

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

354 DPRINTF(X86, "src1: %lf, src2: %lf, dest: %lf, FSW: 0x%x\\n",
355 FpSrcReg1, FpSrcReg2, FpDestReg, new_fsw);
356 '''
357 op_class = 'FloatDivOp'
358
359 flag_code = 'FSW = new_fsw;'
360
361 class Compfp(FpBinaryOp):
362 def __init__(self, src1, src2, spm=0, setStatus=False, \
363 dataSize="env.dataSize"):
364 super(Compfp, self).__init__("InstRegIndex(FLOATREG_MICROFP0)", \
365 src1, src2, spm, setStatus, dataSize)
366 # This class sets the condition codes in rflags according to the
367 # rules for comparing floating point.
368 code = '''
369 // ZF PF CF
370 // Unordered 1 1 1
371 // Greater than 0 0 0
372 // Less than 0 0 1
373 // Equal 1 0 0

--- 23 unchanged lines hidden ---