mem.isa (6250:1cc6e860d95f) | mem.isa (6253:988a001820f8) |
---|---|
1// -*- mode:c++ -*- 2 3// Copyright (c) 2007-2008 The Florida State University 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 --- 19 unchanged lines hidden (view full) --- 28// 29// Authors: Stephen Hines 30 31//////////////////////////////////////////////////////////////////// 32// 33// Memory-format instructions 34// 35 | 1// -*- mode:c++ -*- 2 3// Copyright (c) 2007-2008 The Florida State University 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 --- 19 unchanged lines hidden (view full) --- 28// 29// Authors: Stephen Hines 30 31//////////////////////////////////////////////////////////////////// 32// 33// Memory-format instructions 34// 35 |
36output header {{ 37 /** 38 * Base class for general Arm memory-format instructions. 39 */ 40 class Memory : public PredOp 41 { 42 protected: 43 44 /// Memory request flags. See mem_req_base.hh. 45 unsigned memAccessFlags; 46 /// Pointer to EAComp object. 47 const StaticInstPtr eaCompPtr; 48 /// Pointer to MemAcc object. 49 const StaticInstPtr memAccPtr; 50 51 /// Displacement for EA calculation (signed). 52 int32_t disp; 53 int32_t disp8; 54 int32_t up; 55 int32_t hilo, 56 shift_size, 57 shift; 58 59 /// Constructor 60 Memory(const char *mnem, ExtMachInst _machInst, OpClass __opClass, 61 StaticInstPtr _eaCompPtr = nullStaticInstPtr, 62 StaticInstPtr _memAccPtr = nullStaticInstPtr) 63 : PredOp(mnem, _machInst, __opClass), 64 memAccessFlags(0), eaCompPtr(_eaCompPtr), memAccPtr(_memAccPtr), 65 disp(IMMED_11_0), disp8(IMMED_7_0 << 2), up(UP), 66 hilo((IMMED_HI_11_8 << 4) | IMMED_LO_3_0), 67 shift_size(SHIFT_SIZE), shift(SHIFT) 68 { 69 // When Up is not set, then we must subtract by the displacement 70 if (!up) 71 { 72 disp = -disp; 73 disp8 = -disp8; 74 hilo = -hilo; 75 } 76 } 77 78 std::string 79 generateDisassembly(Addr pc, const SymbolTable *symtab) const; 80 81 public: 82 83 const StaticInstPtr &eaCompInst() const { return eaCompPtr; } 84 const StaticInstPtr &memAccInst() const { return memAccPtr; } 85 }; 86 87 /** 88 * Base class for a few miscellaneous memory-format insts 89 * that don't interpret the disp field 90 */ 91 class MemoryNoDisp : public Memory 92 { 93 protected: 94 /// Constructor 95 MemoryNoDisp(const char *mnem, ExtMachInst _machInst, OpClass __opClass, 96 StaticInstPtr _eaCompPtr = nullStaticInstPtr, 97 StaticInstPtr _memAccPtr = nullStaticInstPtr) 98 : Memory(mnem, _machInst, __opClass, _eaCompPtr, _memAccPtr) 99 { 100 } 101 102 std::string 103 generateDisassembly(Addr pc, const SymbolTable *symtab) const; 104 }; 105}}; 106 107 108output decoder {{ 109 std::string 110 Memory::generateDisassembly(Addr pc, const SymbolTable *symtab) const 111 { 112 return csprintf("%-10s", mnemonic); 113 } 114 115 std::string 116 MemoryNoDisp::generateDisassembly(Addr pc, const SymbolTable *symtab) const 117 { 118 return csprintf("%-10s", mnemonic); 119 } 120}}; 121 | |
122def template LoadStoreDeclare {{ 123 /** 124 * Static instruction class for "%(mnemonic)s". 125 */ 126 class %(class_name)s : public %(base_class)s 127 { 128 protected: 129 --- 432 unchanged lines hidden --- | 36def template LoadStoreDeclare {{ 37 /** 38 * Static instruction class for "%(mnemonic)s". 39 */ 40 class %(class_name)s : public %(base_class)s 41 { 42 protected: 43 --- 432 unchanged lines hidden --- |