42 #ifndef __ARCH_ARM_INSTS_PREDINST_HH__ 43 #define __ARCH_ARM_INSTS_PREDINST_HH__ 51 static inline uint32_t
55 return rotateValue == 0 ? immValue :
56 (immValue >> rotateValue) | (immValue << (32 - rotateValue));
59 static inline uint32_t
62 uint32_t bigData = dataImm;
63 uint32_t bigCtrl = ctrlImm;
69 return bigData | (bigData << 16);
71 return (bigData << 8) | (bigData << 24);
73 return (bigData << 0) | (bigData << 8) |
74 (bigData << 16) | (bigData << 24);
77 bigCtrl = (bigCtrl << 1) | ((bigData >> 7) & 0x1);
79 return bigData << (32 - bigCtrl);
82 static inline uint64_t
84 bool isAarch64 =
false)
86 uint64_t bigData =
data;
91 bigData = (bigData << 0) | (bigData << 32);
95 bigData = (bigData << 8) | (bigData << 40);
99 bigData = (bigData << 16) | (bigData << 48);
103 bigData = (bigData << 24) | (bigData << 56);
107 bigData = (bigData << 0) | (bigData << 16) |
108 (bigData << 32) | (bigData << 48);
112 bigData = (bigData << 8) | (bigData << 24) |
113 (bigData << 40) | (bigData << 56);
116 bigData = (0xff
ULL << 0) | (bigData << 8) |
117 (0xff
ULL << 32) | (bigData << 40);
120 bigData = (0xffff
ULL << 0) | (bigData << 16) |
121 (0xffff
ULL << 32) | (bigData << 48);
126 for (
int i = 7;
i >= 0;
i--) {
128 bigData |= (
ULL(0xFF) << (
i * 8));
132 bigData = (bigData << 0) | (bigData << 8) |
133 (bigData << 16) | (bigData << 24) |
134 (bigData << 32) | (bigData << 40) |
135 (bigData << 48) | (bigData << 56);
142 bVal =
bits(bigData, 6) ? (0x1F) : (0x20);
143 bigData = (
bits(bigData, 5, 0) << 19) |
144 (bVal << 25) | (
bits(bigData, 7) << 31);
145 bigData |= (bigData << 32);
147 }
else if (isAarch64) {
148 bVal =
bits(bigData, 6) ? (0x0FF) : (0x100);
149 bigData = (
bits(bigData, 5, 0) << 48) |
150 (bVal << 54) | (
bits(bigData, 7) << 63);
165 static inline uint64_t
168 uint64_t bigData =
data;
172 repData =
bits(data, 6) ? 0x3 : 0;
173 bigData = (
bits(bigData, 5, 0) << 6) |
174 (repData << 12) | (
bits(~bigData, 6) << 14) |
175 (
bits(bigData, 7) << 15);
178 repData =
bits(data, 6) ? 0x1F : 0;
179 bigData = (
bits(bigData, 5, 0) << 19) |
180 (repData << 25) | (
bits(~bigData, 6) << 30) |
181 (
bits(bigData, 7) << 31);
184 repData =
bits(data, 6) ? 0xFF : 0;
185 bigData = (
bits(bigData, 5, 0) << 48) |
186 (repData << 54) | (
bits(~bigData, 6) << 62) |
187 (
bits(bigData, 7) << 63);
190 panic(
"Unrecognized FP data type");
204 "Invalid floating point data type in VFP/SIMD or SVE instruction");
221 if (machInst.aarch64)
223 else if (machInst.itstateMask)
244 PredOp(mnem, _machInst, __opClass),
245 imm(machInst.imm), rotated_imm(0), rotated_carry(0),
246 rotate(machInst.rotate << 1)
250 rotated_carry =
bits(rotated_imm, 31);
253 std::string generateDisassembly(
269 PredOp(mnem, _machInst, __opClass),
270 shift_size(machInst.
shiftSize), shift(machInst.shift)
274 std::string generateDisassembly(
289 PredOp(mnem, _machInst, __opClass),
290 dest(_dest), op1(_op1), imm(_imm), rotC(_rotC)
293 std::string generateDisassembly(
307 PredOp(mnem, _machInst, __opClass),
308 dest(_dest), op1(_op1), op2(_op2),
309 shiftAmt(_shiftAmt), shiftType(_shiftType)
312 std::string generateDisassembly(
325 PredOp(mnem, _machInst, __opClass),
326 dest(_dest), op1(_op1), op2(_op2), shift(_shift),
327 shiftType(_shiftType)
330 std::string generateDisassembly(
346 PredOp(mnem, _machInst, __opClass),
347 numMicroops(0), microOps(nullptr)
352 flags[IsMacroop] =
true;
364 assert(microPC < numMicroops);
365 return microOps[microPC];
371 panic(
"Execute method called when it shouldn't!");
374 std::string generateDisassembly(
385 PredOp(mnem, _machInst, __opClass)
387 flags[IsMicroop] =
true;
393 if (flags[IsLastMicroop])
401 #endif //__ARCH_ARM_INSTS_PREDINST_HH__ #define panic(...)
This implements a cprintf based panic() function.
static FpDataType decode_fp_data_type(uint8_t encoding)
Base class for predicated micro-operations.
Bitfield< 11, 7 > shiftSize
static uint32_t rotate_imm(uint32_t immValue, uint32_t rotateValue)
Base class for predicated integer operations.
static uint64_t vfp_modified_imm(uint8_t data, FpDataType dtype)
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.
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
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
StaticInstPtr fetchMicroop(MicroPC microPC) const override
Return the microop that goes with a particular micropc.
Bitfield< 27, 25 > encoding
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.
FpDataType
Floating point data types.
GenericISA::SimplePCState< MachInst > PCState
PredIntOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
void advancePC(PCState &pcState) const
DataRegRegOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass, IntRegIndex _dest, IntRegIndex _op1, IntRegIndex _op2, IntRegIndex _shift, ArmShiftType _shiftType)
Fault execute(ExecContext *, Trace::InstRecord *) const override
TheISA::ExtMachInst ExtMachInst
Binary extended machine instruction type.
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
std::shared_ptr< FaultBase > Fault
DataImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass, IntRegIndex _dest, IntRegIndex _op1, uint32_t _imm, bool _rotC)