Received: from eggs.gnu.org ([2001:4830:134:3::10]:41924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtoSf-0004it-1M for qemu-devel@nongnu.org; Thu, 19 Dec 2013 20:01:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtoSZ-0002Mf-Ki for qemu-devel@nongnu.org; Thu, 19 Dec 2013 20:01:04 -0500 From: Alexander Graf Date: Fri, 20 Dec 2013 02:00:27 +0100 Message-Id: <1387501254-60704-6-git-send-email-agraf@suse.de> In-Reply-To: <1387501254-60704-1-git-send-email-agraf@suse.de> References: <1387501254-60704-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PULL 05/32] Add VSX Instruction Decoders List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Tom Musta , "qemu-ppc@nongnu.org" , Anton Blanchard , Anthony Liguori From: Tom Musta This patch adds decoders for the VSX fields XT, XS, XA, XB and DM. The first four are split fields and a general helper for these types of fields is also added. Signed-off-by: Tom Musta Signed-off-by: Anton Blanchard Signed-off-by: Alexander Graf --- target-ppc/translate.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 415f5d1..de2c764 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -366,6 +366,12 @@ static inline int32_t name(uint32_t opcode) \ return (int16_t)((opcode >> (shift)) & ((1 << (nb)) - 1)); \ } +#define EXTRACT_HELPER_SPLIT(name, shift1, nb1, shift2, nb2) \ +static inline uint32_t name(uint32_t opcode) \ +{ \ + return (((opcode >> (shift1)) & ((1 << (nb1)) - 1)) << nb2) | \ + ((opcode >> (shift2)) & ((1 << (nb2)) - 1)); \ +} /* Opcode part 1 */ EXTRACT_HELPER(opc1, 26, 6); /* Opcode part 2 */ @@ -480,6 +486,11 @@ static inline target_ulong MASK(uint32_t start, uint32_t end) return ret; } +EXTRACT_HELPER_SPLIT(xT, 0, 1, 21, 5); +EXTRACT_HELPER_SPLIT(xS, 0, 1, 21, 5); +EXTRACT_HELPER_SPLIT(xA, 2, 1, 16, 5); +EXTRACT_HELPER_SPLIT(xB, 1, 1, 11, 5); +EXTRACT_HELPER(DM, 8, 2); /*****************************************************************************/ /* PowerPC instructions table */ -- 1.8.1.4