qemu-patch-raspberry4/target
Paul A. Clarke e6f1bfb211 ppc: conform to processor User's Manual for xscvdpspn
The POWER8 and POWER9 User's Manuals specify the implementation
behavior for what the ISA leaves "undefined" behavior for the
xscvdpspn and xscvdpsp instructions.  This patch corrects the QEMU
implementation to match the hardware implementation for that case.

ISA 3.0B has xscvdpspn leaving its result in word 0 of the target register,
with the other words of the target register left "undefined".

The User's Manuals specify:
  VSX scalar convert from double-precision to single-precision (xscvdpsp,
  xscvdpspn).
  VSR[32:63] is set to VSR[0:31].
So, words 0 and 1 both contain the result.

Note: this is important because GCC as of version 8 or so, assumes and takes
advantage of this behavior to optimize the following sequence:
  xscvdpspn vs0,vs1
  mffprwz   r8,f0
ISA 3.0B has xscvdpspn leaving its result in word 0 of the target register,
and mffprwz expecting its input to come from word 1 of the source register.
This sequence fails with QEMU, as a shift is required between those two
instructions.  However, since the hardware splats the result to both words 0
and 1 of its output register, the shift is not necessary.

Expect a future revision of the ISA to specify this behavior.

Signed-off-by: Paul A. Clarke <pc@us.ibm.com>

v2
- Splitting patch "ppc: Three floating point fixes"; this is just one part.
- Updated commit message to clarify behavior is documented in User's Manuals.
- Updated commit message to correct which words are in output and source of
  xscvdpspn and mffprz.
- No source changes to this part of the original patch.

Message-Id: <1566236601-22954-1-git-send-email-pc@us.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-08-21 17:17:39 +10:00
..
alpha targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
arm target-arm queue: 2019-08-16 17:21:40 +01:00
cris Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
hppa sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
i386 sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
lm32 sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
m68k target/m68k: replace LIT64 with UINT64_C macros 2019-08-19 12:07:13 +01:00
microblaze targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
mips target/mips: Style improvements in translate.c 2019-08-19 19:53:37 +02:00
moxie Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
nios2 Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
openrisc Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
ppc ppc: conform to processor User's Manual for xscvdpspn 2019-08-21 17:17:39 +10:00
riscv Implement parameter fields. 2019-08-19 16:55:30 +01:00
s390x targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
sh4 targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
sparc sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
tilegx Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
tricore targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
unicore32 targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
xtensa Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00