From: Hui Zhu <teawater@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [drop/fyi] About verifying record opcodes
Date: Tue, 08 Feb 2011 12:46:00 -0000 [thread overview]
Message-ID: <AANLkTi=0TUcZ7FNKzrQrYZmDufbRJwyeUTUmO96KVzC3@mail.gmail.com> (raw)
In-Reply-To: <20110206163310.GB29666@host1.dyn.jankratochvil.net>
Hi Jan,
That is great. Please go ahead.
Thanks,
Hui
On Mon, Feb 7, 2011 at 00:33, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> 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))
>
next prev parent reply other threads:[~2011-02-08 12:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-06 16:33 Jan Kratochvil
2011-02-07 15:01 ` Tom Tromey
2011-02-08 12:46 ` Hui Zhu [this message]
2011-02-08 14:02 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTi=0TUcZ7FNKzrQrYZmDufbRJwyeUTUmO96KVzC3@mail.gmail.com' \
--to=teawater@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox