From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYZnZ-0003yT-04 for qemu-devel@nongnu.org; Tue, 22 Oct 2013 07:06:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYZnS-00052Y-UE for qemu-devel@nongnu.org; Tue, 22 Oct 2013 07:06:52 -0400 Date: Tue, 22 Oct 2013 22:06:46 +1100 From: Anton Blanchard Message-ID: <20131022220646.04afbbce@kryten> In-Reply-To: <20131022220546.2a20d02a@kryten> References: <20131022220546.2a20d02a@kryten> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 3/7] Add VSX Instruction Decoders List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: agraf@suse.de Cc: tommusta@gmail.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, rth@twiddle.net 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 --- Index: b/target-ppc/translate.c =================================================================== --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -370,6 +370,12 @@ static inline int32_t name(uint32_t opco 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 */ @@ -484,6 +490,11 @@ static inline target_ulong MASK(uint32_t 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 */