X86: Implement the save machine status word instruction (SMSW).
authorGabe Black <gblack@eecs.umich.edu>
Sun, 19 Apr 2009 10:22:38 +0000 (03:22 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 19 Apr 2009 10:22:38 +0000 (03:22 -0700)
src/arch/x86/isa/decoder/two_byte_opcodes.isa
src/arch/x86/isa/insts/system/control_registers.py

index e55756fec22ee63443239035756f4bb02302d42a..c344ee550977b79d1a2d73ee3ea01d657abdb6c7 100644 (file)
                             0x6: skinit();
                             0x7: invlpga();
                         }
-                        0x4: smsw_Rv();
+                        0x4: Inst::SMSW(Rv);
                         0x6: Inst::LMSW(Rv);
                         0x7: decode MODRM_RM {
                             0x0: Inst::SWAPGS();
                                 default: Inst::LIDT(M);
                             }
                         }
-                        0x4: smsw_Mw();
+                        0x4: Inst::SMSW(Mw);
                         0x6: Inst::LMSW(Mw);
                         0x7: Inst::INVLPG(M);
                         default: Inst::UD2();
index c09cdf6e8481d45b602fbba439365eb53bea8b7f..82811bb07e6a82d25171e3d5f6e3ab9b93e40238 100644 (file)
@@ -68,4 +68,19 @@ def macroop LMSW_P {
     or t1, t1, t2, dataSize=8
     wrcr 0, t1, dataSize=8
 };
+
+def macroop SMSW_R {
+    rdcr reg, 0
+};
+
+def macroop SMSW_M {
+    rdcr t1, 0
+    st t1, seg, sib, disp, dataSize=2
+};
+
+def macroop SMSW_P {
+    rdcr t1, 0
+    rdip t7, dataSize=asz
+    st t1, seg, riprel, disp, dataSize=2
+};
 '''