summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/isa/insts/processor_information.py11
-rw-r--r--src/arch/x86/isa/macroop.isa14
2 files changed, 20 insertions, 5 deletions
diff --git a/src/arch/x86/isa/insts/processor_information.py b/src/arch/x86/isa/insts/processor_information.py
index f57bed494..4c18cb954 100644
--- a/src/arch/x86/isa/insts/processor_information.py
+++ b/src/arch/x86/isa/insts/processor_information.py
@@ -97,9 +97,10 @@ def macroop CPUID_R {
# Standard functions.
#
+standardStart:
# 0x00000000 -- Processor Vendor and Largest Standard Function Number
-standardStart: limm rax, 0x00000001, dataSize=4
+ limm rax, 0x00000001, dataSize=4
limm rbx, 0x68747541, dataSize=4
limm rdx, 0x69746e65, dataSize=4
limm rcx, 0x444d4163, dataSize=4
@@ -122,9 +123,10 @@ standardStart: limm rax, 0x00000001, dataSize=4
# Extended functions.
#
-# 0x80000000 -- Processor Vendor and Largest Extended Function Number
+extendedStart:
-extendedStart: limm rax, 0x80000018, dataSize=4
+# 0x80000000 -- Processor Vendor and Largest Extended Function Number
+ limm rax, 0x80000018, dataSize=4
limm rbx, 0x68747541, dataSize=4
limm rdx, 0x69746e65, dataSize=4
limm rcx, 0x444d4163, dataSize=4
@@ -400,6 +402,7 @@ extendedStart: limm rax, 0x80000018, dataSize=4
fault "NoFault"
fault "NoFault"
-end: fault "NoFault"
+end:
+ fault "NoFault"
};
'''
diff --git a/src/arch/x86/isa/macroop.isa b/src/arch/x86/isa/macroop.isa
index 4675b9d56..fdfea6136 100644
--- a/src/arch/x86/isa/macroop.isa
+++ b/src/arch/x86/isa/macroop.isa
@@ -126,6 +126,8 @@ def template MacroDeclare {{
*/
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(declareLabels)s
public:
// Constructor.
%(class_name)s(ExtMachInst machInst, X86ISA::EmulEnv env);
@@ -151,6 +153,9 @@ def template MacroConstructor {{
let {{
from micro_asm import Combinational_Macroop, Rom_Macroop
class X86Macroop(Combinational_Macroop):
+ def add_microop(self, microop):
+ microop.micropc = len(self.microops)
+ self.microops.append(microop)
def setAdjustEnv(self, val):
self.adjust_env = val
def __init__(self, name):
@@ -166,7 +171,14 @@ let {{
def getDeclaration(self):
#FIXME This first parameter should be the mnemonic. I need to
#write some code which pulls that out
- iop = InstObjParams(self.name, self.name, "Macroop", {"code" : ""})
+ declareLabels = ""
+ for (label, microop) in self.labels.items():
+ declareLabels += "const static uint64_t label_%s = %d;\n" \
+ % (label, microop.micropc)
+ iop = InstObjParams(self.name, self.name, "Macroop",
+ {"code" : "",
+ "declareLabels" : declareLabels
+ })
return MacroDeclare.subst(iop);
def getDefinition(self):
#FIXME This first parameter should be the mnemonic. I need to