]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
(Tim Rowley, verbatim)
authorJulian Seward <jseward@acm.org>
Sat, 13 Jul 2002 12:32:16 +0000 (12:32 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 13 Jul 2002 12:32:16 +0000 (12:32 +0000)
The Intel p4 manual suggests inserting a pause instruction in
spin-wait loops as a hint to what the code is doing.  In other
respects it acts just like a nop.  Pause (0xF3 0x90) currently
causes valgrind to panic.  The patch below keeps things running.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@493

coregrind/vg_to_ucode.c
vg_to_ucode.c

index e56b02cab2b08772b9b88570613ef5b047990a43..0b1e5c61dc08fa2c1283ca72646eac34f1819690 100644 (file)
@@ -4111,6 +4111,11 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
          codegen_REPE_STOS ( cb, sz, eip_orig, eip );
          *isEnd = True;
          if (dis) VG_(printf)("repe stos%c\n", nameISize(sz));
+      }
+      else
+      if (abyte == 0x90) { /* REPE NOP (PAUSE) */
+         if (dis) VG_(printf)("repe nop (P4 pause)\n");
+         /* do nothing; apparently a hint to the P4 re spin-wait loop */
       } else {
          VG_(printf)("REPE then 0x%x\n", (UInt)abyte);
          VG_(panic)("Unhandled REPE case");
index e56b02cab2b08772b9b88570613ef5b047990a43..0b1e5c61dc08fa2c1283ca72646eac34f1819690 100644 (file)
@@ -4111,6 +4111,11 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
          codegen_REPE_STOS ( cb, sz, eip_orig, eip );
          *isEnd = True;
          if (dis) VG_(printf)("repe stos%c\n", nameISize(sz));
+      }
+      else
+      if (abyte == 0x90) { /* REPE NOP (PAUSE) */
+         if (dis) VG_(printf)("repe nop (P4 pause)\n");
+         /* do nothing; apparently a hint to the P4 re spin-wait loop */
       } else {
          VG_(printf)("REPE then 0x%x\n", (UInt)abyte);
          VG_(panic)("Unhandled REPE case");