+2007-09-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * i386-dis.c (get_valid_dis386): Take a pointer to
+       disassemble_info.  Handle IS_3BYTE_OPCODE.
+       (print_insn): Updated.  Don't handle IS_3BYTE_OPCODE here.
+
 2007-09-12  H.J. Lu  <hongjiu.lu@intel.com>
 
        * i386-opc.h (CpuUnused): Defined with CpuMax.
 
 /* Get a pointer to struct dis386 with a valid name.  */
 
 static const struct dis386 *
-get_valid_dis386 (const struct dis386 *dp)
+get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
 {
   int index;
 
       dp = &x86_64_table[dp->op[1].bytemode][index];
       break;
 
+    case IS_3BYTE_OPCODE:
+      FETCH_DATA (info, codep + 2);
+      index = *codep++;
+      dp = &three_byte_table[dp->op[1].bytemode][index];
+      modrm.mod = (*codep >> 6) & 3;
+      modrm.reg = (*codep >> 3) & 7;
+      modrm.rm = *codep & 7;
+      break;
+
     case USE_OPC_EXT_TABLE:
       index = modrm.mod == 0x3 ? 1 : 0;
       dp = &opc_ext_table[dp->op[1].bytemode][index];
   if (dp->name != NULL)
     return dp;
   else
-    return get_valid_dis386 (dp);
+    return get_valid_dis386 (dp, info);
 }
 
 static int
       dp = &dis386_twobyte[threebyte];
       need_modrm = twobyte_has_modrm[*codep];
       codep++;
-      if (dp->name == NULL && dp->op[0].bytemode == IS_3BYTE_OPCODE)
-       {
-         FETCH_DATA (info, codep + 2);
-         op = *codep++;
-       }
     }
   else
     {
        }
     }
 
-  if (dp->name == NULL && dp->op[0].bytemode == IS_3BYTE_OPCODE)
-    {
-      dp = &three_byte_table[dp->op[1].bytemode][op];
-      modrm.mod = (*codep >> 6) & 3;
-      modrm.reg = (*codep >> 3) & 7;
-      modrm.rm = *codep & 7;
-    }
-  else if (need_modrm)
+  if (need_modrm)
     {
       FETCH_DATA (info, codep + 1);
       modrm.mod = (*codep >> 6) & 3;
     }
   else
     {
-      dp = get_valid_dis386 (dp);
+      dp = get_valid_dis386 (dp, info);
       if (dp != NULL && putop (dp->name, sizeflag) == 0)
         {
          for (i = 0; i < MAX_OPERANDS; ++i)