target-sparc: fix Nucleus quad LDD 128 bit access for windowed registers

Fix register offset calculation when regwptr is used.

Backports commit 01a780d51a3a0851729e1747f3787a0db4d96722 from qemu
This commit is contained in:
Artyom Tarasenko 2018-02-23 13:39:12 -05:00 committed by Lioncash
parent 7dcdae9807
commit 34472bd6fd
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -2064,11 +2064,11 @@ void helper_ldda_asi(CPUSPARCState *env, target_ulong addr, int asi, int rd)
bswap64s(&env->gregs[rd + 1]);
}
} else {
env->regwptr[rd] = cpu_ldq_nucleus(env, addr);
env->regwptr[rd + 1] = cpu_ldq_nucleus(env, addr + 8);
env->regwptr[rd - 8] = cpu_ldq_nucleus(env, addr);
env->regwptr[rd + 1 - 8] = cpu_ldq_nucleus(env, addr + 8);
if (asi == 0x2c) {
bswap64s(&env->regwptr[rd]);
bswap64s(&env->regwptr[rd + 1]);
bswap64s(&env->regwptr[rd - 8]);
bswap64s(&env->regwptr[rd + 1 - 8]);
}
}
break;
@ -2081,8 +2081,8 @@ void helper_ldda_asi(CPUSPARCState *env, target_ulong addr, int asi, int rd)
env->gregs[rd] = helper_ld_asi(env, addr, asi, 4, 0);
env->gregs[rd + 1] = helper_ld_asi(env, addr + 4, asi, 4, 0);
} else {
env->regwptr[rd] = helper_ld_asi(env, addr, asi, 4, 0);
env->regwptr[rd + 1] = helper_ld_asi(env, addr + 4, asi, 4, 0);
env->regwptr[rd - 8] = helper_ld_asi(env, addr, asi, 4, 0);
env->regwptr[rd + 1 - 8] = helper_ld_asi(env, addr + 4, asi, 4, 0);
}
break;
}