This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[drop/fyi] About verifying record opcodes
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 6 Feb 2011 17:33:10 +0100
- Subject: [drop/fyi] About verifying record opcodes
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 $/; <F>; } 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))