Skip to content

Commit

Permalink
KVM: x86 emulator: simplify REX.W check
Browse files Browse the repository at this point in the history
(x && (x & y)) == (x & y)

Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Avi Kivity committed Oct 24, 2010
1 parent d4709c7 commit 1e87e3e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2358,9 +2358,8 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt)
done_prefixes:

/* REX prefix. */
if (c->rex_prefix)
if (c->rex_prefix & 8)
c->op_bytes = 8; /* REX.W */
if (c->rex_prefix & 8)
c->op_bytes = 8; /* REX.W */

/* Opcode byte(s). */
opcode = opcode_table[c->b];
Expand Down

0 comments on commit 1e87e3e

Please sign in to comment.