diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-11-29 21:11:00 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-01-14 17:13:53 +0100 |
commit | e2665f314d80d7edbfe7f8275abed7e2c93c0ddc (patch) | |
tree | 4c168d98ec4ab942c01ab2b3edfaa90c8970198f /target/mips | |
parent | 7e2a619a0436a959fe2795cce829d1cc89448a43 (diff) | |
download | qemu-e2665f314d80d7edbfe7f8275abed7e2c93c0ddc.zip qemu-e2665f314d80d7edbfe7f8275abed7e2c93c0ddc.tar.gz qemu-e2665f314d80d7edbfe7f8275abed7e2c93c0ddc.tar.bz2 |
target/mips: Alias MSA vector registers on FPU scalar registers
Commits 863f264d10f ("add msa_reset(), global msa register") and
cb269f273fd ("fix multiple TCG registers covering same data")
removed the FPU scalar registers and replaced them by aliases to
the MSA vector registers.
It is not very clear to have FPU registers displayed with MSA
register names, even if MSA ASE is not present.
Instead of aliasing FPU registers to the MSA ones (even when MSA
is absent), we now alias the MSA ones to the FPU ones (only when
MSA is present).
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Message-Id: <20201208003702.4088927-7-f4bug@amsat.org>
Diffstat (limited to 'target/mips')
-rw-r--r-- | target/mips/translate.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/target/mips/translate.c b/target/mips/translate.c index 9a0dcde..f1d4256 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -31562,16 +31562,20 @@ void mips_tcg_init(void) offsetof(CPUMIPSState, active_tc.gpr[i]), regnames[i]); + for (i = 0; i < 32; i++) { + int off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[0]); + fpu_f64[i] = tcg_global_mem_new_i64(cpu_env, off, fregnames[i]); + } + /* MSA */ for (i = 0; i < 32; i++) { int off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[0]); - msa_wr_d[i * 2] = - tcg_global_mem_new_i64(cpu_env, off, msaregnames[i * 2]); + /* - * The scalar floating-point unit (FPU) registers are mapped on - * the MSA vector registers. + * The MSA vector registers are mapped on the + * scalar floating-point unit (FPU) registers. */ - fpu_f64[i] = msa_wr_d[i * 2]; + msa_wr_d[i * 2] = fpu_f64[i]; off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[1]); msa_wr_d[i * 2 + 1] = tcg_global_mem_new_i64(cpu_env, off, msaregnames[i * 2 + 1]); |