Received: from eggs.gnu.org ([2001:4830:134:3::10]:35577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9vEi-0001j4-9m for qemu-devel@nongnu.org; Thu, 24 Nov 2016 09:42:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9vEf-0002VD-55 for qemu-devel@nongnu.org; Thu, 24 Nov 2016 09:42:52 -0500 Sender: Richard Henderson References: <1479987164-8301-1-git-send-email-nikunj@linux.vnet.ibm.com> <1479987164-8301-2-git-send-email-nikunj@linux.vnet.ibm.com> From: Richard Henderson Message-ID: <75cc91e7-2281-701a-1a70-c5986104b2b3@twiddle.net> Date: Thu, 24 Nov 2016 15:42:40 +0100 MIME-Version: 1.0 In-Reply-To: <1479987164-8301-2-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 v2 1/2] target-ppc: add vextu[bhw]lx 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, Avinesh Kumar On 11/24/2016 12:32 PM, Nikunj A Dadhania wrote: > +#if defined(HOST_WORDS_BIGENDIAN) > +# if defined(CONFIG_INT128) > +# define VEXTULX_DO(name, size) \ > + target_ulong glue(helper_, name)(target_ulong a, ppc_avr_t *b) \ > + { \ > + int index = (a & 0xf) * 8; \ > + return int128_rshift(b->u128, index) & \ > + MAKE_64BIT_MASK(0, size); \ > + } > +# else > +# define VEXTULX_DO(name, size) \ > + target_ulong glue(helper_, name)(target_ulong a, ppc_avr_t *b) \ > + { \ > + int index = (a & 0xf) * 8; \ > + Int128 value = int128_make128(b->u64[LO_IDX], \ > + b->u64[HI_IDX]); \ > + return int128_rshift(value, index) & \ > + MAKE_64BIT_MASK(0, size); \ > + } > +# endif Why are these duplicated? Clearly the missed trick is that you should *never* check CONFIG_INT128 and always rely on Int128. r~