Received: from eggs.gnu.org ([2001:4830:134:3::10]:43715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSkr6-0005F1-T9 for qemu-devel@nongnu.org; Thu, 28 Jul 2016 08:56:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSkr2-0000aR-S5 for qemu-devel@nongnu.org; Thu, 28 Jul 2016 08:56:03 -0400 Sender: Richard Henderson References: <1469688581-30853-1-git-send-email-nikunj@linux.vnet.ibm.com> <1469688581-30853-6-git-send-email-nikunj@linux.vnet.ibm.com> From: Richard Henderson Message-ID: <93d20462-88bf-d6c4-008f-141233eb4717@twiddle.net> Date: Thu, 28 Jul 2016 18:25:52 +0530 MIME-Version: 1.0 In-Reply-To: <1469688581-30853-6-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 v1 5/8] target-ppc: add vcmpnez[b, h, w][.] instructions 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, bharata@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, benh@kernel.crashing.org, Swapnil Bokade On 07/28/2016 12:19 PM, Nikunj A Dadhania wrote: > +#define VCMPNEZ_DO(suffix, element, record) \ > +void helper_vcmpnez##suffix(CPUPPCState *env, ppc_avr_t *r, \ > + ppc_avr_t *a, ppc_avr_t *b) \ > +{ \ > + uint64_t ones = (uint64_t)-1; \ > + uint64_t all = ones; \ > + uint64_t none = 0; \ > + int i; \ > + \ > + for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ > + uint64_t result = ((a->element[i] == 0) \ > + || (b->element[i] == 0) \ > + || (a->element[i] != b->element[i]) ? \ > + ones : 0x0); \ Don't you have the proper type to use, as opposed to widening everything to uint64_t? I would guess element##_t would do the job. r~