summaryrefslogtreecommitdiff
path: root/opcodes
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
commitb642d576291a592136306f2b65d1776eb2658ef3 (patch)
tree1077c3a0cecdd55052ebca74216569d11bc639f5 /opcodes
parentb8c247cc219708542a1a151b2e517456be164d8a (diff)
downloadgdb-b642d576291a592136306f2b65d1776eb2658ef3.tar.gz
Fix AMDFAM10 POPCNT instruction
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog7
-rw-r--r--opcodes/i386-dis.c18
2 files changed, 21 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 554a4cc3f0b..3173ec31180 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-23 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
+
+ * i386-dis.c (dis386): Add support for the change in POPCNT opcode in
+ amdfam10 architecture.
+ (PREGRP37): NEW.
+ (print_insn): Disallow REP prefix for POPCNT.
+
2006-10-20 Andrew Stubbs <andrew.stubbs@st.com>
* sh-dis.c (print_insn_sh): Remove 0x from output to prevent GDB
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 44625bb0397..c1e67c407b1 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;