* [drop/fyi] About verifying record opcodes
@ 2011-02-06 16:33 Jan Kratochvil
2011-02-07 15:01 ` Tom Tromey
2011-02-08 12:46 ` Hui Zhu
0 siblings, 2 replies; 4+ messages in thread
From: Jan Kratochvil @ 2011-02-06 16:33 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches
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))
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [drop/fyi] About verifying record opcodes
2011-02-06 16:33 [drop/fyi] About verifying record opcodes Jan Kratochvil
@ 2011-02-07 15:01 ` Tom Tromey
2011-02-08 12:46 ` Hui Zhu
1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2011-02-07 15:01 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: Hui Zhu, gdb-patches
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Jan> and GNU opcodes use the suffix "d" - why the code is using "l"?
Jan> (for all --architecture of i386, i386:x86-64, i386:x86-64:intel)
Is there any way we could reuse data from src/opcodes for this?
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [drop/fyi] About verifying record opcodes
2011-02-06 16:33 [drop/fyi] About verifying record opcodes Jan Kratochvil
2011-02-07 15:01 ` Tom Tromey
@ 2011-02-08 12:46 ` Hui Zhu
2011-02-08 14:02 ` Jan Kratochvil
1 sibling, 1 reply; 4+ messages in thread
From: Hui Zhu @ 2011-02-08 12:46 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
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))
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [drop/fyi] About verifying record opcodes
2011-02-08 12:46 ` Hui Zhu
@ 2011-02-08 14:02 ` Jan Kratochvil
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kratochvil @ 2011-02-08 14:02 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches
Hi Hui,
On Tue, 08 Feb 2011 13:45:50 +0100, Hui Zhu wrote:
> That is great. Please go ahead.
Checked in.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2011-02/msg00044.html
--- src/gdb/ChangeLog 2011/02/08 13:58:02 1.12550
+++ src/gdb/ChangeLog 2011/02/08 14:01:47 1.12551
@@ -1,5 +1,11 @@
2011-02-08 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * i386-tdep.c (i386_process_record): Rename l suffixes to d suffixes
+ in comments for pcmpgtd, pcmpeqd, psubd, paddd, pcmpgtd, pcmpeqd,
+ psubd and paddd.
+
+2011-02-08 Jan Kratochvil <jan.kratochvil@redhat.com>
+
PR 12361.
* i386-tdep.c (i386_process_record) <0x660f3807>: Fix the comment to
phsubsw.
--- src/gdb/i386-tdep.c 2011/02/08 13:58:02 1.323
+++ src/gdb/i386-tdep.c 2011/02/08 14:01:47 1.324
@@ -6347,7 +6347,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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))
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-08 14:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-06 16:33 [drop/fyi] About verifying record opcodes Jan Kratochvil
2011-02-07 15:01 ` Tom Tromey
2011-02-08 12:46 ` Hui Zhu
2011-02-08 14:02 ` Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox