28#ifndef __ARCH_X86_INSTS_MICROOP_ARGS_HH__
29#define __ARCH_X86_INSTS_MICROOP_ARGS_HH__
62 template <
class InstType>
64 size(inst->getDestSize())
75 template <
class InstType>
77 size(inst->getSrcSize())
88 template <
class InstType>
90 size(inst->getSrcSize())
101 template <
class InstType>
103 size(inst->getSrcSize())
135template <
class T,
class Enabled=
void>
149 template <
class Inst>
151 Base(idx.
index, inst->dataSize)
154 template <
class Inst>
156 Base(idx.
index, inst)
171 template <
class InstType>
188 template <
class InstType>
203 template <
class InstType>
219 template <
class InstType>
234 template <
class InstType>
249 template <
class Inst>
251 Base(idx.
index, inst->dataSize)
254 template <
class Inst>
256 Base(idx.
index, inst)
300 template <
class InstType>
316 template <
class InstType>
332 template <
class InstType>
348 template <
class InstType>
376 template <
class InstType>
381 size(inst->addressSize)
394template <
typename Base,
typename ...Operands>
398 using ArgTuple = std::tuple<
typename Operands::ArgType...>;
400 template <std::size_t ...I,
typename ...CTorArgs>
402 const char *mnem,
const char *inst_mnem, uint64_t set_flags,
403 OpClass op_class, [[maybe_unused]]
ArgTuple args,
404 CTorArgs... ctor_args) :
405 Base(mach_inst, mnem, inst_mnem, set_flags, op_class, ctor_args...),
406 Operands(this,
std::get<I>(args))...
410 template <
typename ...CTorArgs>
412 const char *inst_mnem, uint64_t set_flags, OpClass op_class,
413 ArgTuple args, CTorArgs... ctor_args) :
415 mach_inst, mnem, inst_mnem, set_flags, op_class,
416 std::move(args), ctor_args...)
423 std::stringstream response;
424 Base::printMnemonic(response, this->instMnem, this->mnemonic);
426 GEM5_FOR_EACH_IN_PACK(
ccprintf(response,
count++ ?
", " :
""),
427 Operands::print(response));
428 return response.str();
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
InstOperands(ExtMachInst mach_inst, const char *mnem, const char *inst_mnem, uint64_t set_flags, OpClass op_class, ArgTuple args, CTorArgs... ctor_args)
std::tuple< typename Operands::ArgType... > ArgTuple
InstOperands(std::index_sequence< I... >, ExtMachInst mach_inst, const char *mnem, const char *inst_mnem, uint64_t set_flags, OpClass op_class, ArgTuple args, CTorArgs... ctor_args)
static void printMem(std::ostream &os, uint8_t segment, uint8_t scale, RegIndex index, RegIndex base, uint64_t disp, uint8_t addressSize, bool rip)
static void printSegment(std::ostream &os, int segment)
static void printReg(std::ostream &os, RegId reg, int size)
constexpr RegClass miscRegClass
constexpr RegClass intRegClass
constexpr bool HasDataSizeV
static constexpr RegId intRegFolded(RegIndex index, RegIndex foldBit)
constexpr RegClass floatRegClass
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.
void ccprintf(cp::Print &print)
Overload hash function for BasicBlockRange type.
void print(std::ostream &os) const
AddrOp(InstType *inst, const ArgType &args)
CrOp(InstType *inst, ArgType idx)
void print(std::ostream &os) const
DataHiOp(RegIndex data_hi, size_t _size)
DataLowOp(RegIndex data_low, size_t _size)
DataOp(RegIndex _data, size_t _size)
void print(std::ostream &os) const
DbgOp(InstType *inst, ArgType idx)
DestOp(RegIndex _dest, InstType *inst)
DestOp(RegIndex _dest, size_t _size)
void print(std::ostream &os) const
FaultOp(InstType *inst, ArgType _fault)
FloatOp(Inst *inst, std::enable_if_t< HasDataSizeV< Inst >, ArgType > idx)
FloatOp(Inst *inst, std::enable_if_t<!HasDataSizeV< Inst >, ArgType > idx)
void print(std::ostream &os) const
void print(std::ostream &os) const
FoldedOp(InstType *inst, ArgType idx)
Classes for register indices passed to instruction constructors.
void print(std::ostream &os) const
Imm64Op(InstType *inst, ArgType _imm64)
Imm8Op(InstType *inst, ArgType _imm8)
void print(std::ostream &os) const
IntOp(Inst *inst, std::enable_if_t<!HasDataSizeV< Inst >, ArgType > idx)
void print(std::ostream &os) const
IntOp(Inst *inst, std::enable_if_t< HasDataSizeV< Inst >, ArgType > idx)
MiscOp(InstType *inst, ArgType idx)
void print(std::ostream &os) const
SegOp(InstType *inst, ArgType idx)
void print(std::ostream &os) const
Src1Op(RegIndex _src1, size_t _size)
Src1Op(RegIndex _src1, InstType *inst)
Src2Op(RegIndex _src2, InstType *inst)
Src2Op(RegIndex _src2, size_t _size)
Src3Op(RegIndex _src3, InstType *inst)
Src3Op(RegIndex _src3, size_t _size)
UpcOp(InstType *inst, ArgType _target)
void print(std::ostream &os) const