Fix a few instructions with immediate arguments.

This commit is contained in:
Ulrich Drepper
2008-01-11 06:17:06 +00:00
parent 193d587f01
commit 96a739922f
7 changed files with 23 additions and 5 deletions
+2
View File
@@ -1,5 +1,7 @@
2008-01-10 Ulrich Drepper <drepper@redhat.com>
* defs/i386: Fix a few instructions with immediate arguments.
* i386_disasm.c: Rewrite interface to callback functions for operands
to take a single pointer to a structure.
* i386_data.h: Adjust all functions.
+3 -3
View File
@@ -71,7 +71,7 @@ ifdef(`i386',
0001001{w},{mod}{reg}{r_m}:adc {mod}{r_m}{w},{reg}{w}
0000010{w},{imm}:add {imm}{w},{ax}{w}
1000000{w},{mod}000{r_m},{imm}:add{w} {imm}{w},{mod}{r_m}{w}
10000011,{mod}000{r_m},{imms8}:add{w0} {imms8},{mod}{r_m}
10000011,{mod}000{r_m},{imms8}:add{w} {imms8},{mod}{r_m}
0000000{w},{mod}{reg}{r_m}:add {reg}{w},{mod}{r_m}{w}
0000001{w},{mod}{reg}{r_m}:add {mod}{r_m}{w},{reg}{w}
01100110,00001111,11010000,{Mod}{xmmreg}{R_m}:addsubpd {Mod}{R_m},{xmmreg}
@@ -124,7 +124,7 @@ ifdef(`i386',
00001111,0100{tttn},{mod}{reg}{r_m}:cmov{tttn} {mod}{r_m},{reg}
0011110{w},{imm}:cmp {imm}{w},{ax}{w}
1000000{w},{mod}111{r_m},{imm}:cmp{w} {imm}{w},{mod}{r_m}{w}
10000011,{mod}111{r_m},{imms8}:cmp{w0} {imms8},{mod}{r_m}
10000011,{mod}111{r_m},{imms8}:cmp{w} {imms8},{mod}{r_m}
0011100{w},{mod}{reg}{r_m}:cmp {reg}{w},{mod}{r_m}{w}
0011101{w},{mod}{reg}{r_m}:cmp {mod}{r_m}{w},{reg}{w}
ifdef(`ASSEMBLER',
@@ -429,7 +429,7 @@ ifdef(`i386',
0000100{w},{mod}{reg}{r_m}:or {reg}{w},{mod}{r_m}{w}
0000101{w},{mod}{reg}{r_m}:or {mod}{r_m}{w},{reg}{w}
1000000{w},{mod}001{r_m},{imm}:or{w} {imm}{w},{mod}{r_m}{w}
1000001{w},{mod}001{r_m},{imm8}:or{w} {imm8},{mod}{r_m}{w}
1000001{w},{mod}001{r_m},{imms8}:or{w} {imms8},{mod}{r_m}{w}
0000110{w},{imm}:or {imm}{w},{ax}{w}
1110011{w},{imm8}:out {ax}{w},{imm8}
1110111{w}:out {ax}{w},{dx}
+9 -2
View File
@@ -813,8 +813,15 @@ FCT_imms8 (struct output_data *d)
if (*d->param_start >= d->end)
return -1;
int_fast8_t byte = *(*d->param_start)++;
int needed = snprintf (&d->bufp[*bufcntp], avail, "$0x%" PRIx32,
(int32_t) byte);
int needed;
#ifdef X86_64
if (*d->prefixes & has_rex_w)
needed = snprintf (&d->bufp[*bufcntp], avail, "$0x%" PRIx64,
(int64_t) byte);
else
#endif
needed = snprintf (&d->bufp[*bufcntp], avail, "$0x%" PRIx32,
(int32_t) byte);
if ((size_t) needed > avail)
return (size_t) needed - avail;
*bufcntp += needed;
+4
View File
@@ -640,6 +640,10 @@ i386_disasm (const uint8_t **startp, const uint8_t *end, GElf_Addr addr,
{
if (prefixes & has_data16)
ch = 'w';
#ifdef X86_64
else if (prefixes & has_rex_w)
ch = 'q';
#endif
else
ch = 'l';
}
+5
View File
@@ -1,3 +1,8 @@
2008-01-10 Ulrich Drepper <drepper@redhat.com>
* testfile45.S.bz2: Add more tests.
* testfile45.expect.bz2: Adjust.
2008-01-08 Ulrich Drepper <drepper@redhat.com>
* Makefile.am (TESTS): Add run-disasm-x86-64.sh.
Binary file not shown.
Binary file not shown.