[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 06/32] Add VSR to Global Registers
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PULL 06/32] Add VSR to Global Registers |
Date: |
Fri, 20 Dec 2013 02:00:28 +0100 |
From: Tom Musta <address@hidden>
This patch adds VSX VSRs to the the list of global register indices.
More specifically, it adds the lower halves of the first 32 VSRs to
the list of global register indices. The upper halves of the first
32 VSRs are already defined via cpu_fpr[]. And the second 32 VSRs
are already defined via the cpu_avrh[] and cpu_avrl[] arrays.
Signed-off-by: Tom Musta <address@hidden>
Signed-off-by: Anton Blanchard <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
target-ppc/translate.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index de2c764..269fdad 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -51,6 +51,7 @@ static char cpu_reg_names[10*3 + 22*4 /* GPR */
#endif
+ 10*4 + 22*5 /* FPR */
+ 2*(10*6 + 22*7) /* AVRh, AVRl */
+ + 10*5 + 22*6 /* VSR */
+ 8*5 /* CRF */];
static TCGv cpu_gpr[32];
#if !defined(TARGET_PPC64)
@@ -58,6 +59,7 @@ static TCGv cpu_gprh[32];
#endif
static TCGv_i64 cpu_fpr[32];
static TCGv_i64 cpu_avrh[32], cpu_avrl[32];
+static TCGv_i64 cpu_vsr[32];
static TCGv_i32 cpu_crf[8];
static TCGv cpu_nip;
static TCGv cpu_msr;
@@ -137,6 +139,11 @@ void ppc_translate_init(void)
#endif
p += (i < 10) ? 6 : 7;
cpu_reg_names_size -= (i < 10) ? 6 : 7;
+ snprintf(p, cpu_reg_names_size, "vsr%d", i);
+ cpu_vsr[i] = tcg_global_mem_new_i64(TCG_AREG0,
+ offsetof(CPUPPCState, vsr[i]), p);
+ p += (i < 10) ? 5 : 6;
+ cpu_reg_names_size -= (i < 10) ? 5 : 6;
}
cpu_nip = tcg_global_mem_new(TCG_AREG0,
@@ -6976,6 +6983,26 @@ GEN_VAFORM_PAIRED(vmsumshm, vmsumshs, 20)
GEN_VAFORM_PAIRED(vsel, vperm, 21)
GEN_VAFORM_PAIRED(vmaddfp, vnmsubfp, 23)
+/*** VSX extension ***/
+
+static inline TCGv_i64 cpu_vsrh(int n)
+{
+ if (n < 32) {
+ return cpu_fpr[n];
+ } else {
+ return cpu_avrh[n-32];
+ }
+}
+
+static inline TCGv_i64 cpu_vsrl(int n)
+{
+ if (n < 32) {
+ return cpu_vsr[n];
+ } else {
+ return cpu_avrl[n-32];
+ }
+}
+
/*** SPE extension ***/
/* Register moves */
--
1.8.1.4
- [Qemu-ppc] [PULL 00/32] ppc patch queue 2013-12-20, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 04/32] Add MSR VSX and Associated Exception, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 02/32] powerpc: add PVR mask support, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 07/32] Add lxvd2x, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 08/32] Add stxvd2x, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 06/32] Add VSR to Global Registers,
Alexander Graf <=
- [Qemu-ppc] [PULL 05/32] Add VSX Instruction Decoders, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 03/32] Declare and Enable VSX, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 11/32] Add lxvdsx, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 01/32] target-ppc: add stubs for KVM breakpoints, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 14/32] Add stxvw4x, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 24/32] Add xxmrgh/xxmrgl, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 10/32] Add lxsdx, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 09/32] Add xxpermdi, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 13/32] Add stxsdx, Alexander Graf, 2013/12/19
- [Qemu-ppc] [PULL 12/32] Add lxvw4x, Alexander Graf, 2013/12/19