// Basic instruction class declaration template.
def template BasicDeclare {{
- /**
- * Static instruction class for "%(mnemonic)s".
- */
- class %(class_name)s : public %(base_class)s
- {
- public:
- // Constructor.
- %(class_name)s(ExtMachInst machInst);
- Fault execute(ExecContext *, Trace::InstRecord *) const override;
- };
+ /**
+ * Static instruction class for "%(mnemonic)s".
+ */
+ class %(class_name)s : public %(base_class)s
+ {
+ private:
+ %(reg_idx_arr_decl)s;
+
+ public:
+ // Constructor.
+ %(class_name)s(ExtMachInst machInst);
+ Fault execute(ExecContext *, Trace::InstRecord *) const override;
+ };
}};
// Basic instruction class constructor template.
def template BasicConstructor {{
- %(class_name)s::%(class_name)s(ExtMachInst machInst)
- : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s)
- {
- %(constructor)s;
- }
+ %(class_name)s::%(class_name)s(ExtMachInst machInst) :
+ %(base_class)s("%(mnemonic)s", machInst, %(op_class)s)
+ {
+ %(set_reg_idx_arr)s;
+ %(constructor)s;
+ }
}};
// Basic instruction class execute method template.
def template MwaitDeclare {{
class %(class_name)s : public %(base_class)s
{
- public:
+ private:
+ %(reg_idx_arr_decl)s;
+
+ public:
// Constructor.
%(class_name)s(ExtMachInst machInst);
Fault execute(ExecContext *, Trace::InstRecord *) const override;
return response.str();
}
};
-
- class MicroDebugFlags : public MicroDebug
- {
- protected:
- uint8_t cc;
-
- public:
- MicroDebugFlags(ExtMachInst _machInst, const char *mnem,
- const char *instMnem, uint64_t setFlags,
- GenericISA::M5DebugFault *_fault, uint8_t _cc);
-
- Fault execute(ExecContext *, Trace::InstRecord *) const override;
- };
}};
output decoder {{
{}
}};
+def template MicroDebugFlagsDeclare {{
+ class %(class_name)s : public %(base_class)s
+ {
+ private:
+ %(reg_idx_arr_decl)s;
+
+ protected:
+ uint8_t cc;
+
+ public:
+ %(class_name)s(ExtMachInst _machInst, const char *mnem,
+ const char *instMnem, uint64_t setFlags,
+ GenericISA::M5DebugFault *_fault, uint8_t _cc);
+
+ Fault execute(ExecContext *, Trace::InstRecord *) const override;
+ };
+}};
+
def template MicroDebugFlagsExecute {{
Fault
%(class_name)s::execute(ExecContext *xc,
%(base_class)s(machInst, mnem, instMnem, setFlags, _fault),
cc(_cc)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
}
}};
{"code": "",
"cond_test": "checkCondition(ccFlagBits | cfofBits | \
dfBit | ecfBit | ezfBit, cc)"})
+
+ header_output = MicroDebugFlagsDeclare.subst(iop)
exec_output = MicroDebugFlagsExecute.subst(iop)
decoder_output = MicroDebugFlagsConstructor.subst(iop)
}};
def template MicroFpOpDeclare {{
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
_src1, _src2, _dest, _dataSize, _spm,
%(op_class)s)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
}
}};
def template MicroLeaDeclare {{
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
def template MicroLdStOpDeclare {{
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
def template MicroLdStSplitOpDeclare {{
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
_disp, _segment, _data,
_dataSize, _addressSize, _memFlags, %(op_class)s)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
}
}};
_disp, _segment, _dataLow, _dataHi,
_dataSize, _addressSize, _memFlags, %(op_class)s)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
}
}};
def template MicroLimmOpDeclare {{
class %(class_name)s : public X86ISA::X86MicroopBase
{
+ private:
+ %(reg_idx_arr_decl)s;
+
protected:
const RegIndex dest;
const uint64_t imm;
setFlags, %(op_class)s),
dest(_dest.index()), imm(_imm), dataSize(_dataSize)
{
+ %(set_reg_idx_arr)s;
foldOBit = (dataSize == 1 && !machInst.rex.present) ? 1 << 6 : 0;
%(constructor)s;
}
def template MediaOpRegDeclare {{
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
_src1, _src2, _dest, _srcSize, _destSize, _ext,
%(op_class)s)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
}
}};
_src1, _imm8, _dest, _srcSize, _destSize, _ext,
%(op_class)s)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
}
}};
def template MicroRegOpDeclare {{
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem, uint64_t setFlags,
_src1, _src2, _dest, _dataSize, _ext,
%(op_class)s)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
%(cond_control_flag_init)s;
}
_src1, _imm8, _dest, _dataSize, _ext,
%(op_class)s)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
%(cond_control_flag_init)s;
}
def template SeqOpDeclare {{
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(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)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
%(cond_control_flag_init)s;
}
def template MicroFaultDeclare {{
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(class_name)s(ExtMachInst _machInst, const char * instMnem,
uint64_t setFlags, Fault _fault, uint8_t _cc);
Fault _fault, uint8_t _cc) :
%(base_class)s(machInst, instMnem, setFlags, _fault, _cc)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
}
}};
def template MicroFenceOpDeclare {{
class %(class_name)s : public X86ISA::X86MicroopBase
{
+ private:
+ %(reg_idx_arr_decl)s;
+
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem,
%(base_class)s(machInst, "%(mnemonic)s", instMnem,
setFlags, %(op_class)s)
{
+ %(set_reg_idx_arr)s;
%(constructor)s;
}
}};