summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/insts/system
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-04-19 03:17:14 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-04-19 03:17:14 -0700
commitd86cd1d2a02d2dd42e6b0f6e8bc8b8876c3d6152 (patch)
treeaaa3dfcc6a6284a2f2a0fc8e0d1b5a106c616d56 /src/arch/x86/isa/insts/system
parentb4ad233c0c4aeb4f622a87ff6f7e5c4f072a2927 (diff)
downloadgem5-d86cd1d2a02d2dd42e6b0f6e8bc8b8876c3d6152.tar.xz
X86: Implement the load machine status word instruction (LMSW).
Diffstat (limited to 'src/arch/x86/isa/insts/system')
-rw-r--r--src/arch/x86/isa/insts/system/control_registers.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/arch/x86/isa/insts/system/control_registers.py b/src/arch/x86/isa/insts/system/control_registers.py
index 902c01abb..c09cdf6e8 100644
--- a/src/arch/x86/isa/insts/system/control_registers.py
+++ b/src/arch/x86/isa/insts/system/control_registers.py
@@ -32,4 +32,40 @@ def macroop CLTS {
andi t1, t1, 0xF7, dataSize=1
wrcr 0, t1, dataSize=8
};
+
+def macroop LMSW_R {
+ rdcr t1, 0, dataSize=8
+ # This logic sets MP, EM, and TS to whatever is in the operand. It will
+ # set PE but not clear it.
+ limm t2, "~ULL(0xe)", dataSize=8
+ and t1, t1, t2, dataSize=8
+ andi t2, reg, 0xf, dataSize=8
+ or t1, t1, t2, dataSize=8
+ wrcr 0, t1, dataSize=8
+};
+
+def macroop LMSW_M {
+ ld t3, seg, sib, disp, dataSize=2
+ rdcr t1, 0, dataSize=8
+ # This logic sets MP, EM, and TS to whatever is in the operand. It will
+ # set PE but not clear it.
+ limm t2, "~ULL(0xe)", dataSize=8
+ and t1, t1, t2, dataSize=8
+ andi t2, t3, 0xf, dataSize=8
+ or t1, t1, t2, dataSize=8
+ wrcr 0, t1, dataSize=8
+};
+
+def macroop LMSW_P {
+ rdip t7, dataSize=asz
+ ld t3, seg, riprel, disp, dataSize=2
+ rdcr t1, 0, dataSize=8
+ # This logic sets MP, EM, and TS to whatever is in the operand. It will
+ # set PE but not clear it.
+ limm t2, "~ULL(0xe)", dataSize=8
+ and t1, t1, t2, dataSize=8
+ andi t2, t3, 0xf, dataSize=8
+ or t1, t1, t2, dataSize=8
+ wrcr 0, t1, dataSize=8
+};
'''