summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/microops/specop.isa
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/isa/microops/specop.isa')
-rw-r--r--src/arch/x86/isa/microops/specop.isa53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/arch/x86/isa/microops/specop.isa b/src/arch/x86/isa/microops/specop.isa
index 52420f175..5c242e2c9 100644
--- a/src/arch/x86/isa/microops/specop.isa
+++ b/src/arch/x86/isa/microops/specop.isa
@@ -1,4 +1,5 @@
// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
+// Copyright (c) 2011 Mark D. Hill and David A. Wood
// All rights reserved.
//
// The license below extends only to copyright in the software and shall
@@ -203,3 +204,55 @@ let {{
microopClasses["halt"] = Halt
}};
+
+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)
+}};