diff options
author | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-08-20 22:39:19 +0000 |
---|---|---|
committer | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-08-20 22:39:19 +0000 |
commit | 109719ec9e311b800470286004670aff6ddd9736 (patch) | |
tree | 030107f968abce4728181f52452e39f97b0061e4 /tcg | |
parent | 0b7c1d897f010cf9f1848fa79db7d05273dfbf20 (diff) |
Avoid clobbering input/aliased registers in !SOFTMMU+64bit+bswap case
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5033 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tcg')
-rw-r--r-- | tcg/ppc64/tcg-target.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index 0ee551f33..f79459da2 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -579,9 +579,9 @@ static void tcg_out_tlb_read (TCGContext *s, int r0, int r1, int r2, static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc) { - int addr_reg, data_reg, r0, mem_index, s_bits, bswap; + int addr_reg, data_reg, r0, r1, mem_index, s_bits, bswap; #ifdef CONFIG_SOFTMMU - int r1, r2; + int r2; void *label1_ptr, *label2_ptr; #endif @@ -653,6 +653,7 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc) tcg_out_rld (s, RLDICL, addr_reg, addr_reg, 0, 32); #endif r0 = addr_reg; + r1 = 4; #endif #ifdef TARGET_WORDS_BIGENDIAN @@ -693,11 +694,11 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc) break; case 3: if (bswap) { - tcg_out32 (s, LWBRX | RT (data_reg) | RB (r0)); - tcg_out32 (s, ADDI | RT (r0) | RA (r0) | 4); - tcg_out32 (s, LWBRX | RT (r0) | RB (r0)); - tcg_out_rld (s, RLDICR, r0, r0, 32, 31); - tcg_out32 (s, OR | SAB (r0, data_reg, data_reg)); + tcg_out32 (s, LWBRX | RT (0) | RB (r0)); + tcg_out32 (s, ADDI | RT (r1) | RA (r0) | 4); + tcg_out32 (s, LWBRX | RT (data_reg) | RB (r1)); + tcg_out_rld (s, RLDICR, data_reg, data_reg, 32, 31); + tcg_out32 (s, OR | SAB (0, data_reg, data_reg)); } else tcg_out32 (s, LD | RT (data_reg) | RA (r0)); break; @@ -788,9 +789,9 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc) case 3: if (bswap) { tcg_out32 (s, STWBRX | RS (data_reg) | RA (0) | RB (r0)); - tcg_out32 (s, ADDI | RT (r0) | RA (r0) | 4); + tcg_out32 (s, ADDI | RT (r1) | RA (r0) | 4); tcg_out_rld (s, RLDICL, 0, data_reg, 32, 0); - tcg_out32 (s, STWBRX | RS (0) | RA (0) | RB (r0)); + tcg_out32 (s, STWBRX | RS (0) | RA (0) | RB (r1)); } else tcg_out32 (s, STD | RS (data_reg) | RA (r0)); break; |