41#ifndef __ARCH_ARM_INSTS_PREDINST_HH__
42#define __ARCH_ARM_INSTS_PREDINST_HH__
60 return rotateValue == 0 ? immValue :
61 (immValue >> rotateValue) | (immValue << (32 - rotateValue));
67 uint32_t bigData = dataImm;
68 uint32_t bigCtrl = ctrlImm;
74 return bigData | (bigData << 16);
76 return (bigData << 8) | (bigData << 24);
78 return (bigData << 0) | (bigData << 8) |
79 (bigData << 16) | (bigData << 24);
82 bigCtrl = (bigCtrl << 1) | ((bigData >> 7) & 0x1);
84 return bigData << (32 - bigCtrl);
89 bool isAarch64 =
false)
91 uint64_t bigData =
data;
96 bigData = (bigData << 0) | (bigData << 32);
100 bigData = (bigData << 8) | (bigData << 40);
104 bigData = (bigData << 16) | (bigData << 48);
108 bigData = (bigData << 24) | (bigData << 56);
112 bigData = (bigData << 0) | (bigData << 16) |
113 (bigData << 32) | (bigData << 48);
117 bigData = (bigData << 8) | (bigData << 24) |
118 (bigData << 40) | (bigData << 56);
121 bigData = (0xffULL << 0) | (bigData << 8) |
122 (0xffULL << 32) | (bigData << 40);
125 bigData = (0xffffULL << 0) | (bigData << 16) |
126 (0xffffULL << 32) | (bigData << 48);
131 for (
int i = 7;
i >= 0;
i--) {
133 bigData |= (0xFFULL << (
i * 8));
137 bigData = (bigData << 0) | (bigData << 8) |
138 (bigData << 16) | (bigData << 24) |
139 (bigData << 32) | (bigData << 40) |
140 (bigData << 48) | (bigData << 56);
147 bVal =
bits(bigData, 6) ? (0x1F) : (0x20);
148 bigData = (
bits(bigData, 5, 0) << 19) |
149 (bVal << 25) | (
bits(bigData, 7) << 31);
150 bigData |= (bigData << 32);
152 }
else if (isAarch64) {
153 bVal =
bits(bigData, 6) ? (0x0FF) : (0x100);
154 bigData = (
bits(bigData, 5, 0) << 48) |
155 (bVal << 54) | (
bits(bigData, 7) << 63);
170static inline uint64_t
173 uint64_t bigData =
data;
178 bigData = (
bits(bigData, 5, 0) << 6) |
179 (repData << 12) | (
bits(~bigData, 6) << 14) |
180 (
bits(bigData, 7) << 15);
184 bigData = (
bits(bigData, 5, 0) << 19) |
185 (repData << 25) | (
bits(~bigData, 6) << 30) |
186 (
bits(bigData, 7) << 31);
190 bigData = (
bits(bigData, 5, 0) << 48) |
191 (repData << 54) | (
bits(~bigData, 6) << 62) |
192 (
bits(bigData, 7) << 63);
195 panic(
"Unrecognized FP data type");
209 "Invalid floating point data type in VFP/SIMD or SVE instruction");
249 PredOp(mnem, _machInst, __opClass),
274 PredOp(mnem, _machInst, __opClass),
294 PredOp(mnem, _machInst, __opClass),
311 int32_t _shiftAmt, ArmShiftType _shiftType) :
312 PredOp(mnem, _machInst, __opClass),
329 RegIndex _shift, ArmShiftType _shiftType) :
330 PredOp(mnem, _machInst, __opClass),
351 PredOp(mnem, _machInst, __opClass),
357 flags[IsMacroop] =
true;
376 panic(
"Execute method called when it shouldn't!");
383 void size(
size_t newSize)
override
399 PredOp(mnem, _machInst, __opClass)
401 flags[IsMicroop] =
true;
408 if (
flags[IsLastMicroop])
418 if (
flags[IsLastMicroop])
DataImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass, RegIndex _dest, RegIndex _op1, uint32_t _imm, bool _rotC)
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
DataRegOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass, RegIndex _dest, RegIndex _op1, RegIndex _op2, int32_t _shiftAmt, ArmShiftType _shiftType)
DataRegRegOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass, RegIndex _dest, RegIndex _op1, RegIndex _op2, RegIndex _shift, ArmShiftType _shiftType)
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Base class for predicated immediate operations.
PredImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Base class for predicated integer operations.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
PredIntOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
Base class for predicated macro-operations.
void size(size_t newSize) override
Fault execute(ExecContext *, trace::InstRecord *) const override
PredMacroOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
StaticInstPtr fetchMicroop(MicroPC microPC) const override
Return the microop that goes with a particular micropc.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Base class for predicated micro-operations.
void advancePC(ThreadContext *tc) const override
void advancePC(PCStateBase &pcState) const override
PredMicroop(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
Base class for predicated integer operations.
PredOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Constructor.
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
size_t _size
Instruction size in bytes.
std::bitset< Num_Flags > flags
Flag values for this instruction.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual const PCStateBase & pcState() const =0
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
#define panic(...)
This implements a cprintf based panic() function.
static uint32_t rotate_imm(uint32_t immValue, uint32_t rotateValue)
static FpDataType decode_fp_data_type(uint8_t encoding)
static uint32_t modified_imm(uint8_t ctrlImm, uint8_t dataImm)
FpDataType
Floating point data types.
static uint64_t simd_modified_imm(bool op, uint8_t cmode, uint8_t data, bool &immValid, bool isAarch64=false)
static uint64_t vfp_modified_imm(uint8_t data, FpDataType dtype)
Bitfield< 27, 25 > encoding
Bitfield< 11, 7 > shiftSize
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< FaultBase > Fault
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.