[PATCH 0/7] target/ppc: DFP fixes and improvements

Mark Cave-Ayland posted 7 patches 4 years, 7 months ago
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test docker-clang@ubuntu passed
Test asan passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190924153556.27575-1-mark.cave-ayland@ilande.co.uk
Maintainers: David Gibson <david@gibson.dropbear.id.au>
There is a newer version of this series
target/ppc/cpu.h        |   1 +
target/ppc/dfp_helper.c | 384 ++++++++++++++++++++--------------------
target/ppc/helper.h     |   2 +-
3 files changed, 193 insertions(+), 194 deletions(-)
[PATCH 0/7] target/ppc: DFP fixes and improvements
Posted by Mark Cave-Ayland 4 years, 7 months ago
This patchset fixes the DFP issue reported at https://bugs.launchpad.net/qemu/+bug/1841990
caused by the change in FP register storage in commit ef96e3ae96 "target/ppc:
move FP and VMX registers into aligned vsr register array" along with some
further tidy-up/improvements.

Patches 1 and 2 introduce get/set helper functions for reading and writing
DFP even-odd register pairs (rather than accessing the register pointers
directly) which then leads to the real fix in patch 3.

Following on from this patches 4 to 6 change the struct PPC_DFP internal
decimal representation from uint64[2] to ppc_vsr_t which enables us to use
the existing VsrD() macro to access the correct elements regardless of host
endian and remove the explicit HI_IDX and LO_IDX references.

Finally patch 7 simplifies the calls to set_dfp{64,128}() in DFP macros
which can now be generated directly by the preprocessor rather than requiring
an explicit if() statement.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


Mark Cave-Ayland (7):
  target/ppc: introduce get_dfp{64,128}() helper functions
  target/ppc: introduce set_dfp{64,128}() helper functions
  target/ppc: update {get,set}_dfp{64,128}() helper functions to
    read/write DFP numbers correctly
  target/ppc: introduce dfp_finalize_decimal{64,128}() helper functions
  target/ppc: change struct PPC_DFP decimal storage from uint64[2] to
    ppc_vsr_t
  target/ppc: use existing VsrD() macro to eliminate HI_IDX and LO_IDX
    from dfp_helper.c
  target/ppc: remove unnecessary if() around calls to set_dfp{64,128}()
    in DFP macros

 target/ppc/cpu.h        |   1 +
 target/ppc/dfp_helper.c | 384 ++++++++++++++++++++--------------------
 target/ppc/helper.h     |   2 +-
 3 files changed, 193 insertions(+), 194 deletions(-)

-- 
2.20.1


Re: [PATCH 0/7] target/ppc: DFP fixes and improvements
Posted by Paul Clarke 4 years, 7 months ago
Mark,

What tree / branch would these patches apply to?  (I've tried qemu master, dgibson master and ppc-for-4.2, or I'm doing something wrong.)

PC

On 9/24/19 10:35 AM, Mark Cave-Ayland wrote:
> This patchset fixes the DFP issue reported at https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.launchpad.net_qemu_-2Bbug_1841990&d=DwIDAg&c=jf_iaSHvJObTbx-siA1ZOg&r=0emNUfh2Pr0wDtXKlYJSCQ&m=NtaEgUJhN3SbT5hKyyOdgnt5ArLSzDw2l22WvleDMmU&s=qIBW6IX8pu3ej_AJj-toJH8PmhrvgJaXDJgbg1tgbY8&e= 
> caused by the change in FP register storage in commit ef96e3ae96 "target/ppc:
> move FP and VMX registers into aligned vsr register array" along with some
> further tidy-up/improvements.
> 
> Patches 1 and 2 introduce get/set helper functions for reading and writing
> DFP even-odd register pairs (rather than accessing the register pointers
> directly) which then leads to the real fix in patch 3.
> 
> Following on from this patches 4 to 6 change the struct PPC_DFP internal
> decimal representation from uint64[2] to ppc_vsr_t which enables us to use
> the existing VsrD() macro to access the correct elements regardless of host
> endian and remove the explicit HI_IDX and LO_IDX references.
> 
> Finally patch 7 simplifies the calls to set_dfp{64,128}() in DFP macros
> which can now be generated directly by the preprocessor rather than requiring
> an explicit if() statement.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> 
> Mark Cave-Ayland (7):
>   target/ppc: introduce get_dfp{64,128}() helper functions
>   target/ppc: introduce set_dfp{64,128}() helper functions
>   target/ppc: update {get,set}_dfp{64,128}() helper functions to
>     read/write DFP numbers correctly
>   target/ppc: introduce dfp_finalize_decimal{64,128}() helper functions
>   target/ppc: change struct PPC_DFP decimal storage from uint64[2] to
>     ppc_vsr_t
>   target/ppc: use existing VsrD() macro to eliminate HI_IDX and LO_IDX
>     from dfp_helper.c
>   target/ppc: remove unnecessary if() around calls to set_dfp{64,128}()
>     in DFP macros
> 
>  target/ppc/cpu.h        |   1 +
>  target/ppc/dfp_helper.c | 384 ++++++++++++++++++++--------------------
>  target/ppc/helper.h     |   2 +-
>  3 files changed, 193 insertions(+), 194 deletions(-)
> 

Re: [PATCH 0/7] target/ppc: DFP fixes and improvements
Posted by Mark Cave-Ayland 4 years, 7 months ago
On 24/09/2019 17:30, Paul Clarke wrote:

> Mark,
> 
> What tree / branch would these patches apply to?  (I've tried qemu master, dgibson master and ppc-for-4.2, or I'm doing something wrong.)
> 
> PC

Hi Paul,

I've just checked my local repo and I can confirm they are based on qemu master
commit 8dc57281b8 "Merge remote-tracking branch
'remotes/cleber/tags/python-next-pull-request' into staging".


ATB,

Mark.