This will reduce clutter in the source and hopefully speed up compilation.
%s
} else if (LEGACY_REPNE) {
// The repne prefix is illegal
- return new MicroFault(machInst, "illprefix", new InvalidOpcode, 0);
+ return new MicroFault(machInst, "illprefix", 0,
+ new InvalidOpcode, 0);
} else {
%s
}
const char * instMnem, uint64_t setFlags,
std::string _message, uint8_t _cc);
- MicroDebugBase(ExtMachInst _machInst, const char * mnem,
- const char * instMnem, std::string _message, uint8_t _cc);
-
std::string generateDisassembly(Addr pc,
const SymbolTable *symtab) const;
};
def template MicroDebugDeclare {{
class %(class_name)s : public %(base_class)s
{
- private:
- void buildMe();
public:
%(class_name)s(ExtMachInst _machInst, const char * instMnem,
uint64_t setFlags, std::string _message, uint8_t _cc);
- %(class_name)s(ExtMachInst _machInst, const char * instMnem,
- std::string _message, uint8_t _cc);
-
%(BasicExecDeclare)s
};
}};
}};
output decoder {{
- inline MicroDebugBase::MicroDebugBase(
- ExtMachInst machInst, const char * mnem, const char * instMnem,
- std::string _message, uint8_t _cc) :
- X86MicroopBase(machInst, mnem, instMnem, 0, No_OpClass),
- message(_message), cc(_cc)
- {
- }
-
inline MicroDebugBase::MicroDebugBase(
ExtMachInst machInst, const char * mnem, const char * instMnem,
uint64_t setFlags, std::string _message, uint8_t _cc) :
}};
def template MicroDebugConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- %(constructor)s;
- }
-
- inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- std::string _message, uint8_t _cc) :
- %(base_class)s(machInst, "%(func)s", instMnem, _message, _cc)
- {
- buildMe();
- }
-
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
std::string _message, uint8_t _cc) :
%(base_class)s(machInst, "%(func)s", instMnem,
setFlags, _message, _cc)
{
- buildMe();
+ %(constructor)s;
}
}};
def template MicroFpOpDeclare {{
class %(class_name)s : public %(base_class)s
{
- protected:
- void buildMe();
-
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _dataSize, int8_t _spm);
- %(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
- uint8_t _dataSize, int8_t _spm);
-
%(BasicExecDeclare)s
};
}};
def template MicroFpOpConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- %(constructor)s;
- }
-
- inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
- uint8_t _dataSize, int8_t _spm) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
- _src1, _src2, _dest, _dataSize, _spm,
- %(op_class)s)
- {
- buildMe();
- }
-
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
_src1, _src2, _dest, _dataSize, _spm,
%(op_class)s)
{
- buildMe();
+ %(constructor)s;
}
}};
def template MicroLeaDeclare {{
class %(class_name)s : public %(base_class)s
{
- protected:
- void buildMe();
-
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
uint8_t _dataSize, uint8_t _addressSize,
Request::FlagsType _memFlags);
- %(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- uint8_t _scale, InstRegIndex _index, InstRegIndex _base,
- uint64_t _disp, InstRegIndex _segment,
- InstRegIndex _data,
- uint8_t _dataSize, uint8_t _addressSize,
- Request::FlagsType _memFlags);
-
%(BasicExecDeclare)s
};
}};
def template MicroLdStOpDeclare {{
class %(class_name)s : public %(base_class)s
{
- protected:
- void buildMe();
-
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
uint8_t _dataSize, uint8_t _addressSize,
Request::FlagsType _memFlags);
- %(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- uint8_t _scale, InstRegIndex _index, InstRegIndex _base,
- uint64_t _disp, InstRegIndex _segment,
- InstRegIndex _data,
- uint8_t _dataSize, uint8_t _addressSize,
- Request::FlagsType _memFlags);
-
%(BasicExecDeclare)s
%(InitiateAccDeclare)s
}};
def template MicroLdStOpConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- %(constructor)s;
- }
-
- inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- uint8_t _scale, InstRegIndex _index, InstRegIndex _base,
- uint64_t _disp, InstRegIndex _segment,
- InstRegIndex _data,
- uint8_t _dataSize, uint8_t _addressSize,
- Request::FlagsType _memFlags) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
- _scale, _index, _base,
- _disp, _segment, _data,
- _dataSize, _addressSize, _memFlags, %(op_class)s)
- {
- buildMe();
- }
-
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
uint8_t _scale, InstRegIndex _index, InstRegIndex _base,
_disp, _segment, _data,
_dataSize, _addressSize, _memFlags, %(op_class)s)
{
- buildMe();
+ %(constructor)s;
}
}};
const uint64_t imm;
const uint8_t dataSize;
RegIndex foldOBit;
- void buildMe();
std::string generateDisassembly(Addr pc,
const SymbolTable *symtab) const;
uint64_t setFlags, InstRegIndex _dest,
uint64_t _imm, uint8_t _dataSize);
- %(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- InstRegIndex _dest, uint64_t _imm, uint8_t _dataSize);
-
%(BasicExecDeclare)s
};
}};
}};
def template MicroLimmOpConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- foldOBit = (dataSize == 1 && !machInst.rex.present) ? 1 << 6 : 0;
- %(constructor)s;
- }
-
- inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- InstRegIndex _dest, uint64_t _imm, uint8_t _dataSize) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0, %(op_class)s),
- dest(_dest.idx), imm(_imm), dataSize(_dataSize)
- {
- buildMe();
- }
-
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _dest, uint64_t _imm, uint8_t _dataSize) :
setFlags, %(op_class)s),
dest(_dest.idx), imm(_imm), dataSize(_dataSize)
{
- buildMe();
+ foldOBit = (dataSize == 1 && !machInst.rex.present) ? 1 << 6 : 0;
+ %(constructor)s;
}
}};
def template MediaOpRegDeclare {{
class %(class_name)s : public %(base_class)s
{
- protected:
- void buildMe();
-
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _srcSize, uint8_t _destSize, uint16_t _ext);
- %(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
- uint8_t _srcSize, uint8_t _destSize, uint16_t _ext);
-
%(BasicExecDeclare)s
};
}};
class %(class_name)s : public %(base_class)s
{
- protected:
- void buildMe();
-
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest,
uint8_t _srcSize, uint8_t _destSize, uint16_t _ext);
- %(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest,
- uint8_t _srcSize, uint8_t _destSize, uint16_t _ext);
-
%(BasicExecDeclare)s
};
}};
def template MediaOpRegConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- %(constructor)s;
- }
-
- inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
- uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
- _src1, _src2, _dest, _srcSize, _destSize, _ext,
- %(op_class)s)
- {
- buildMe();
- }
-
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
_src1, _src2, _dest, _srcSize, _destSize, _ext,
%(op_class)s)
{
- buildMe();
+ %(constructor)s;
}
}};
def template MediaOpImmConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- %(constructor)s;
- }
-
- inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest,
- uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
- _src1, _imm8, _dest, _srcSize, _destSize, _ext,
- %(op_class)s)
- {
- buildMe();
- }
-
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest,
_src1, _imm8, _dest, _srcSize, _destSize, _ext,
%(op_class)s)
{
- buildMe();
+ %(constructor)s;
}
}};
def template MicroRegOpDeclare {{
class %(class_name)s : public %(base_class)s
{
- protected:
- void buildMe();
-
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _dataSize, uint16_t _ext);
- %(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
- uint8_t _dataSize, uint16_t _ext);
-
%(BasicExecDeclare)s
};
}};
class %(class_name)s : public %(base_class)s
{
- protected:
- void buildMe();
-
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest,
uint8_t _dataSize, uint16_t _ext);
- %(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest,
- uint8_t _dataSize, uint16_t _ext);
-
%(BasicExecDeclare)s
};
}};
def template MicroRegOpConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- %(constructor)s;
- }
-
- inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
- uint8_t _dataSize, uint16_t _ext) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
- _src1, _src2, _dest, _dataSize, _ext,
- %(op_class)s)
- {
- buildMe();
- }
-
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
_src1, _src2, _dest, _dataSize, _ext,
%(op_class)s)
{
- buildMe();
+ %(constructor)s;
}
}};
def template MicroRegOpImmConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- %(constructor)s;
- }
-
- inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest,
- uint8_t _dataSize, uint16_t _ext) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
- _src1, _imm8, _dest, _dataSize, _ext,
- %(op_class)s)
- {
- buildMe();
- }
-
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest,
_src1, _imm8, _dest, _dataSize, _ext,
%(op_class)s)
{
- buildMe();
+ %(constructor)s;
}
}};
def template SeqOpDeclare {{
class %(class_name)s : public %(base_class)s
{
- private:
- void buildMe();
public:
%(class_name)s(ExtMachInst _machInst, const char * instMnem,
uint64_t setFlags, uint16_t _target, uint8_t _cc);
- %(class_name)s(ExtMachInst _machInst, const char * instMnem,
- uint16_t _target, uint8_t _cc);
-
%(BasicExecDeclare)s
};
}};
}};
output decoder {{
- inline SeqOpBase::SeqOpBase(
- ExtMachInst machInst, const char * mnemonic, const char * instMnem,
- uint16_t _target, uint8_t _cc) :
- X86MicroopBase(machInst, mnemonic, instMnem, 0, No_OpClass),
- target(_target), cc(_cc)
- {
- }
-
inline SeqOpBase::SeqOpBase(
ExtMachInst machInst, const char * mnemonic, const char * instMnem,
uint64_t setFlags, uint16_t _target, uint8_t _cc) :
}};
def template SeqOpConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- %(constructor)s;
- }
-
- inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- uint16_t _target, uint8_t _cc) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem, _target, _cc)
- {
- buildMe();
- }
-
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem,
uint64_t setFlags, uint16_t _target, uint8_t _cc) :
%(base_class)s(machInst, "%(mnemonic)s", instMnem,
setFlags, _target, _cc)
{
- buildMe();
+ %(constructor)s;
}
}};
MicroFaultBase(ExtMachInst _machInst, const char * instMnem,
uint64_t setFlags, Fault _fault, uint8_t _cc);
- MicroFaultBase(ExtMachInst _machInst, const char * instMnem,
- Fault _fault, uint8_t _cc);
-
std::string generateDisassembly(Addr pc,
const SymbolTable *symtab) const;
};
{
}
- MicroHalt(ExtMachInst _machInst, const char * instMnem) :
- X86MicroopBase(_machInst, "halt", instMnem, 0, No_OpClass)
- {
- }
-
%(BasicExecDeclare)s
std::string generateDisassembly(Addr pc,
def template MicroFaultDeclare {{
class %(class_name)s : public %(base_class)s
{
- private:
- void buildMe();
public:
%(class_name)s(ExtMachInst _machInst, const char * instMnem,
uint64_t setFlags, Fault _fault, uint8_t _cc);
- %(class_name)s(ExtMachInst _machInst, const char * instMnem,
- Fault _fault, uint8_t _cc);
-
%(BasicExecDeclare)s
};
}};
}};
output decoder {{
- inline MicroFaultBase::MicroFaultBase(
- ExtMachInst machInst, const char * instMnem,
- Fault _fault, uint8_t _cc) :
- X86MicroopBase(machInst, "fault", instMnem, 0, No_OpClass),
- fault(_fault), cc(_cc)
- {
- }
-
inline MicroFaultBase::MicroFaultBase(
ExtMachInst machInst, const char * instMnem,
uint64_t setFlags, Fault _fault, uint8_t _cc) :
}};
def template MicroFaultConstructor {{
-
- inline void %(class_name)s::buildMe()
- {
- %(constructor)s;
- }
-
- inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- Fault _fault, uint8_t _cc) :
- %(base_class)s(machInst, instMnem, _fault, _cc)
- {
- buildMe();
- }
-
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
Fault _fault, uint8_t _cc) :
%(base_class)s(machInst, instMnem, setFlags, _fault, _cc)
{
- buildMe();
+ %(constructor)s;
}
}};