qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,
	qemu-ppc@nongnu.org, david@gibson.dropbear.id.au
Cc: qemu-devel@nongnu.org, bharata@linux.vnet.ibm.com,
	Avinesh Kumar <avinesku@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/2] target-ppc: add vextu[bhw]lx instructions
Date: Thu, 24 Nov 2016 15:42:40 +0100	[thread overview]
Message-ID: <75cc91e7-2281-701a-1a70-c5986104b2b3@twiddle.net> (raw)
In-Reply-To: <1479987164-8301-2-git-send-email-nikunj@linux.vnet.ibm.com>

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~

  reply	other threads:[~2016-11-24 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24 11:32 [Qemu-devel] [PATCH ppc-for-2.9 v2 0/2] POWER9 TCG enablements - part8 Nikunj A Dadhania
2016-11-24 11:32 ` [Qemu-devel] [PATCH v2 1/2] target-ppc: add vextu[bhw]lx instructions Nikunj A Dadhania
2016-11-24 14:42   ` Richard Henderson [this message]
2016-11-25  7:13     ` Nikunj A Dadhania
2016-11-25 11:15       ` Richard Henderson
2016-11-24 11:32 ` [Qemu-devel] [PATCH v2 2/2] target-ppc: add vextu[bhw]rx instructions Nikunj A Dadhania

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=75cc91e7-2281-701a-1a70-c5986104b2b3@twiddle.net \
    --to=rth@twiddle.net \
    --cc=avinesku@linux.vnet.ibm.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).