fp.isa (3735:86a7cf4dcc11) fp.isa (3951:727778d649ae)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2006 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

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

204 }
205
206 return fault;
207 }
208}};
209
210// Primary format for float point operate instructions:
211def format FloatOp(code, *flags) {{
1// -*- mode:c++ -*-
2
3// Copyright (c) 2006 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

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

204 }
205
206 return fault;
207 }
208}};
209
210// Primary format for float point operate instructions:
211def format FloatOp(code, *flags) {{
212 iop = InstObjParams(name, Name, 'FPOp', CodeBlock(code), flags)
212 iop = InstObjParams(name, Name, 'FPOp', code, flags)
213 header_output = BasicDeclare.subst(iop)
214 decoder_output = BasicConstructor.subst(iop)
215 decode_block = BasicDecode.subst(iop)
216 exec_output = FloatingPointExecute.subst(iop)
217}};
218
219def format FloatCompareOp(cond_code, *flags) {{
220 import sys

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

243 code += 'cond = 0;\n'
244 else:
245 sys.exit('Decoder Failed: Float Compare Instruction Needs A Unordered Flag\n')
246
247 code += '} else {\n'
248 code += cond_code + '}'
249 code += 'FCSR = genCCVector(FCSR, CC, cond);\n'
250
213 header_output = BasicDeclare.subst(iop)
214 decoder_output = BasicConstructor.subst(iop)
215 decode_block = BasicDecode.subst(iop)
216 exec_output = FloatingPointExecute.subst(iop)
217}};
218
219def format FloatCompareOp(cond_code, *flags) {{
220 import sys

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

243 code += 'cond = 0;\n'
244 else:
245 sys.exit('Decoder Failed: Float Compare Instruction Needs A Unordered Flag\n')
246
247 code += '} else {\n'
248 code += cond_code + '}'
249 code += 'FCSR = genCCVector(FCSR, CC, cond);\n'
250
251 iop = InstObjParams(name, Name, 'FPCompareOp', CodeBlock(code))
251 iop = InstObjParams(name, Name, 'FPCompareOp', code)
252 header_output = BasicDeclare.subst(iop)
253 decoder_output = BasicConstructor.subst(iop)
254 decode_block = BasicDecode.subst(iop)
255 exec_output = BasicExecute.subst(iop)
256}};
257
258def format FloatConvertOp(code, *flags) {{
259 import sys

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

294 code += 'floor(val)); '
295 elif 'Round' in flags:
296 code += 'roundFP(val, 0)); '
297 elif 'Trunc' in flags:
298 code += 'truncFP(val));'
299 else:
300 code += 'val); '
301
252 header_output = BasicDeclare.subst(iop)
253 decoder_output = BasicConstructor.subst(iop)
254 decode_block = BasicDecode.subst(iop)
255 exec_output = BasicExecute.subst(iop)
256}};
257
258def format FloatConvertOp(code, *flags) {{
259 import sys

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

294 code += 'floor(val)); '
295 elif 'Round' in flags:
296 code += 'roundFP(val, 0)); '
297 elif 'Trunc' in flags:
298 code += 'truncFP(val));'
299 else:
300 code += 'val); '
301
302 iop = InstObjParams(name, Name, 'FPOp', CodeBlock(code))
302 iop = InstObjParams(name, Name, 'FPOp', code)
303 header_output = BasicDeclare.subst(iop)
304 decoder_output = BasicConstructor.subst(iop)
305 decode_block = BasicDecode.subst(iop)
306 exec_output = BasicExecute.subst(iop)
307}};
308
309def format FloatAccOp(code, *flags) {{
303 header_output = BasicDeclare.subst(iop)
304 decoder_output = BasicConstructor.subst(iop)
305 decode_block = BasicDecode.subst(iop)
306 exec_output = BasicExecute.subst(iop)
307}};
308
309def format FloatAccOp(code, *flags) {{
310 iop = InstObjParams(name, Name, 'FPOp', CodeBlock(code), flags)
310 iop = InstObjParams(name, Name, 'FPOp', code, flags)
311 header_output = BasicDeclare.subst(iop)
312 decoder_output = BasicConstructor.subst(iop)
313 decode_block = BasicDecode.subst(iop)
314 exec_output = BasicExecute.subst(iop)
315}};
316
317// Primary format for float64 operate instructions:
318def format Float64Op(code, *flags) {{
311 header_output = BasicDeclare.subst(iop)
312 decoder_output = BasicConstructor.subst(iop)
313 decode_block = BasicDecode.subst(iop)
314 exec_output = BasicExecute.subst(iop)
315}};
316
317// Primary format for float64 operate instructions:
318def format Float64Op(code, *flags) {{
319 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags)
319 iop = InstObjParams(name, Name, 'MipsStaticInst', code, flags)
320 header_output = BasicDeclare.subst(iop)
321 decoder_output = BasicConstructor.subst(iop)
322 decode_block = BasicDecode.subst(iop)
323 exec_output = BasicExecute.subst(iop)
324}};
325
326def format FloatPSCompareOp(cond_code1, cond_code2, *flags) {{
327 import sys

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

359 elif 'UnorderedFalse' in flags:
360 code += 'cond2 = 0;\n'
361 else:
362 sys.exit('Decoder Failed: Float Compare Instruction Needs A Unordered Flag\n')
363 code += '} else {\n'
364 code += cond_code2
365 code += 'FCSR = genCCVector(FCSR, CC, cond2);}\n}'
366
320 header_output = BasicDeclare.subst(iop)
321 decoder_output = BasicConstructor.subst(iop)
322 decode_block = BasicDecode.subst(iop)
323 exec_output = BasicExecute.subst(iop)
324}};
325
326def format FloatPSCompareOp(cond_code1, cond_code2, *flags) {{
327 import sys

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

359 elif 'UnorderedFalse' in flags:
360 code += 'cond2 = 0;\n'
361 else:
362 sys.exit('Decoder Failed: Float Compare Instruction Needs A Unordered Flag\n')
363 code += '} else {\n'
364 code += cond_code2
365 code += 'FCSR = genCCVector(FCSR, CC, cond2);}\n}'
366
367 iop = InstObjParams(name, Name, 'FPCompareOp', CodeBlock(code))
367 iop = InstObjParams(name, Name, 'FPCompareOp', code)
368 header_output = BasicDeclare.subst(iop)
369 decoder_output = BasicConstructor.subst(iop)
370 decode_block = BasicDecode.subst(iop)
371 exec_output = BasicExecute.subst(iop)
372}};
373
368 header_output = BasicDeclare.subst(iop)
369 decoder_output = BasicConstructor.subst(iop)
370 decode_block = BasicDecode.subst(iop)
371 exec_output = BasicExecute.subst(iop)
372}};
373