Reviewers: Erik Corry,

Description:
Add test_b(Operand, imm8) to ia32 disassembler.

Please review this at http://codereview.chromium.org/2765001/show

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/ia32/disasm-ia32.cc
  M     test/cctest/test-disasm-ia32.cc


Index: src/ia32/disasm-ia32.cc
===================================================================
--- src/ia32/disasm-ia32.cc     (revision 4815)
+++ src/ia32/disasm-ia32.cc     (working copy)
@@ -924,14 +924,18 @@
         break;

       case 0xF6:
-        { int mod, regop, rm;
-          get_modrm(*(data+1), &mod, &regop, &rm);
-          if (mod == 3 && regop == eax) {
- AppendToBuffer("test_b %s,%d", NameOfCPURegister(rm), *(data+2));
+        { data++;
+          int mod, regop, rm;
+          get_modrm(*data, &mod, &regop, &rm);
+          if (regop == eax) {
+            AppendToBuffer("test_b ");
+            data += PrintRightOperand(data);
+            int32_t imm = *data;
+            AppendToBuffer(",0x%x", imm);
+            data++;
           } else {
             UnimplementedInstruction();
           }
-          data += 3;
         }
         break;

Index: test/cctest/test-disasm-ia32.cc
===================================================================
--- test/cctest/test-disasm-ia32.cc     (revision 4815)
+++ test/cctest/test-disasm-ia32.cc     (working copy)
@@ -244,6 +244,9 @@

   __ test(edx, Immediate(12345));
   __ test(edx, Operand(ebx, ecx, times_8, 10000));
+  __ test(Operand(esi, edi, times_1, -20000000), Immediate(300000000));
+  __ test_b(edx, Operand(ecx, ebx, times_2, 1000));
+  __ test_b(Operand(eax, -20), 0x9A);
   __ nop();

   __ xor_(edx, 12345);


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to