KVM: PPC: Emulator: clean up instruction parsing
authorAlexander Graf <agraf@suse.de>
Fri, 4 May 2012 12:01:33 +0000 (14:01 +0200)
committerAlexander Graf <agraf@suse.de>
Sun, 6 May 2012 14:19:12 +0000 (16:19 +0200)
commitc46dc9a86148bc37c31d67a22a3887144ba7aa81
treeba2a4f49072d3524d607ce3add83ef697fae517b
parent5b74716ebab10e7bce960d148fe6d8f6920451e5
KVM: PPC: Emulator: clean up instruction parsing

Instructions on PPC are pretty similarly encoded. So instead of
every instruction emulation code decoding the instruction fields
itself, we can move that code to more generic places and rely on
the compiler to optimize the unused bits away.

This has 2 advantages. It makes the code smaller and it makes the
code less error prone, as the instruction fields are always
available, so accidental misusage is reduced.

Functionally, this patch doesn't change anything.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/44x_emulate.c
arch/powerpc/kvm/book3s_emulate.c
arch/powerpc/kvm/booke_emulate.c
arch/powerpc/kvm/e500_emulate.c
arch/powerpc/kvm/emulate.c