X86: Take advantage of new PCState syntax.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 8 Dec 2010 08:27:23 +0000 (00:27 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 8 Dec 2010 08:27:23 +0000 (00:27 -0800)
src/arch/x86/isa/decoder/two_byte_opcodes.isa
src/arch/x86/isa/microops/regop.isa
src/arch/x86/isa/microops/seqop.isa
src/arch/x86/isa/operands.isa

index def9b7f9dd060a83f5a8997eab7b1397f47b9e15..1dc32122ecda0a3b9416408f1b8ea8b62059162b 100644 (file)
                         }}, IsNonSpeculative);
 #endif
                         0x54: m5panic({{
-                            panic("M5 panic instruction called at pc=%#x.\n",
-                                xc->pcState().pc());
+                            panic("M5 panic instruction called at pc = %#x.\n",
+                                  RIP);
                         }}, IsNonSpeculative);
                         0x55: m5reserved1({{
                             warn("M5 reserved opcode 1 ignored.\n");
index 86ebac174b01c6ab596edfe8a3676f8ac10f334b..975bdce8a28868ae7b38b7a08fcab4d66da34b28 100644 (file)
@@ -944,12 +944,8 @@ let {{
         code = 'DoubleBits = psrc1 ^ op2;'
 
     class Wrip(WrRegOp, CondRegOp):
-        code = '''
-        X86ISA::PCState pc = PCS;
-        pc.npc(psrc1 + sop2 + CSBase);
-        PCS = pc;
-        '''
-        else_code = "PCS = PCS;"
+        code = 'NRIP = psrc1 + sop2 + CSBase;'
+        else_code = "NRIP = NRIP;"
 
     class Wruflags(WrRegOp):
         code = 'ccFlagBits = psrc1 ^ op2'
@@ -965,10 +961,7 @@ let {{
         '''
 
     class Rdip(RdRegOp):
-        code = '''
-        X86ISA::PCState pc = PCS;
-        DestReg = pc.npc() - CSBase;
-        '''
+        code = 'DestReg = NRIP - CSBase;'
 
     class Ruflags(RdRegOp):
         code = 'DestReg = ccFlagBits'
index a3e22b0aa19e1989260c828944f4f395ca1f482d..1b125ec9c95d01fc5a272401e40d82e504ff2c1a 100644 (file)
@@ -169,23 +169,15 @@ let {{
             return super(Eret, self).getAllocator(microFlags)
 
     iop = InstObjParams("br", "MicroBranchFlags", "SeqOpBase",
-            {"code": '''
-             X86ISA::PCState pc = PCS;
-             pc.nupc(target);
-             PCS = pc;
-             ''',
-             "else_code": "PCS = PCS",
+            {"code": "nuIP = target;",
+             "else_code": "nuIP = nuIP;",
              "cond_test": "checkCondition(ccFlagBits, cc)"})
     exec_output += SeqOpExecute.subst(iop)
     header_output += SeqOpDeclare.subst(iop)
     decoder_output += SeqOpConstructor.subst(iop)
     iop = InstObjParams("br", "MicroBranch", "SeqOpBase",
-            {"code": '''
-             X86ISA::PCState pc = PCS;
-             pc.nupc(target);
-             PCS = pc;
-             ''',
-             "else_code": "PCS = PCS",
+            {"code": "nuIP = target;",
+             "else_code": "nuIP = nuIP;",
              "cond_test": "true"})
     exec_output += SeqOpExecute.subst(iop)
     header_output += SeqOpDeclare.subst(iop)
index 25b73a8f2a1c5aeeac7fa1f5a2c940a65e602f5b..51b9b73a68a0700ceedfab7a079acf71884f209e 100644 (file)
@@ -97,7 +97,11 @@ def operands {{
         'FpSrcReg2':     floatReg('src2', 21),
         'FpDestReg':     floatReg('dest', 22),
         'FpData':        floatReg('data', 23),
-        'PCS':           ('PCState', 'udw', None,
+        'RIP':           ('PCState', 'uqw', 'pc',
+                          (None, None, 'IsControl'), 50),
+        'NRIP':          ('PCState', 'uqw', 'npc',
+                          (None, None, 'IsControl'), 50),
+        'nuIP':          ('PCState', 'uqw', 'nupc',
                           (None, None, 'IsControl'), 50),
         # This holds the condition code portion of the flag register. The
         # nccFlagBits version holds the rest.