X86: Implement mov from control register.
authorGabe Black <gblack@eecs.umich.edu>
Sun, 2 Dec 2007 07:06:03 +0000 (23:06 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 2 Dec 2007 07:06:03 +0000 (23:06 -0800)
--HG--
extra : convert_revision : c8280f0686a3ae6d5c405327540ad15a3a5531f9

src/arch/x86/isa/decoder/two_byte_opcodes.isa
src/arch/x86/isa/insts/general_purpose/data_transfer/move.py
src/arch/x86/isa/microops/regop.isa

index 717a8f26fa22c79d58e08b222ad60a980cdd2a21..b50c42cd9401d35aff3ed20594e760dd1033152d 100644 (file)
             0x04: decode LEGACY_DECODEVAL {
                 // no prefix
                 0x0: decode OPCODE_OP_BOTTOM3 {
-                    0x0: mov_Rd_Cd();
+                    0x0: Inst::MOV(Rd,Cd);
                     0x1: mov_Rd_Dd();
                     0x2: Inst::MOV(Cd,Rd);
                     0x3: mov_Dd_Rd();
index aaddcf96279c98778639ae60da5f6111de00f5d0..069d1010e7263da81e1f36811b138acdd45e1f68 100644 (file)
@@ -193,6 +193,10 @@ def macroop MOV_C_R {
     wrcr reg, regm
 };
 
+def macroop MOV_R_C {
+    rdcr reg, regm
+};
+
 def macroop MOV_R_S {
     rdsel reg, regm
 };
index de9f76e736854dc1c8223a5f1937449c9f69fc9a..e761f00349e3423f63b44dad177b2ca20380a49c 100644 (file)
@@ -885,6 +885,18 @@ let {{
     class Zext(RegOp):
         code = 'DestReg = bits(psrc1, op2, 0);'
 
+    class Rdcr(RegOp):
+        def __init__(self, dest, src1, flags=None, dataSize="env.dataSize"):
+            super(Rdcr, self).__init__(dest, \
+                    src1, "NUM_INTREGS", flags, dataSize)
+        code = '''
+            if (dest == 1 || (dest > 4 && dest < 8) || (dest > 8)) {
+                fault = new InvalidOpcode();
+            } else {
+                DestReg = ControlSrc1;
+            }
+        '''
+
     class Wrcr(RegOp):
         def __init__(self, dest, src1, flags=None, dataSize="env.dataSize"):
             super(Wrcr, self).__init__(dest, \