mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 09:55:55 +00:00
Avoid clobbering input register in qemu_ld64+bswap+useronly case
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5287 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
3018f2598c
commit
f8edcbaa2d
|
@ -474,9 +474,9 @@ static void *qemu_st_helpers[4] = {
|
|||
|
||||
static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc)
|
||||
{
|
||||
int addr_reg, data_reg, data_reg2, r0, mem_index, s_bits, bswap;
|
||||
int addr_reg, data_reg, data_reg2, r0, r1, mem_index, s_bits, bswap;
|
||||
#ifdef CONFIG_SOFTMMU
|
||||
int r1, r2;
|
||||
int r2;
|
||||
void *label1_ptr, *label2_ptr;
|
||||
#endif
|
||||
#if TARGET_LONG_BITS == 64
|
||||
|
@ -599,6 +599,7 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc)
|
|||
|
||||
#else /* !CONFIG_SOFTMMU */
|
||||
r0 = addr_reg;
|
||||
r1 = 3;
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_WORDS_BIGENDIAN
|
||||
|
@ -632,17 +633,9 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc)
|
|||
break;
|
||||
case 3:
|
||||
if (bswap) {
|
||||
if (r0 == data_reg) {
|
||||
tcg_out32 (s, LWBRX | RT (0) | RB (r0));
|
||||
tcg_out32 (s, ADDI | RT (r0) | RA (r0) | 4);
|
||||
tcg_out32 (s, LWBRX | RT (data_reg2) | RB (r0));
|
||||
tcg_out_mov (s, data_reg, 0);
|
||||
}
|
||||
else {
|
||||
tcg_out32 (s, LWBRX | RT (data_reg) | RB (r0));
|
||||
tcg_out32 (s, ADDI | RT (r0) | RA (r0) | 4);
|
||||
tcg_out32 (s, LWBRX | RT (data_reg2) | RB (r0));
|
||||
}
|
||||
tcg_out32 (s, ADDI | RT (r1) | RA (r0) | 4);
|
||||
tcg_out32 (s, LWBRX | RT (data_reg) | RB (r0));
|
||||
tcg_out32 (s, LWBRX | RT (data_reg2) | RB (r1));
|
||||
}
|
||||
else {
|
||||
if (r0 == data_reg2) {
|
||||
|
|
Loading…
Reference in a new issue