]> git.proxmox.com Git - mirror_qemu.git/commit
target/ppc: Zero second doubleword in DFP instructions
authorVíctor Colombo <victor.colombo@eldorado.org.br>
Tue, 6 Sep 2022 12:55:18 +0000 (09:55 -0300)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Tue, 20 Sep 2022 13:54:06 +0000 (10:54 -0300)
commit34f760bac2c9a32afae150fbcc56ceba399d61de
treeddfbbc98d6c50b6472d1b4151b9179117095e39a
parent228ab1451d2b4a731d00d4ff42c6e367afbbabdd
target/ppc: Zero second doubleword in DFP instructions

Starting at PowerISA v3.1, the second doubleword of the registers
used to store results in DFP instructions are supposed to be zeroed.

From the ISA, chapter 7.2.1.1 Floating-Point Registers:
"""
Chapter 4. Floating-Point Facility provides 32 64-bit
FPRs. Chapter 5. Decimal Floating-Point also employs
FPRs in decimal floating-point (DFP) operations. When
VSX is implemented, the 32 FPRs are mapped to
doubleword 0 of VSRs 0-31. (...)
All instructions that operate on an FPR are redefined
to operate on doubleword element 0 of the
corresponding VSR. (...)
and the contents of doubleword element 1 of the
VSR corresponding to the target FPR or FPR pair for these
instructions are set to 0.
"""

Before, the result stored at doubleword 1 was said to be undefined.

With that, this patch changes the DFP facility to zero doubleword 1
when using set_dfp64 and set_dfp128. This fixes the behavior for ISA
3.1 while keeping the behavior correct for previous ones.

Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220906125523.38765-4-victor.colombo@eldorado.org.br>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
target/ppc/dfp_helper.c