Deleted Added
sdiff udiff text old ( 2665:a124942bacb8 ) new ( 2686:f0d591379ac3 )
full compact
1// -*- mode:c++ -*-
2
3// Copyright (c) 2003-2005 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

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

85 Memory::generateDisassembly(Addr pc, const SymbolTable *symtab) const
86 {
87 return csprintf("%-10s %c%d,%d(r%d)", mnemonic,
88 flags[IsFloating] ? 'f' : 'r', RT, disp, RS);
89 }
90
91}};
92
93def format LoadAddress(code) {{
94 iop = InstObjParams(name, Name, 'MemoryDisp32', CodeBlock(code))
95 header_output = BasicDeclare.subst(iop)
96 decoder_output = BasicConstructor.subst(iop)
97 decode_block = BasicDecode.subst(iop)
98 exec_output = BasicExecute.subst(iop)
99}};
100
101
102def template LoadStoreDeclare {{
103 /**
104 * Static instruction class for "%(mnemonic)s".
105 */
106 class %(class_name)s : public %(base_class)s
107 {
108 protected:
109

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

421 if (fault == NoFault) {
422 %(op_wb)s;
423 }
424
425 return fault;
426 }
427}};
428
429// load instructions use Rt as dest, so check for
430// Rt == 31 to detect nops
431def template LoadNopCheckDecode {{
432 {
433 MipsStaticInst *i = new %(class_name)s(machInst);
434 if (RT == 0) {
435 i = makeNop(i);
436 }
437 return i;
438 }
439}};
440
441def format LoadMemory(memacc_code, ea_code = {{ EA = Rs + disp; }},
442 mem_flags = [], inst_flags = []) {{
443 (header_output, decoder_output, decode_block, exec_output) = \
444 LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
445 decode_template = LoadNopCheckDecode,
446 exec_template_base = 'Load')
447}};
448
449
450def format StoreMemory(memacc_code, ea_code = {{ EA = Rs + disp; }},
451 mem_flags = [], inst_flags = []) {{
452 (header_output, decoder_output, decode_block, exec_output) = \
453 LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
454 exec_template_base = 'Store')
455}};
456
457//FP loads are offloaded to these formats for now ...
458def format LoadFloatMemory(memacc_code, ea_code = {{ EA = Rs + disp; }},
459 mem_flags = [], inst_flags = []) {{
460 (header_output, decoder_output, decode_block, exec_output) = \
461 LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
462 decode_template = BasicDecode,
463 exec_template_base = 'Load')
464}};
465
466
467def format StoreFloatMemory(memacc_code, ea_code = {{ EA = Rs + disp; }},
468 mem_flags = [], inst_flags = []) {{
469 (header_output, decoder_output, decode_block, exec_output) = \
470 LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
471 exec_template_base = 'Store')
472}};
473
474
475def format UnalignedStore(memacc_code, postacc_code,
476 ea_code = {{ EA = Rb + disp; }},
477 mem_flags = [], inst_flags = []) {{
478 (header_output, decoder_output, decode_block, exec_output) = \
479 LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
480 postacc_code, exec_template_base = 'Store')
481}};