42 #ifndef __ARCH_ARM_INSTS_PREDINST_HH__
43 #define __ARCH_ARM_INSTS_PREDINST_HH__
50 static inline uint32_t
54 return rotateValue == 0 ? immValue :
55 (immValue >> rotateValue) | (immValue << (32 - rotateValue));
58 static inline uint32_t
61 uint32_t bigData = dataImm;
62 uint32_t bigCtrl = ctrlImm;
68 return bigData | (bigData << 16);
70 return (bigData << 8) | (bigData << 24);
72 return (bigData << 0) | (bigData << 8) |
73 (bigData << 16) | (bigData << 24);
76 bigCtrl = (bigCtrl << 1) | ((bigData >> 7) & 0x1);
78 return bigData << (32 - bigCtrl);
81 static inline uint64_t
83 bool isAarch64 =
false)
85 uint64_t bigData =
data;
90 bigData = (bigData << 0) | (bigData << 32);
94 bigData = (bigData << 8) | (bigData << 40);
98 bigData = (bigData << 16) | (bigData << 48);
102 bigData = (bigData << 24) | (bigData << 56);
106 bigData = (bigData << 0) | (bigData << 16) |
107 (bigData << 32) | (bigData << 48);
111 bigData = (bigData << 8) | (bigData << 24) |
112 (bigData << 40) | (bigData << 56);
115 bigData = (0xff
ULL << 0) | (bigData << 8) |
116 (0xff
ULL << 32) | (bigData << 40);
119 bigData = (0xffff
ULL << 0) | (bigData << 16) |
120 (0xffff
ULL << 32) | (bigData << 48);
125 for (
int i = 7;
i >= 0;
i--) {
127 bigData |= (
ULL(0xFF) << (
i * 8));
131 bigData = (bigData << 0) | (bigData << 8) |
132 (bigData << 16) | (bigData << 24) |
133 (bigData << 32) | (bigData << 40) |
134 (bigData << 48) | (bigData << 56);
141 bVal =
bits(bigData, 6) ? (0x1F) : (0x20);
142 bigData = (
bits(bigData, 5, 0) << 19) |
143 (bVal << 25) | (
bits(bigData, 7) << 31);
144 bigData |= (bigData << 32);
146 }
else if (isAarch64) {
147 bVal =
bits(bigData, 6) ? (0x0FF) : (0x100);
148 bigData = (
bits(bigData, 5, 0) << 48) |
149 (bVal << 54) | (
bits(bigData, 7) << 63);
161 static inline uint64_t
164 uint64_t bigData =
data;
167 repData =
bits(data, 6) ? 0xFF : 0;
168 bigData = (
bits(bigData, 5, 0) << 48) |
169 (repData << 54) | (
bits(~bigData, 6) << 62) |
170 (
bits(bigData, 7) << 63);
172 repData =
bits(data, 6) ? 0x1F : 0;
173 bigData = (
bits(bigData, 5, 0) << 19) |
174 (repData << 25) | (
bits(~bigData, 6) << 30) |
175 (
bits(bigData, 7) << 31);
217 PredOp(mnem, _machInst, __opClass),
241 PredOp(mnem, _machInst, __opClass),
260 PredOp(mnem, _machInst, __opClass),
277 PredOp(mnem, _machInst, __opClass),
294 PredOp(mnem, _machInst, __opClass),
314 PredOp(mnem, _machInst, __opClass),
320 flags[IsMacroop] =
true;
346 PredOp(mnem, _machInst, __opClass)
348 flags[IsMicroop] =
true;
354 if (
flags[IsLastMicroop])
362 #endif //__ARCH_ARM_INSTS_PREDINST_HH__
Base class for predicated micro-operations.
Bitfield< 11, 7 > shiftSize
static uint32_t rotate_imm(uint32_t immValue, uint32_t rotateValue)
static uint64_t vfp_modified_imm(uint8_t data, bool wide)
Base class for predicated integer operations.
static uint64_t simd_modified_imm(bool op, uint8_t cmode, uint8_t data, bool &immValid, bool isAarch64=false)
static uint32_t modified_imm(uint8_t ctrlImm, uint8_t dataImm)
PredMicroop(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
Base class for predicated immediate operations.
Base class for predicated integer operations.
const ExtMachInst machInst
The binary machine instruction.
std::bitset< Num_Flags > flags
Flag values for this instruction.
PredImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
PredOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
#define ULL(N)
uint64_t constant
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const
Internal function to generate disassembly string.
DataRegOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass, IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2, int32_t _shiftAmt, ArmShiftType _shiftType)
Base class for predicated macro-operations.
PredMacroOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const
Internal function to generate disassembly string.
GenericISA::SimplePCState< MachInst > PCState
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const
Internal function to generate disassembly string.
StaticInstPtr fetchMicroop(MicroPC microPC) const
Return the microop that goes with a particular micropc.
PredIntOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
DataRegRegOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass, IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2, IntRegIndex _shift, ArmShiftType _shiftType)
TheISA::ExtMachInst ExtMachInst
Binary extended machine instruction type.
void advancePC(PCState &pcState) const
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const
Internal function to generate disassembly string.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
DataImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass, IntRegIndex _dest, IntRegIndex _op1, uint32_t _imm, bool _rotC)
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const
Internal function to generate disassembly string.