mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
target/arm: Add aa{32, 64}_vfp_{dreg, qreg} helpers
Helpers that return a pointer into env->vfp.regs so that we isolate the logic of how to index the regs array for different cpu modes. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20180119045438.28582-7-richard.henderson@linaro.org Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
3f68b8a5a6
commit
9a2b5256ea
9 changed files with 96 additions and 74 deletions
|
@ -1515,14 +1515,16 @@ static inline void gen_vfp_st(DisasContext *s, int dp, TCGv_i32 addr)
|
|||
static inline long
|
||||
vfp_reg_offset (int dp, int reg)
|
||||
{
|
||||
if (dp)
|
||||
if (dp) {
|
||||
return offsetof(CPUARMState, vfp.regs[reg]);
|
||||
else if (reg & 1) {
|
||||
return offsetof(CPUARMState, vfp.regs[reg >> 1])
|
||||
+ offsetof(CPU_DoubleU, l.upper);
|
||||
} else {
|
||||
return offsetof(CPUARMState, vfp.regs[reg >> 1])
|
||||
+ offsetof(CPU_DoubleU, l.lower);
|
||||
long ofs = offsetof(CPUARMState, vfp.regs[reg >> 1]);
|
||||
if (reg & 1) {
|
||||
ofs += offsetof(CPU_DoubleU, l.upper);
|
||||
} else {
|
||||
ofs += offsetof(CPU_DoubleU, l.lower);
|
||||
}
|
||||
return ofs;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12572,7 +12574,7 @@ void arm_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
|
|||
numvfpregs += 16;
|
||||
}
|
||||
for (i = 0; i < numvfpregs; i++) {
|
||||
uint64_t v = env->vfp.regs[i];
|
||||
uint64_t v = *aa32_vfp_dreg(env, i);
|
||||
cpu_fprintf(f, "s%02d=%08x s%02d=%08x d%02d=%016" PRIx64 "\n",
|
||||
i * 2, (uint32_t)v,
|
||||
i * 2 + 1, (uint32_t)(v >> 32),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue