[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/19] target/ppc: Zero second doubleword of VSR registers for FP
From: |
Víctor Colombo |
Subject: |
[PATCH 07/19] target/ppc: Zero second doubleword of VSR registers for FPR insns |
Date: |
Thu, 1 Sep 2022 10:17:44 -0300 |
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>
---
target/ppc/translate.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 388337f81b..a0fa419a1f 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)
--
2.25.1
- [PATCH 02/19] target/ppc: Remove unused xer_* macros, (continued)
- [PATCH 02/19] target/ppc: Remove unused xer_* macros, Víctor Colombo, 2022/09/01
- [PATCH 03/19] target/ppc: Zero second doubleword in DFP instructions, Víctor Colombo, 2022/09/01
- [PATCH 05/19] target/ppc: Zero second doubleword for VSX madd instructions, Víctor Colombo, 2022/09/01
- [PATCH 04/19] target/ppc: Set result to QNaN for DENBCD when VXCVI occurs, Víctor Colombo, 2022/09/01
- [PATCH 06/19] target/ppc: Set OV32 when OV is set, Víctor Colombo, 2022/09/01
- [PATCH 07/19] target/ppc: Zero second doubleword of VSR registers for FPR insns,
Víctor Colombo <=
- [PATCH 08/19] target/ppc: Clear fpstatus flags on VSX_CVT_INT_TO_FP_VECTOR, Víctor Colombo, 2022/09/01
- [PATCH 09/19] target/ppc: Clear fpstatus flags on VSX_CVT_INT_TO_FP, Víctor Colombo, 2022/09/01
- [PATCH 10/19] target/ppc: Clear fpstatus flags on VSX_CVT_FP_TO_FP, Víctor Colombo, 2022/09/01
- [PATCH 11/19] target/ppc: Clear fpstatus flags on VSX_CVT_FP_TO_INT_VECTOR, Víctor Colombo, 2022/09/01
- [PATCH 13/19] target/ppc: Clear fpstatus flags on VSX_CVT_FP_TO_INT, Víctor Colombo, 2022/09/01
- [PATCH 12/19] target/ppc: Clear fpstatus flags on VSX_CVT_FP_TO_INT2, Víctor Colombo, 2022/09/01
- [PATCH 15/19] target/ppc: Clear fpstatus flags on VSX_CVT_FP_TO_FP_VECTOR, Víctor Colombo, 2022/09/01