summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorVíctor Colombo2022-09-06 14:55:22 +0200
committerDaniel Henrique Barboza2022-09-20 15:54:06 +0200
commit4b65b6e76977895fe43eb340c54b552fd16fe1ce (patch)
tree98926f490498cc53f582359b17b153880f6e11c4 /target
parenttarget/ppc: Set OV32 when OV is set (diff)
downloadqemu-4b65b6e76977895fe43eb340c54b552fd16fe1ce.tar.gz
qemu-4b65b6e76977895fe43eb340c54b552fd16fe1ce.tar.xz
qemu-4b65b6e76977895fe43eb340c54b552fd16fe1ce.zip
target/ppc: Zero second doubleword of VSR registers for FPR insns
FPR register are mapped to the first doubleword of the VSR registers. Since PowerISA v3.1, the second doubleword of the target register must be zeroed for FP instructions. This patch does it by writting 0 to the second dw everytime the first dw is being written using set_fpr. Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Message-Id: <20220906125523.38765-8-victor.colombo@eldorado.org.br> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Diffstat (limited to 'target')
-rw-r--r--target/ppc/translate.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 29939bd923..e810842925 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -6443,6 +6443,14 @@ static inline void get_fpr(TCGv_i64 dst, int regno)
static inline void set_fpr(int regno, TCGv_i64 src)
{
tcg_gen_st_i64(src, cpu_env, fpr_offset(regno));
+ /*
+ * Before PowerISA v3.1 the result of doubleword 1 of the VSR
+ * corresponding to the target FPR was undefined. However,
+ * most (if not all) real hardware were setting the result to 0.
+ * Starting at ISA v3.1, the result for doubleword 1 is now defined
+ * to be 0.
+ */
+ tcg_gen_st_i64(tcg_constant_i64(0), cpu_env, vsr64_offset(regno, false));
}
static inline void get_avr64(TCGv_i64 dst, int regno, bool high)