Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJ6b3-0004GY-OL for qemu-devel@nongnu.org; Sat, 03 Jan 2009 08:31:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJ6b3-0004G5-3p for qemu-devel@nongnu.org; Sat, 03 Jan 2009 08:31:21 -0500 Received: from [199.232.76.173] (port=58213 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJ6b2-0004Fv-TB for qemu-devel@nongnu.org; Sat, 03 Jan 2009 08:31:20 -0500 Received: from savannah.gnu.org ([199.232.41.3]:59695 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LJ6b2-0007Cm-LQ for qemu-devel@nongnu.org; Sat, 03 Jan 2009 08:31:20 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LJ6b2-0001Nc-3U for qemu-devel@nongnu.org; Sat, 03 Jan 2009 13:31:20 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LJ6b1-0001NY-Mv for qemu-devel@nongnu.org; Sat, 03 Jan 2009 13:31:19 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Sat, 03 Jan 2009 13:31:19 +0000 Subject: [Qemu-devel] [6153] Add helper macros for later patches. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6153 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6153 Author: aurel32 Date: 2009-01-03 13:31:19 +0000 (Sat, 03 Jan 2009) Log Message: ----------- Add helper macros for later patches. Remove N_ELEMS, VECTOR_FOR, and VECTOR_FOR_I macros. Retain the VECTOR_FOR_INORDER_I macros as the clearest way of expressing the intent of iterating over elements in their stored target-endian order. Signed-off-by: Nathan Froyd Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-ppc/op_helper.c Modified: trunk/target-ppc/op_helper.c =================================================================== --- trunk/target-ppc/op_helper.c 2009-01-03 13:31:10 UTC (rev 6152) +++ trunk/target-ppc/op_helper.c 2009-01-03 13:31:19 UTC (rev 6153) @@ -1954,6 +1954,28 @@ } /*****************************************************************************/ +/* Altivec extension helpers */ +#if defined(WORDS_BIGENDIAN) +#define HI_IDX 0 +#define LO_IDX 1 +#else +#define HI_IDX 1 +#define LO_IDX 0 +#endif + +#if defined(WORDS_BIGENDIAN) +#define VECTOR_FOR_INORDER_I(index, element) \ + for (index = 0; index < ARRAY_SIZE(r->element); index++) +#else +#define VECTOR_FOR_INORDER_I(index, element) \ + for (index = ARRAY_SIZE(r->element)-1; index >= 0; index--) +#endif + +#undef VECTOR_FOR_INORDER_I +#undef HI_IDX +#undef LO_IDX + +/*****************************************************************************/ /* SPE extension helpers */ /* Use a table to make this quicker */ static uint8_t hbrev[16] = {