X86: Implement and hook up STI and CLI instructions.
authorGabe Black <gblack@eecs.umich.edu>
Thu, 12 Jun 2008 04:58:19 +0000 (00:58 -0400)
committerGabe Black <gblack@eecs.umich.edu>
Thu, 12 Jun 2008 04:58:19 +0000 (00:58 -0400)
src/arch/x86/isa/decoder/one_byte_opcodes.isa
src/arch/x86/isa/insts/general_purpose/flags/set_and_clear.py

index 8729f417d60c7f2e5e441ccf6ab45872e4fd7168..005864f027be9238c3cc502a5cc3bf80020bcd27 100644 (file)
         0x1F: decode OPCODE_OP_BOTTOM3 {
             0x0: CLC();
             0x1: STC();
-            0x2: WarnUnimpl::cli();
-            0x3: WarnUnimpl::sti();
+            0x2: CLI();
+            0x3: STI();
             0x4: CLD();
             0x5: STD();
             //0x6: group4();
index 4c655e0b2b107165894ba8b9e496ff36b2082ece..e151dc61d7fc42e9f57c46e3c2e504262d3dffe4 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2007 The Hewlett-Packard Development Company
+# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
 # All rights reserved.
 #
 # Redistribution and use of this software in source and binary forms,
@@ -84,10 +84,18 @@ def macroop CMC {
     ruflags t1
     wruflagsi t1, "CFBit"
 };
+
+def macroop STI {
+    rflags t1
+    limm t2, "IFBit"
+    or t1, t1, t2
+    wrflags t1, t0
+};
+
+def macroop CLI {
+    rflags t1
+    limm t2, "~IFBit"
+    and t1, t1, t2
+    wrflags t1, t0
+};
 '''
-#let {{
-#    class CLI(Inst):
-#      "GenFault ${new UnimpInstFault}"
-#    class STI(Inst):
-#      "GenFault ${new UnimpInstFault}"
-#}};