From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11668 invoked by alias); 6 Feb 2011 16:33:19 -0000 Received: (qmail 11658 invoked by uid 22791); 6 Feb 2011 16:33:18 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_EQ,TW_FH,TW_HB,TW_SR,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 06 Feb 2011 16:33:13 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p16GXCor028349 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 6 Feb 2011 11:33:12 -0500 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p16GXAvS022826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 6 Feb 2011 11:33:12 -0500 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p16GXAJ0032416; Sun, 6 Feb 2011 17:33:10 +0100 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id p16GXA4l032415; Sun, 6 Feb 2011 17:33:10 +0100 Date: Sun, 06 Feb 2011 16:33:00 -0000 From: Jan Kratochvil To: Hui Zhu Cc: gdb-patches@sourceware.org Subject: [drop/fyi] About verifying record opcodes Message-ID: <20110206163310.GB29666@host1.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-02/txt/msg00111.txt.bz2 Hi Hui, while verifying the opcodes I found these differences - both http://developer.intel.com/products/processor/manuals/ and GNU opcodes use the suffix "d" - why the code is using "l"? (for all --architecture of i386, i386:x86-64, i386:x86-64:intel) Used this verification script but it has too many false positives, it would need some .c file adjustments for full "PASS" on the current code. Just FYI. Regards, Jan #! /usr/bin/perl use strict; use warnings; # case 0x0f10: /* movups */ my $fname="/tmp/cases.bin"; while (<>) { chomp; next if /^$/; die $_ if !m{^\s*case\s+0x((?:[0-9a-f]{2})*):\s*/[*] (\w+) [*]/\s*$}; my $opname=$2; my $bin=$1.("00"x16); $bin=pack "H*",$bin; open F,">$fname" or die ">$fname"; print F $bin or die; close F or die; open F,"objdump -D --target=binary --architecture=i386:x86-64 $fname |" or die; my $F=do { local $/; ; } or die; close F or die; if ($F=~m{\n0000000000000000.*\n.*\b${opname}l?\b.*\n(\s*\Q...\E\n)?$}) { warn "pass: $_\n"; } else { warn "FAIL: $_\n->\n$F".("-"x78)."\n"; } } --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -6347,7 +6347,7 @@ reswitch_prefix_add: case 0x660f63: /* packsswb */ case 0x660f64: /* pcmpgtb */ case 0x660f65: /* pcmpgtw */ - case 0x660f66: /* pcmpgtl */ + case 0x660f66: /* pcmpgtd */ case 0x660f67: /* packuswb */ case 0x660f68: /* punpckhbw */ case 0x660f69: /* punpckhwd */ @@ -6363,7 +6363,7 @@ reswitch_prefix_add: case 0xf30f70: /* pshufhw */ case 0x660f74: /* pcmpeqb */ case 0x660f75: /* pcmpeqw */ - case 0x660f76: /* pcmpeql */ + case 0x660f76: /* pcmpeqd */ case 0x660f7c: /* haddpd */ case 0xf20f7c: /* haddps */ case 0x660f7d: /* hsubpd */ @@ -6418,11 +6418,11 @@ reswitch_prefix_add: case 0x660ff6: /* psadbw */ case 0x660ff8: /* psubb */ case 0x660ff9: /* psubw */ - case 0x660ffa: /* psubl */ + case 0x660ffa: /* psubd */ case 0x660ffb: /* psubq */ case 0x660ffc: /* paddb */ case 0x660ffd: /* paddw */ - case 0x660ffe: /* paddl */ + case 0x660ffe: /* paddd */ if (i386_record_modrm (&ir)) return -1; ir.reg |= rex_r; @@ -6558,7 +6558,7 @@ reswitch_prefix_add: case 0x0f63: /* packsswb */ case 0x0f64: /* pcmpgtb */ case 0x0f65: /* pcmpgtw */ - case 0x0f66: /* pcmpgtl */ + case 0x0f66: /* pcmpgtd */ case 0x0f67: /* packuswb */ case 0x0f68: /* punpckhbw */ case 0x0f69: /* punpckhwd */ @@ -6569,7 +6569,7 @@ reswitch_prefix_add: case 0x0f70: /* pshufw */ case 0x0f74: /* pcmpeqb */ case 0x0f75: /* pcmpeqw */ - case 0x0f76: /* pcmpeql */ + case 0x0f76: /* pcmpeqd */ case 0x0fc4: /* pinsrw */ case 0x0fd1: /* psrlw */ case 0x0fd2: /* psrld */ @@ -6607,11 +6607,11 @@ reswitch_prefix_add: case 0x0ff6: /* psadbw */ case 0x0ff8: /* psubb */ case 0x0ff9: /* psubw */ - case 0x0ffa: /* psubl */ + case 0x0ffa: /* psubd */ case 0x0ffb: /* psubq */ case 0x0ffc: /* paddb */ case 0x0ffd: /* paddw */ - case 0x0ffe: /* paddl */ + case 0x0ffe: /* paddd */ if (i386_record_modrm (&ir)) return -1; if (!i386_mmx_regnum_p (gdbarch, I387_MM0_REGNUM (tdep) + ir.reg))