// Constructor
FpOp(ExtMachInst _machInst,
const char *mnem, const char *_instMnem,
- bool isMicro, bool isDelayed,
- bool isFirst, bool isLast,
+ uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _dataSize, int8_t _spm,
OpClass __opClass) :
- X86MicroopBase(_machInst, mnem, _instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ X86MicroopBase(_machInst, mnem, _instMnem, setFlags,
__opClass),
src1(_src1.idx), src2(_src2.idx), dest(_dest.idx),
dataSize(_dataSize), spm(_spm)
//Constructor
LdStOp(ExtMachInst _machInst,
const char * mnem, const char * _instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ uint64_t setFlags,
uint8_t _scale, InstRegIndex _index, InstRegIndex _base,
uint64_t _disp, InstRegIndex _segment,
InstRegIndex _data,
uint8_t _dataSize, uint8_t _addressSize,
Request::FlagsType _memFlags,
OpClass __opClass) :
- X86MicroopBase(machInst, mnem, _instMnem,
- isMicro, isDelayed, isFirst, isLast, __opClass),
+ X86MicroopBase(machInst, mnem, _instMnem, setFlags, __opClass),
scale(_scale), index(_index.idx), base(_base.idx),
disp(_disp), segment(_segment.idx),
data(_data.idx),
// Constructor
MediaOpBase(ExtMachInst _machInst,
- const char *mnem, const char *_instMnem,
- bool isMicro, bool isDelayed,
- bool isFirst, bool isLast,
+ const char *mnem, const char *_instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _dest,
uint8_t _srcSize, uint8_t _destSize, uint8_t _ext,
OpClass __opClass) :
- X86MicroopBase(_machInst, mnem, _instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ X86MicroopBase(_machInst, mnem, _instMnem, setFlags,
__opClass),
src1(_src1.idx), dest(_dest.idx),
srcSize(_srcSize), destSize(_destSize), ext(_ext)
// Constructor
MediaOpReg(ExtMachInst _machInst,
- const char *mnem, const char *_instMnem,
- bool isMicro, bool isDelayed,
- bool isFirst, bool isLast,
+ const char *mnem, const char *_instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _srcSize, uint8_t _destSize, uint8_t _ext,
OpClass __opClass) :
- MediaOpBase(_machInst, mnem, _instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ MediaOpBase(_machInst, mnem, _instMnem, setFlags,
_src1, _dest, _srcSize, _destSize, _ext,
__opClass),
src2(_src2.idx)
// Constructor
MediaOpImm(ExtMachInst _machInst,
- const char *mnem, const char *_instMnem,
- bool isMicro, bool isDelayed,
- bool isFirst, bool isLast,
+ const char *mnem, const char *_instMnem, uint64_t setFlags,
InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest,
uint8_t _srcSize, uint8_t _destSize, uint8_t _ext,
OpClass __opClass) :
- MediaOpBase(_machInst, mnem, _instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ MediaOpBase(_machInst, mnem, _instMnem, setFlags,
_src1, _dest, _srcSize, _destSize, _ext,
__opClass),
imm8(_imm8)
X86MicroopBase(ExtMachInst _machInst,
const char *mnem, const char *_instMnem,
- bool isMicro, bool isDelayed,
- bool isFirst, bool isLast,
- OpClass __opClass) :
+ uint64_t setFlags, OpClass __opClass) :
X86ISA::X86StaticInst(mnem, _machInst, __opClass),
instMnem(_instMnem)
{
- flags[IsMicroop] = isMicro;
- flags[IsDelayedCommit] = isDelayed;
- flags[IsFirstMicroop] = isFirst;
- flags[IsLastMicroop] = isLast;
+ flags |= setFlags;
}
std::string generateDisassembly(Addr pc,
// Constructor
RegOpBase(ExtMachInst _machInst,
- const char *mnem, const char *_instMnem,
- bool isMicro, bool isDelayed,
- bool isFirst, bool isLast,
+ const char *mnem, const char *_instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _dest,
uint8_t _dataSize, uint16_t _ext,
OpClass __opClass) :
- X86MicroopBase(_machInst, mnem, _instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ X86MicroopBase(_machInst, mnem, _instMnem, setFlags,
__opClass),
src1(_src1.idx), dest(_dest.idx),
dataSize(_dataSize), ext(_ext)
// Constructor
RegOp(ExtMachInst _machInst,
- const char *mnem, const char *_instMnem,
- bool isMicro, bool isDelayed,
- bool isFirst, bool isLast,
+ const char *mnem, const char *_instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _dataSize, uint16_t _ext,
OpClass __opClass) :
- RegOpBase(_machInst, mnem, _instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ RegOpBase(_machInst, mnem, _instMnem, setFlags,
_src1, _dest, _dataSize, _ext,
__opClass),
src2(_src2.idx)
// Constructor
RegOpImm(ExtMachInst _machInst,
- const char * mnem, const char *_instMnem,
- bool isMicro, bool isDelayed,
- bool isFirst, bool isLast,
+ const char * mnem, const char *_instMnem, uint64_t setFlags,
InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest,
uint8_t _dataSize, uint16_t _ext,
OpClass __opClass) :
- RegOpBase(_machInst, mnem, _instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ RegOpBase(_machInst, mnem, _instMnem, setFlags,
_src1, _dest, _dataSize, _ext,
__opClass),
imm8(_imm8)
allocMicroops = ''
micropc = 0
for op in self.microops:
- isLast = (micropc == numMicroops - 1)
+ flags = ["IsMicroop"]
+ if micropc == numMicroops - 1:
+ flags.append("IsLastMicroop")
+ else:
+ flags.append("IsDelayedCommit")
+ if micropc == 0:
+ flags.append("IsFirstMicroop")
allocMicroops += \
"microops[%d] = %s;\n" % \
- (micropc, op.getAllocator(True, not isLast,
- micropc == 0, isLast))
+ (micropc, op.getAllocator(flags))
micropc += 1
if env.useStackSize:
useStackSize = "true"
def __init__(self, name):
self.name = name
- # This converts a python bool into a C++ bool
- def cppBool(self, val):
- if val:
- return "true"
- else:
- return "false"
-
- # This converts a list of python bools into
- # a comma seperated list of C++ bools.
- def microFlagsText(self, vals):
- text = ""
- for val in vals:
- text += ", %s" % self.cppBool(val)
- return text
+ def microFlagsText(self, flags):
+ wrapped = ("(1ULL << StaticInst::%s)" % flag for flag in flags)
+ return " | ".join(wrapped)
def getGeneratorDef(self, micropc):
return self.generatorTemplate % \
(self.className, micropc, \
- self.getAllocator(True, True, False, False))
+ self.getAllocator(["IsMicroop", "IsDelayedCommit"]))
def getGenerator(self, micropc):
return self.generatorNameTemplate % (self.className, micropc)
public:
MicroDebugBase(ExtMachInst _machInst, const char * mnem,
- const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ const char * instMnem, uint64_t setFlags,
std::string _message, uint8_t _cc);
MicroDebugBase(ExtMachInst _machInst, const char * mnem,
void buildMe();
public:
%(class_name)s(ExtMachInst _machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
- std::string _message, uint8_t _cc);
+ uint64_t setFlags, std::string _message, uint8_t _cc);
%(class_name)s(ExtMachInst _machInst, const char * instMnem,
std::string _message, uint8_t _cc);
inline MicroDebugBase::MicroDebugBase(
ExtMachInst machInst, const char * mnem, const char * instMnem,
std::string _message, uint8_t _cc) :
- X86MicroopBase(machInst, mnem, instMnem,
- false, false, false, false, No_OpClass),
+ X86MicroopBase(machInst, mnem, instMnem, 0, No_OpClass),
message(_message), cc(_cc)
{
}
inline MicroDebugBase::MicroDebugBase(
ExtMachInst machInst, const char * mnem, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
- std::string _message, uint8_t _cc) :
+ uint64_t setFlags, std::string _message, uint8_t _cc) :
X86MicroopBase(machInst, mnem, instMnem,
- isMicro, isDelayed, isFirst, isLast, No_OpClass),
+ setFlags, No_OpClass),
message(_message), cc(_cc)
{
}
}
inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
std::string _message, uint8_t _cc) :
%(base_class)s(machInst, "%(func)s", instMnem,
- isMicro, isDelayed, isFirst, isLast, _message, _cc)
+ setFlags, _message, _cc)
{
buildMe();
}
else:
self.cond = "0"
- def getAllocator(self, *microFlags):
- allocator = '''new %(class_name)s(machInst, macrocodeBlock
+ def getAllocator(self, microFlags):
+ allocator = '''new %(class_name)s(machInst, macrocodeBlock,
%(flags)s, "%(message)s", %(cc)s)''' % {
"class_name" : self.className,
"flags" : self.microFlagsText(microFlags),
public:
%(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _dataSize, int8_t _spm);
ExtMachInst machInst, const char * instMnem,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _dataSize, int8_t _spm) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem,
- false, false, false, false,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
_src1, _src2, _dest, _dataSize, _spm,
%(op_class)s)
{
}
inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _dataSize, int8_t _spm) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags,
_src1, _src2, _dest, _dataSize, _spm,
%(op_class)s)
{
if spm:
self.className += "Top"
- def getAllocator(self, *microFlags):
- return '''new %(class_name)s(machInst, macrocodeBlock
+ def getAllocator(self, microFlags):
+ return '''new %(class_name)s(machInst, macrocodeBlock,
%(flags)s, %(src1)s, %(src2)s, %(dest)s,
%(dataSize)s, %(spm)d)''' % {
"class_name" : self.className,
public:
%(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ const char * instMnem, uint64_t setFlags,
uint8_t _scale, InstRegIndex _index, InstRegIndex _base,
uint64_t _disp, InstRegIndex _segment,
InstRegIndex _data,
public:
%(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ const char * instMnem, uint64_t setFlags,
uint8_t _scale, InstRegIndex _index, InstRegIndex _base,
uint64_t _disp, InstRegIndex _segment,
InstRegIndex _data,
InstRegIndex _data,
uint8_t _dataSize, uint8_t _addressSize,
Request::FlagsType _memFlags) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem,
- false, false, false, false,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
_scale, _index, _base,
_disp, _segment, _data,
_dataSize, _addressSize, _memFlags, %(op_class)s)
}
inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
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,
- isMicro, isDelayed, isFirst, isLast,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags,
_scale, _index, _base,
_disp, _segment, _data,
_dataSize, _addressSize, _memFlags, %(op_class)s)
self.memFlags += " | (machInst.legacy.addr ? " + \
"(AddrSizeFlagBit << FlagShift) : 0)"
- def getAllocator(self, *microFlags):
- allocator = '''new %(class_name)s(machInst, macrocodeBlock
+ def getAllocator(self, microFlags):
+ allocator = '''new %(class_name)s(machInst, macrocodeBlock,
%(flags)s, %(scale)s, %(index)s, %(base)s,
%(disp)s, %(segment)s, %(data)s,
%(dataSize)s, %(addressSize)s, %(memFlags)s)''' % {
public:
%(class_name)s(ExtMachInst _machInst,
const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
- InstRegIndex _dest, uint64_t _imm, uint8_t _dataSize);
+ uint64_t setFlags, InstRegIndex _dest,
+ uint64_t _imm, uint8_t _dataSize);
%(class_name)s(ExtMachInst _machInst,
const char * instMnem,
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,
- false, false, false, false, %(op_class)s),
+ %(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,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _dest, uint64_t _imm, uint8_t _dataSize) :
%(base_class)s(machInst, "%(mnemonic)s", instMnem,
- isMicro, isDelayed, isFirst, isLast, %(op_class)s),
+ setFlags, %(op_class)s),
dest(_dest.idx), imm(_imm), dataSize(_dataSize)
{
buildMe();
self.imm = imm
self.dataSize = dataSize
- def getAllocator(self, *microFlags):
- allocator = '''new %(class_name)s(machInst, macrocodeBlock
+ def getAllocator(self, microFlags):
+ allocator = '''new %(class_name)s(machInst, macrocodeBlock,
%(flags)s, %(dest)s, %(imm)s, %(dataSize)s)''' % {
"class_name" : self.className,
"mnemonic" : self.mnemonic,
self.imm = imm
self.dataSize = dataSize
- def getAllocator(self, *microFlags):
- allocator = '''new %(class_name)s(machInst, macrocodeBlock
+ def getAllocator(self, microFlags):
+ allocator = '''new %(class_name)s(machInst, macrocodeBlock,
%(flags)s, %(dest)s, %(imm)s, %(dataSize)s)''' % {
"class_name" : self.className,
"mnemonic" : self.mnemonic,
public:
%(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _srcSize, uint8_t _destSize, uint16_t _ext);
public:
%(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest,
uint8_t _srcSize, uint8_t _destSize, uint16_t _ext);
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,
- false, false, false, false,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
_src1, _src2, _dest, _srcSize, _destSize, _ext,
%(op_class)s)
{
}
inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags,
_src1, _src2, _dest, _srcSize, _destSize, _ext,
%(op_class)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,
- false, false, false, false,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
_src1, _imm8, _dest, _srcSize, _destSize, _ext,
%(op_class)s)
{
}
inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest,
uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags,
_src1, _imm8, _dest, _srcSize, _destSize, _ext,
%(op_class)s)
{
else:
self.ext = ext
- def getAllocator(self, *microFlags):
+ def getAllocator(self, microFlags):
className = self.className
if self.mnemonic == self.base_mnemonic + 'i':
className += "Imm"
- allocator = '''new %(class_name)s(machInst, macrocodeBlock
+ allocator = '''new %(class_name)s(machInst, macrocodeBlock,
%(flags)s, %(src1)s, %(op2)s, %(dest)s,
%(srcSize)s, %(destSize)s, %(ext)s)''' % {
"class_name" : className,
public:
%(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _dataSize, uint16_t _ext);
public:
%(class_name)s(ExtMachInst _machInst,
- const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest,
uint8_t _dataSize, uint16_t _ext);
ExtMachInst machInst, const char * instMnem,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _dataSize, uint16_t _ext) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem,
- false, false, false, false,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
_src1, _src2, _dest, _dataSize, _ext,
%(op_class)s)
{
}
inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest,
uint8_t _dataSize, uint16_t _ext) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags,
_src1, _src2, _dest, _dataSize, _ext,
%(op_class)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,
- false, false, false, false,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0,
_src1, _imm8, _dest, _dataSize, _ext,
%(op_class)s)
{
}
inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest,
uint8_t _dataSize, uint16_t _ext) :
- %(base_class)s(machInst, "%(mnemonic)s", instMnem,
- isMicro, isDelayed, isFirst, isLast,
+ %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags,
_src1, _imm8, _dest, _dataSize, _ext,
%(op_class)s)
{
self.ext = " | ".join(flags)
self.className += "Flags"
- def getAllocator(self, *microFlags):
+ def getAllocator(self, microFlags):
className = self.className
if self.mnemonic == self.base_mnemonic + 'i':
className += "Imm"
- allocator = '''new %(class_name)s(machInst, macrocodeBlock
+ allocator = '''new %(class_name)s(machInst, macrocodeBlock,
%(flags)s, %(src1)s, %(op2)s, %(dest)s,
%(dataSize)s, %(ext)s)''' % {
"class_name" : className,
public:
SeqOpBase(ExtMachInst _machInst, const char * instMnem,
- const char * mnemonic,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ const char * mnemonic, uint64_t setFlags,
uint16_t _target, uint8_t _cc);
SeqOpBase(ExtMachInst _machInst, const char * instMnem,
void buildMe();
public:
%(class_name)s(ExtMachInst _machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
- uint16_t _target, uint8_t _cc);
+ uint64_t setFlags, uint16_t _target, uint8_t _cc);
%(class_name)s(ExtMachInst _machInst, const char * instMnem,
uint16_t _target, uint8_t _cc);
inline SeqOpBase::SeqOpBase(
ExtMachInst machInst, const char * mnemonic, const char * instMnem,
uint16_t _target, uint8_t _cc) :
- X86MicroopBase(machInst, mnemonic, instMnem,
- false, false, false, false, No_OpClass),
+ X86MicroopBase(machInst, mnemonic, instMnem, 0, No_OpClass),
target(_target), cc(_cc)
{
}
inline SeqOpBase::SeqOpBase(
ExtMachInst machInst, const char * mnemonic, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
- uint16_t _target, uint8_t _cc) :
- X86MicroopBase(machInst, mnemonic, instMnem,
- isMicro, isDelayed, isFirst, isLast, No_OpClass),
+ uint64_t setFlags, uint16_t _target, uint8_t _cc) :
+ X86MicroopBase(machInst, mnemonic, instMnem, setFlags, No_OpClass),
target(_target), cc(_cc)
{
}
inline %(class_name)s::%(class_name)s(
ExtMachInst machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
- uint16_t _target, uint8_t _cc) :
+ uint64_t setFlags, uint16_t _target, uint8_t _cc) :
%(base_class)s(machInst, "%(mnemonic)s", instMnem,
- isMicro, isDelayed, isFirst, isLast, _target, _cc)
+ setFlags, _target, _cc)
{
buildMe();
}
else:
self.cond = "0"
- def getAllocator(self, *microFlags):
- allocator = '''new %(class_name)s(machInst, macrocodeBlock
+ def getAllocator(self, microFlags):
+ allocator = '''new %(class_name)s(machInst, macrocodeBlock,
%(flags)s, %(target)s, %(cc)s)''' % {
"class_name" : self.className,
"flags" : self.microFlagsText(microFlags),
class Br(SeqOp):
className = "MicroBranch"
- def getAllocator(self, *microFlags):
- (is_micro, is_delayed, is_first, is_last) = microFlags
- is_last = False
- is_delayed = True
- microFlags = (is_micro, is_delayed, is_first, is_last)
- return super(Br, self).getAllocator(*microFlags)
+ def getAllocator(self, microFlags):
+ if "IsLastMicroop" in microFlags:
+ microFlags.remove("IsLastMicroop")
+ if not "IsDelayedCommit" in microFlags:
+ microFlags.append("IsDelayedCommit")
+ return super(Br, self).getAllocator(microFlags)
class Eret(SeqOp):
target = "normalMicroPC(0)"
else:
self.cond = "0"
- def getAllocator(self, *microFlags):
- (is_micro, is_delayed, is_first, is_last) = microFlags
- is_last = True
- is_delayed = False
- microFlags = (is_micro, is_delayed, is_first, is_last)
- return super(Eret, self).getAllocator(*microFlags)
+ def getAllocator(self, microFlags):
+ if not "IsLastMicroop" in microFlags:
+ microFlags.append("IsLastMicroop")
+ if "IsDelayedCommit" in microFlags:
+ microFlags.remove("IsDelayedCommit")
+ return super(Eret, self).getAllocator(microFlags)
iop = InstObjParams("br", "MicroBranchFlags", "SeqOpBase",
{"code": "nuIP = target",
public:
MicroFaultBase(ExtMachInst _machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
- Fault _fault, uint8_t _cc);
+ uint64_t setFlags, Fault _fault, uint8_t _cc);
MicroFaultBase(ExtMachInst _machInst, const char * instMnem,
Fault _fault, uint8_t _cc);
{
public:
MicroHalt(ExtMachInst _machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast) :
- X86MicroopBase(_machInst, "halt", instMnem,
- isMicro, isDelayed, isFirst, isLast, No_OpClass)
+ uint64_t setFlags) :
+ X86MicroopBase(_machInst, "halt", instMnem, setFlags, No_OpClass)
{
}
MicroHalt(ExtMachInst _machInst, const char * instMnem) :
- X86MicroopBase(_machInst, "halt", instMnem,
- false, false, false, false, No_OpClass)
+ X86MicroopBase(_machInst, "halt", instMnem, 0, No_OpClass)
{
}
void buildMe();
public:
%(class_name)s(ExtMachInst _machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
- Fault _fault, uint8_t _cc);
+ uint64_t setFlags, Fault _fault, uint8_t _cc);
%(class_name)s(ExtMachInst _machInst, const char * instMnem,
Fault _fault, uint8_t _cc);
inline MicroFaultBase::MicroFaultBase(
ExtMachInst machInst, const char * instMnem,
Fault _fault, uint8_t _cc) :
- X86MicroopBase(machInst, "fault", instMnem,
- false, false, false, false, No_OpClass),
+ X86MicroopBase(machInst, "fault", instMnem, 0, No_OpClass),
fault(_fault), cc(_cc)
{
}
inline MicroFaultBase::MicroFaultBase(
ExtMachInst machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
- Fault _fault, uint8_t _cc) :
- X86MicroopBase(machInst, "fault", instMnem,
- isMicro, isDelayed, isFirst, isLast, No_OpClass),
+ uint64_t setFlags, Fault _fault, uint8_t _cc) :
+ X86MicroopBase(machInst, "fault", instMnem, setFlags, No_OpClass),
fault(_fault), cc(_cc)
{
}
}
inline %(class_name)s::%(class_name)s(
- ExtMachInst machInst, const char * instMnem,
- bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
Fault _fault, uint8_t _cc) :
- %(base_class)s(machInst, instMnem,
- isMicro, isDelayed, isFirst, isLast, _fault, _cc)
+ %(base_class)s(machInst, instMnem, setFlags, _fault, _cc)
{
buildMe();
}
else:
self.cond = "0"
- def getAllocator(self, *microFlags):
- allocator = '''new %(class_name)s(machInst, macrocodeBlock
+ def getAllocator(self, microFlags):
+ allocator = '''new %(class_name)s(machInst, macrocodeBlock,
%(flags)s, %(fault)s, %(cc)s)''' % {
"class_name" : self.className,
"flags" : self.microFlagsText(microFlags),
def __init__(self):
pass
- def getAllocator(self, *microFlags):
- return "new MicroHalt(machInst, macrocodeBlock %s)" % \
+ def getAllocator(self, microFlags):
+ return "new MicroHalt(machInst, macrocodeBlock, %s)" % \
self.microFlagsText(microFlags)
microopClasses["halt"] = Halt