aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-dis.c
diff options
context:
space:
mode:
authorMichael Meissner <gnu@the-meissners.org>2006-10-23 22:53:29 +0000
committerMichael Meissner <gnu@the-meissners.org>2006-10-23 22:53:29 +0000
commit7918206c559f06d25e8fdd6894cfc3000f1cb22e (patch)
tree868bfcdf63ba0b360547e2ccefd1d1a925d29baf /opcodes/i386-dis.c
parenta3ffa599fe54e0e5396f1617b7bc1c391055a1b7 (diff)
downloadgdb-7918206c559f06d25e8fdd6894cfc3000f1cb22e.zip
gdb-7918206c559f06d25e8fdd6894cfc3000f1cb22e.tar.gz
gdb-7918206c559f06d25e8fdd6894cfc3000f1cb22e.tar.bz2
Fix AMDFAM10 POPCNT instruction
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r--opcodes/i386-dis.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 44625bb..c1e67c4 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -471,6 +471,8 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
#define PREGRP34 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 34, NULL, 0, NULL, 0
#define PREGRP35 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 35, NULL, 0, NULL, 0
#define PREGRP36 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 36, NULL, 0, NULL, 0
+#define PREGRP37 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 37, NULL, 0, NULL, 0
+
#define X86_64_0 NULL, NULL, X86_64_SPECIAL, NULL, 0, NULL, 0, NULL, 0
@@ -1028,7 +1030,7 @@ static const struct dis386 dis386_twobyte[] = {
{ "movz{bR|x|bR|x}", Gv, Eb, XX, XX },
{ "movz{wR|x|wR|x}", Gv, Ew, XX, XX }, /* yes, there really is movzww ! */
/* b8 */
- { "popcntS", Gv, Ev, XX, XX },
+ { PREGRP37 },
{ "ud2b", XX, XX, XX, XX },
{ GRP8 },
{ "btcS", Ev, Gv, XX, XX },
@@ -1820,6 +1822,13 @@ static const struct dis386 prefix_user_table[][4] = {
{ "(bad)", XX, XX, XX, XX },
},
+ /* PREGRP37 */
+ {
+ { "(bad)", XX, XX, XX, XX },
+ { "popcntS",Gv, Ev, XX, XX },
+ { "(bad)", XX, XX, XX, XX },
+ { "(bad)", XX, XX, XX, XX },
+ },
};
static const struct dis386 x86_64_table[][2] = {
@@ -2827,13 +2836,14 @@ print_insn (bfd_vma pc, disassemble_info *info)
uses_LOCK_prefix = 0;
}
- /*"lzcnt"=0xBD is the only non-sse instruction which uses F3 in the opcode without any "rep(z|nz)"*/
- if (!uses_SSE_prefix && (prefixes & PREFIX_REPZ) && *codep !=0xBD)
+ /*"lzcnt"=0xBD and "popcnt"=0xB8 are the only two non-sse
+ instruction which uses F3 in the opcode without any "rep(z|nz)"*/
+ if (!uses_SSE_prefix && (prefixes & PREFIX_REPZ) && *codep != 0xBD && *codep != 0xB8)
{
oappend ("repz ");
used_prefixes |= PREFIX_REPZ;
}
- if (!uses_SSE_prefix && (prefixes & PREFIX_REPNZ) && *codep !=0xBD)
+ if (!uses_SSE_prefix && (prefixes & PREFIX_REPNZ) && *codep != 0xBD && *codep != 0xB8)
{
oappend ("repnz ");
used_prefixes |= PREFIX_REPNZ;