Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277307
b: refs/heads/master
c: 130b78b
h: refs/heads/master
i:
  277305: 9892534
  277303: 3df38f9
v: v3
  • Loading branch information
Masami Hiramatsu authored and Ingo Molnar committed Dec 5, 2011
1 parent 0dc3956 commit 3badfd1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1056c3e916f12cdd8042ab27dfccbb3a9e871df0
refs/heads/master: 130b78b2bf16d5d89091db38374faef896360cf9
9 changes: 8 additions & 1 deletion trunk/arch/x86/lib/inat.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,16 @@ insn_attr_t inat_get_avx_attribute(insn_byte_t opcode, insn_byte_t vex_m,
const insn_attr_t *table;
if (vex_m > X86_VEX_M_MAX || vex_p > INAT_LSTPFX_MAX)
return 0;
table = inat_avx_tables[vex_m][vex_p];
/* At first, this checks the master table */
table = inat_avx_tables[vex_m][0];
if (!table)
return 0;
if (!inat_is_group(table[opcode]) && vex_p) {
/* If this is not a group, get attribute directly */
table = inat_avx_tables[vex_m][vex_p];
if (!table)
return 0;
}
return table[opcode];
}

4 changes: 3 additions & 1 deletion trunk/arch/x86/lib/insn.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void insn_get_opcode(struct insn *insn)
m = insn_vex_m_bits(insn);
p = insn_vex_p_bits(insn);
insn->attr = inat_get_avx_attribute(op, m, p);
if (!inat_accept_vex(insn->attr))
if (!inat_accept_vex(insn->attr) && !inat_is_group(insn->attr))
insn->attr = 0; /* This instruction is bad */
goto end; /* VEX has only 1 byte for opcode */
}
Expand Down Expand Up @@ -249,6 +249,8 @@ void insn_get_modrm(struct insn *insn)
pfx = insn_last_prefix(insn);
insn->attr = inat_get_group_attribute(mod, pfx,
insn->attr);
if (insn_is_avx(insn) && !inat_accept_vex(insn->attr))
insn->attr = 0; /* This is bad */
}
}

Expand Down

0 comments on commit 3badfd1

Please sign in to comment.