target/ppc: update {get,set}_dfp{64,128}() helper functions to read/write DFP numbers...
commitd9acba3130314e2e4239d39a99eeca147c255584
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Thu, 26 Sep 2019 18:57:57 +0000 (26 19:57 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 4 Oct 2019 09:08:21 +0000 (4 19:08 +1000)
tree33e6bb2fd78a231e4cc7e2d19521cf5930595825
parent33432d7737b53c92791f90ece5dbe3b7bb1c79f5
target/ppc: update {get,set}_dfp{64,128}() helper functions to read/write DFP numbers correctly

Since commit ef96e3ae96 "target/ppc: move FP and VMX registers into aligned vsr
register array" FP registers are no longer stored consecutively in memory and so
the current method of combining FP register pairs into DFP numbers is incorrect.

Firstly update the definition of the dh_*_fprp defines in helper.h to reflect
that FP registers are now stored as part of an array of ppc_vsr_t elements
rather than plain uint64_t elements, and then introduce a new ppc_fprp_t type
which conceptually represents a DFP even-odd register pair to be consumed by the
DFP helper functions.

Finally update the new DFP {get,set}_dfp{64,128}() helper functions to convert
between DFP numbers and DFP even-odd register pairs correctly, making use of the
existing VsrD() macro to access the correct elements regardless of host endian.

Fixes: ef96e3ae96 "target/ppc: move FP and VMX registers into aligned vsr register array"
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190926185801.11176-4-mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target/ppc/cpu.h
target/ppc/dfp_helper.c
target/ppc/helper.h