Received: from eggs.gnu.org ([2001:4830:134:3::10]:51562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXKmB-0005k7-N6 for qemu-devel@nongnu.org; Wed, 10 Aug 2016 00:05:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXKm7-0006kf-FB for qemu-devel@nongnu.org; Wed, 10 Aug 2016 00:05:54 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:20658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXKm7-0006kO-6Y for qemu-devel@nongnu.org; Wed, 10 Aug 2016 00:05:51 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7A43Vt9132209 for ; Wed, 10 Aug 2016 00:05:48 -0400 Received: from e23smtp04.au.ibm.com (e23smtp04.au.ibm.com [202.81.31.146]) by mx0a-001b2d01.pphosted.com with ESMTP id 24qm9rhysm-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 10 Aug 2016 00:05:48 -0400 Received: from localhost by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Aug 2016 14:05:45 +1000 References: <1470737540-5526-1-git-send-email-raji@linux.vnet.ibm.com> <1470737540-5526-2-git-send-email-raji@linux.vnet.ibm.com> <262c4ea7-44bc-3fa5-ca28-3e69ccf699e4@twiddle.net> From: Rajalakshmi Srinivasaraghavan Date: Wed, 10 Aug 2016 09:35:40 +0530 MIME-Version: 1.0 In-Reply-To: <262c4ea7-44bc-3fa5-ca28-3e69ccf699e4@twiddle.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Message-Id: Subject: Re: [Qemu-devel] [PATCH v2 1/5] target-ppc: add vector insert instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Cc: qemu-devel@nongnu.org, nikunj@linux.vnet.ibm.com, benh@kernel.crashing.org On 08/09/2016 11:50 PM, Richard Henderson wrote: > On 08/09/2016 03:42 PM, Rajalakshmi Srinivasaraghavan wrote: >> + for (i = 0; i < ARRAY_SIZE(r->element); i++) >> { \ >> + result.element[i] = >> r->element[i]; \ >> + } \ > > memcpy, or assignment. > >> + for (i = 0; i < sizeof(r->element[0]); i++) >> { \ >> + result.u8[SPLAT(element) + i] = b->u8[s + >> i]; \ >> + } \ > > Also memcpy. Do you mean memcpy is preferred here? > > I think your mistake is in your definition of SPLAT, as pointed out by > David(?) elsewhere. Any conditional should take place at translate time. David pointed not to use SPLAT_ELEMENT which I have corrected in the last patch.(v2) > > If an exception isn't legal for halfword splat=15, then forcing > splat=14 (or 0, or...) would be legal, since splat=15 is undefined. Yes. I have done the same here. #define SPLAT(element) \ ((splat > (16 - sizeof(r->element[0]))) ? 16 - sizeof(r->element[0]) : splat) > > > r~ > > -- Thanks Rajalakshmi S