From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWd6Y-0006ED-4E for qemu-devel@nongnu.org; Mon, 08 Aug 2016 01:28:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWd6U-0004Gl-SD for qemu-devel@nongnu.org; Mon, 08 Aug 2016 01:28:02 -0400 Sender: Richard Henderson References: <1470591415-3268-1-git-send-email-nikunj@linux.vnet.ibm.com> <1470591415-3268-7-git-send-email-nikunj@linux.vnet.ibm.com> From: Richard Henderson Message-ID: Date: Mon, 8 Aug 2016 10:57:49 +0530 MIME-Version: 1.0 In-Reply-To: <1470591415-3268-7-git-send-email-nikunj@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/6] target-ppc: add stxvb16x and stxvh8x List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania , qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Cc: qemu-devel@nongnu.org, benh@kernel.crashing.org On 08/07/2016 11:06 PM, Nikunj A Dadhania wrote: > +#define STXV(name, access, swap, type, elems) \ > +void helper_##name(CPUPPCState *env, uint64_t vsr, \ > + target_ulong addr) \ > +{ \ > + type *r; \ > + int i, index, bound, step; \ > + if (msr_le) { \ > + index = elems - 1; \ > + bound = -1; \ > + step = -1; \ > + } else { \ > + index = 0; \ > + bound = elems; \ > + step = 1; \ > + } \ > + r = (type *) &vsr; \ > + for (i = index; i != bound; i += step) { \ > + if (needs_byteswap(env)) { \ > + access(env, addr, swap(r[i]), GETPC()); \ > + } else { \ > + access(env, addr, r[i], GETPC()); \ > + } \ > + addr = addr_add(env, addr, sizeof(type)); \ > + } \ > +} Similarly, with the same helpers as for load. r~