All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Richard Henderson <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org, pc@us.ibm.com,
	david@gibson.dropbear.id.au
Subject: Re: [PATCH 6/7] target/ppc: use existing VsrD() macro to eliminate HI_IDX and LO_IDX from dfp_helper.c
Date: Wed, 25 Sep 2019 21:37:32 +0100	[thread overview]
Message-ID: <9b4860e8-917c-bb0e-4b0e-931f23102584@ilande.co.uk> (raw)
In-Reply-To: <8a6dcdda-97b6-16f6-a95b-0c53d1e2d215@linaro.org>

On 24/09/2019 22:46, Richard Henderson wrote:

> On 9/24/19 8:35 AM, Mark Cave-Ayland wrote:
>> Switch over all accesses to the decimal numbers held in struct PPC_DFP from
>> using HI_IDX and LO_IDX to using the VsrD() macro instead. Not only does this
>> allow the compiler to ensure that the various dfp_* functions are being passed
>> a ppc_vsr_t rather than an arbitrary uint64_t pointer, but also allows the
>> host endian-specific HI_IDX and LO_IDX to be completely removed from
>> dfp_helper.c.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> ---
>>  target/ppc/dfp_helper.c | 70 ++++++++++++++++++-----------------------
>>  1 file changed, 31 insertions(+), 39 deletions(-)
> 
> Ho hum, vs patch 5 that was me not realizing how many different places really
> want to manipulate a 128-bit value.  Do go ahead and keep ppc_vsr_t for now.

Yes, it's a little bit confusing in places as some operations are done on the
decNumber whilst others are done on the decimal representation. After trying a few
different approaches, using ppc_vsr_t seemed to be the easiest and most readable
solution here.

I see now that you've given R-b tags for patches 3-7, and having slept on it I'm
inclined to leave patches 1-2 as they are now, i.e. no code changes other than
introducing the get/set helpers to help keep the patchset as mechanical as possible.
Do you think that seems a reasonable approach?

> It does look like we might be well served by using Int128 at some point, so
> that these operations can expand to int128_t on appropriate hw so that the
> compiler can DTRT with these.

Certainly ppc_vsr_t already has __uint128_t and Int128 elements but the impression I
got from the #ifdef is that not all compilers would support it? Although having said
that, making such a change is not something that's really on my radar.


ATB,

Mark.


  reply	other threads:[~2019-09-25 20:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24 15:35 [PATCH 0/7] target/ppc: DFP fixes and improvements Mark Cave-Ayland
2019-09-24 15:35 ` [PATCH 1/7] target/ppc: introduce get_dfp{64,128}() helper functions Mark Cave-Ayland
2019-09-24 19:21   ` Richard Henderson
2019-09-24 21:05     ` Mark Cave-Ayland
2019-09-24 21:29       ` Richard Henderson
2019-09-24 15:35 ` [PATCH 2/7] target/ppc: introduce set_dfp{64,128}() " Mark Cave-Ayland
2019-09-24 21:27   ` Richard Henderson
2019-09-24 15:35 ` [PATCH 3/7] target/ppc: update {get, set}_dfp{64, 128}() helper functions to read/write DFP numbers correctly Mark Cave-Ayland
2019-09-24 21:33   ` Richard Henderson
2019-09-24 15:35 ` [PATCH 4/7] target/ppc: introduce dfp_finalize_decimal{64, 128}() helper functions Mark Cave-Ayland
2019-09-24 21:47   ` Richard Henderson
2019-09-24 15:35 ` [PATCH 5/7] target/ppc: change struct PPC_DFP decimal storage from uint64[2] to ppc_vsr_t Mark Cave-Ayland
2019-09-24 21:41   ` Richard Henderson
2019-09-24 21:46   ` Richard Henderson
2019-09-24 15:35 ` [PATCH 6/7] target/ppc: use existing VsrD() macro to eliminate HI_IDX and LO_IDX from dfp_helper.c Mark Cave-Ayland
2019-09-24 21:44   ` Mark Cave-Ayland
2019-09-24 21:46   ` Richard Henderson
2019-09-25 20:37     ` Mark Cave-Ayland [this message]
2019-09-26 17:28       ` Richard Henderson
2019-09-24 15:35 ` [PATCH 7/7] target/ppc: remove unnecessary if() around calls to set_dfp{64, 128}() in DFP macros Mark Cave-Ayland
2019-09-24 21:47   ` Richard Henderson
2019-09-24 16:30 ` [PATCH 0/7] target/ppc: DFP fixes and improvements Paul Clarke
2019-09-24 16:37   ` Mark Cave-Ayland

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=9b4860e8-917c-bb0e-4b0e-931f23102584@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=david@gibson.dropbear.id.au \
    --cc=pc@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.