mem.hh (6305:e518d78b2ed1) mem.hh (6307:067515d22824)
1/* Copyright (c) 2007-2008 The Florida State University
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

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

60 up(machInst.puswl.up),
61 hilo((machInst.immedHi11_8 << 4) | machInst.immedLo3_0),
62 shift_size(machInst.shiftSize), shift(machInst.shift)
63 {
64 }
65
66 std::string
67 generateDisassembly(Addr pc, const SymbolTable *symtab) const;
1/* Copyright (c) 2007-2008 The Florida State University
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

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

60 up(machInst.puswl.up),
61 hilo((machInst.immedHi11_8 << 4) | machInst.immedLo3_0),
62 shift_size(machInst.shiftSize), shift(machInst.shift)
63 {
64 }
65
66 std::string
67 generateDisassembly(Addr pc, const SymbolTable *symtab) const;
68
69 virtual void
70 printOffset(std::ostream &os) const
71 {}
68};
69
72};
73
70 /**
71 * Base class for a few miscellaneous memory-format insts
72 * that don't interpret the disp field
73 */
74class MemoryNoDisp : public Memory
74class MemoryDisp : public Memory
75{
76 protected:
77 /// Constructor
75{
76 protected:
77 /// Constructor
78 MemoryNoDisp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
78 MemoryDisp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
79 : Memory(mnem, _machInst, __opClass)
80 {
81 }
82
79 : Memory(mnem, _machInst, __opClass)
80 {
81 }
82
83 std::string
84 generateDisassembly(Addr pc, const SymbolTable *symtab) const;
83 void
84 printOffset(std::ostream &os) const
85 {
86 ccprintf(os, "#%#x", (machInst.puswl.up ? disp : -disp));
87 }
85};
88};
89
90class MemoryHilo : public Memory
91{
92 protected:
93 /// Constructor
94 MemoryHilo(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
95 : Memory(mnem, _machInst, __opClass)
96 {
97 }
98
99 void
100 printOffset(std::ostream &os) const
101 {
102 ccprintf(os, "#%#x", (machInst.puswl.up ? hilo : -hilo));
103 }
104};
105
106class MemoryShift : public Memory
107{
108 protected:
109 /// Constructor
110 MemoryShift(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
111 : Memory(mnem, _machInst, __opClass)
112 {
113 }
114
115 void
116 printOffset(std::ostream &os) const
117 {
118 printShiftOperand(os);
119 }
120};
121
122class MemoryReg : public Memory
123{
124 protected:
125 /// Constructor
126 MemoryReg(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
127 : Memory(mnem, _machInst, __opClass)
128 {
129 }
130
131 void
132 printOffset(std::ostream &os) const
133 {
134 os << (machInst.puswl.up ? "+ " : "- ");
135 printReg(os, machInst.rm);
136 }
137};
86}
87
88#endif //__ARCH_ARM_INSTS_MEM_HH__
138}
139
140#endif //__ARCH_ARM_INSTS_MEM_HH__