1a2
> // Copyright (c) 2011 Mark D. Hill and David A. Wood
205a207,258
>
> def template MicroFenceOpDeclare {{
> class %(class_name)s : public X86ISA::X86MicroopBase
> {
> public:
> %(class_name)s(ExtMachInst _machInst,
> const char * instMnem,
> uint64_t setFlags);
>
> %(BasicExecDeclare)s
> };
> }};
>
> def template MicroFenceOpConstructor {{
> inline %(class_name)s::%(class_name)s(
> ExtMachInst machInst, const char * instMnem, uint64_t setFlags) :
> %(base_class)s(machInst, "%(mnemonic)s", instMnem,
> setFlags, %(op_class)s)
> {
> %(constructor)s;
> }
> }};
>
> let {{
> class MfenceOp(X86Microop):
> def __init__(self):
> self.className = "Mfence"
> self.mnemonic = "mfence"
> self.instFlags = "| (1ULL << StaticInst::IsMemBarrier)"
>
> def getAllocator(self, microFlags):
> allocString = '''
> (StaticInstPtr)(new %(class_name)s(machInst,
> macrocodeBlock, %(flags)s))
> '''
> allocator = allocString % {
> "class_name" : self.className,
> "mnemonic" : self.mnemonic,
> "flags" : self.microFlagsText(microFlags) + self.instFlags}
> return allocator
>
> microopClasses["mfence"] = MfenceOp
> }};
>
> let {{
> # Build up the all register version of this micro op
> iop = InstObjParams("mfence", "Mfence", 'X86MicroopBase',
> {"code" : ""})
> header_output += MicroFenceOpDeclare.subst(iop)
> decoder_output += MicroFenceOpConstructor.subst(iop)
> exec_output += BasicExecute.subst(iop)
> }};