From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHrad-0003Cq-KR for qemu-devel@nongnu.org; Tue, 30 Dec 2008 22:17:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHrab-0003Bl-Tj for qemu-devel@nongnu.org; Tue, 30 Dec 2008 22:17:47 -0500 Received: from [199.232.76.173] (port=51251 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHrab-0003Bh-KO for qemu-devel@nongnu.org; Tue, 30 Dec 2008 22:17:45 -0500 Received: from mx20.gnu.org ([199.232.41.8]:31449) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LHrab-0005bD-GI for qemu-devel@nongnu.org; Tue, 30 Dec 2008 22:17:45 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LHraa-0006je-M3 for qemu-devel@nongnu.org; Tue, 30 Dec 2008 22:17:45 -0500 From: Nathan Froyd Date: Tue, 30 Dec 2008 19:09:44 -0800 Message-Id: <1230693022-18380-3-git-send-email-froydnj@codesourcery.com> In-Reply-To: <1230693022-18380-1-git-send-email-froydnj@codesourcery.com> References: <1230693022-18380-1-git-send-email-froydnj@codesourcery.com> Subject: [Qemu-devel] [PATCH 02/40] 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 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 --- target-ppc/op_helper.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 876b517..5d603ba 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -1954,6 +1954,28 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_ } /*****************************************************************************/ +/* 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] = { -- 1.6.0.5