X86: Implement the BOUND instruction.
authorGabe Black <gblack@eecs.umich.edu>
Fri, 19 Oct 2007 05:40:48 +0000 (22:40 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Fri, 19 Oct 2007 05:40:48 +0000 (22:40 -0700)
--HG--
extra : convert_revision : 7bcfa5b4a47d342bee267cc593a1bd4b4f31abe0

src/arch/x86/isa/decoder/one_byte_opcodes.isa
src/arch/x86/isa/insts/general_purpose/compare_and_test/bounds.py

index 10118eae86fdf40b0e240b05593128ab28525c20..23ba243fbd426f334d11d066d7f1ad23715ada67 100644 (file)
             }
             0x2: decode MODE_SUBMODE {
                 0x0: UD2();
-                default: WarnUnimpl::bound_Gv_Ma();
+                default: BOUND(Gv,Mv);
             }
             0x3: decode MODE_SUBMODE {
                 //The second operand should really be of size "d", but it's
index 4b6cc8f71e5618d048e6a04d408828103f2e4eab..2df5cf7464805d990f06ecf2634b18f5a6d88e4b 100644 (file)
 #
 # Authors: Gabe Black
 
-microcode = ""
-#let {{
-#    class BOUND(Inst):
-#      "GenFault ${new UnimpInstFault}"
-#}};
+microcode = '''
+def macroop BOUND_R_M {
+    ld t1, seg, sib, disp, dataSize="env.dataSize * 2"
+    srli t2, t1, "env.dataSize * 8"
+    sub t1, t1, reg, flags=(ECF,)
+    fault "new BoundRange", flags=(CECF,)
+    sub t2, reg, t2, flags=(ECF,)
+    fault "new BoundRange", flags=(CECF,)
+};
+
+def macroop BOUND_R_P {
+    fault "new UnimpInstFault"
+};
+'''