]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Implement CLC and STC (Pascal Massimino <pmassimi@ilog.fr>).
authorJulian Seward <jseward@acm.org>
Sun, 2 Jun 2002 00:04:00 +0000 (00:04 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 2 Jun 2002 00:04:00 +0000 (00:04 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@353

coregrind/vg_helpers.S
coregrind/vg_include.h
coregrind/vg_main.c
coregrind/vg_to_ucode.c
vg_helpers.S
vg_include.h
vg_main.c
vg_to_ucode.c

index b2654bbfff471e130f1927f4e64b1bfcd7e09737..82627377d67085e0e1ee0ebae5e60b9a43bd9d12 100644 (file)
@@ -392,7 +392,16 @@ VG_(helper_STD):
        std
        ret
 
-
+/* Clear/set the carry flag. */
+.global VG_(helper_CLC)
+VG_(helper_CLC):
+        clc
+        ret
+
+.global VG_(helper_STC)  
+VG_(helper_STC):
+        stc
+        ret
 
 /* Signed 32-to-64 multiply. */
 .globl VG_(helper_imul_32_64)
index 1472e6384470c4b0d8122afe77c382fd484b13e2..2310050d0c0ec01df9415577a4f60f8707887478 100644 (file)
@@ -1744,6 +1744,9 @@ extern void VG_(helper_CLD);
 extern void VG_(helper_STD);
 extern void VG_(helper_get_dirflag);
 
+extern void VG_(helper_CLC);
+extern void VG_(helper_STC);
+
 extern void VG_(helper_shldl);
 extern void VG_(helper_shldw);
 extern void VG_(helper_shrdl);
@@ -1887,6 +1890,9 @@ extern Int VGOFF_(helper_CLD);
 extern Int VGOFF_(helper_STD);
 extern Int VGOFF_(helper_get_dirflag);
 
+extern Int VGOFF_(helper_CLC);
+extern Int VGOFF_(helper_STC);
+
 extern Int VGOFF_(helper_shldl);
 extern Int VGOFF_(helper_shldw);
 extern Int VGOFF_(helper_shrdl);
index 399291d682149359ffa068aee887793b7442acad..986ddf32a6309dbf8132eea964051e7a95a2b44b 100644 (file)
@@ -77,6 +77,8 @@ Int VGOFF_(helper_mul_8_16) = INVALID_OFFSET;
 Int VGOFF_(helper_CLD) = INVALID_OFFSET;
 Int VGOFF_(helper_STD) = INVALID_OFFSET;
 Int VGOFF_(helper_get_dirflag) = INVALID_OFFSET;
+Int VGOFF_(helper_CLC) = INVALID_OFFSET;
+Int VGOFF_(helper_STC) = INVALID_OFFSET;
 Int VGOFF_(helper_shldl) = INVALID_OFFSET;
 Int VGOFF_(helper_shldw) = INVALID_OFFSET;
 Int VGOFF_(helper_shrdl) = INVALID_OFFSET;
@@ -269,6 +271,11 @@ static void vg_init_baseBlock ( void )
    VGOFF_(helper_get_dirflag)
       = alloc_BaB_1_set( (Addr) & VG_(helper_get_dirflag) );
 
+   VGOFF_(helper_CLC)
+      = alloc_BaB_1_set( (Addr) & VG_(helper_CLC) );
+    VGOFF_(helper_STC)
+      = alloc_BaB_1_set( (Addr) & VG_(helper_STC) );
+
    VGOFF_(helper_shldl)
       = alloc_BaB_1_set( (Addr) & VG_(helper_shldl) );
    VGOFF_(helper_shldw)
index da2871c3f184b9eff3d1c1ef0d5c436f7533533f..9230236fab2474444a6bf782045df3033470a256 100644 (file)
@@ -4051,6 +4051,22 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
       if (dis) VG_(printf)("std\n");
       break;
 
+   case 0xF8: /* CLC */
+      uInstr0(cb, CALLM_S, 0);
+      uInstr1(cb, CALLM, 0, Lit16, VGOFF_(helper_CLC));
+      uFlagsRWU(cb, FlagsEmpty, FlagC, FlagsOSZAP);
+      uInstr0(cb, CALLM_E, 0);
+      if (dis) VG_(printf)("clc\n");
+      break;
+
+   case 0xF9: /* STC */
+      uInstr0(cb, CALLM_S, 0);
+      uInstr1(cb, CALLM, 0, Lit16, VGOFF_(helper_STC));
+      uFlagsRWU(cb, FlagsEmpty, FlagC, FlagsOSZCP);
+      uInstr0(cb, CALLM_E, 0);
+      if (dis) VG_(printf)("stc\n");
+      break;
+
    case 0xF2: { /* REPNE prefix insn */
       Addr eip_orig = eip - 1;
       abyte = getUChar(eip); eip++;
index b2654bbfff471e130f1927f4e64b1bfcd7e09737..82627377d67085e0e1ee0ebae5e60b9a43bd9d12 100644 (file)
@@ -392,7 +392,16 @@ VG_(helper_STD):
        std
        ret
 
-
+/* Clear/set the carry flag. */
+.global VG_(helper_CLC)
+VG_(helper_CLC):
+        clc
+        ret
+
+.global VG_(helper_STC)  
+VG_(helper_STC):
+        stc
+        ret
 
 /* Signed 32-to-64 multiply. */
 .globl VG_(helper_imul_32_64)
index 1472e6384470c4b0d8122afe77c382fd484b13e2..2310050d0c0ec01df9415577a4f60f8707887478 100644 (file)
@@ -1744,6 +1744,9 @@ extern void VG_(helper_CLD);
 extern void VG_(helper_STD);
 extern void VG_(helper_get_dirflag);
 
+extern void VG_(helper_CLC);
+extern void VG_(helper_STC);
+
 extern void VG_(helper_shldl);
 extern void VG_(helper_shldw);
 extern void VG_(helper_shrdl);
@@ -1887,6 +1890,9 @@ extern Int VGOFF_(helper_CLD);
 extern Int VGOFF_(helper_STD);
 extern Int VGOFF_(helper_get_dirflag);
 
+extern Int VGOFF_(helper_CLC);
+extern Int VGOFF_(helper_STC);
+
 extern Int VGOFF_(helper_shldl);
 extern Int VGOFF_(helper_shldw);
 extern Int VGOFF_(helper_shrdl);
index 399291d682149359ffa068aee887793b7442acad..986ddf32a6309dbf8132eea964051e7a95a2b44b 100644 (file)
--- a/vg_main.c
+++ b/vg_main.c
@@ -77,6 +77,8 @@ Int VGOFF_(helper_mul_8_16) = INVALID_OFFSET;
 Int VGOFF_(helper_CLD) = INVALID_OFFSET;
 Int VGOFF_(helper_STD) = INVALID_OFFSET;
 Int VGOFF_(helper_get_dirflag) = INVALID_OFFSET;
+Int VGOFF_(helper_CLC) = INVALID_OFFSET;
+Int VGOFF_(helper_STC) = INVALID_OFFSET;
 Int VGOFF_(helper_shldl) = INVALID_OFFSET;
 Int VGOFF_(helper_shldw) = INVALID_OFFSET;
 Int VGOFF_(helper_shrdl) = INVALID_OFFSET;
@@ -269,6 +271,11 @@ static void vg_init_baseBlock ( void )
    VGOFF_(helper_get_dirflag)
       = alloc_BaB_1_set( (Addr) & VG_(helper_get_dirflag) );
 
+   VGOFF_(helper_CLC)
+      = alloc_BaB_1_set( (Addr) & VG_(helper_CLC) );
+    VGOFF_(helper_STC)
+      = alloc_BaB_1_set( (Addr) & VG_(helper_STC) );
+
    VGOFF_(helper_shldl)
       = alloc_BaB_1_set( (Addr) & VG_(helper_shldl) );
    VGOFF_(helper_shldw)
index da2871c3f184b9eff3d1c1ef0d5c436f7533533f..9230236fab2474444a6bf782045df3033470a256 100644 (file)
@@ -4051,6 +4051,22 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
       if (dis) VG_(printf)("std\n");
       break;
 
+   case 0xF8: /* CLC */
+      uInstr0(cb, CALLM_S, 0);
+      uInstr1(cb, CALLM, 0, Lit16, VGOFF_(helper_CLC));
+      uFlagsRWU(cb, FlagsEmpty, FlagC, FlagsOSZAP);
+      uInstr0(cb, CALLM_E, 0);
+      if (dis) VG_(printf)("clc\n");
+      break;
+
+   case 0xF9: /* STC */
+      uInstr0(cb, CALLM_S, 0);
+      uInstr1(cb, CALLM, 0, Lit16, VGOFF_(helper_STC));
+      uFlagsRWU(cb, FlagsEmpty, FlagC, FlagsOSZCP);
+      uInstr0(cb, CALLM_E, 0);
+      if (dis) VG_(printf)("stc\n");
+      break;
+
    case 0xF2: { /* REPNE prefix insn */
       Addr eip_orig = eip - 1;
       abyte = getUChar(eip); eip++;