diff options
author | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-22 01:08:08 +0000 |
---|---|---|
committer | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-22 01:08:08 +0000 |
commit | f8edcbaa2dc25fb5ff6ad0c384d9c9cbea1b3015 (patch) | |
tree | 3ed77b1f2344f3d9c9cbbdee9f1d7a2a9f66ea6b /tcg | |
parent | 3018f2598c047e13b4479a47f55bfa7618e17381 (diff) | |
download | qemu-f8edcbaa2dc25fb5ff6ad0c384d9c9cbea1b3015.zip |
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
Diffstat (limited to 'tcg')
-rw-r--r-- | tcg/ppc/tcg-target.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c index ad174681f3..c5b4c18d45 100644 --- a/tcg/ppc/tcg-target.c +++ b/tcg/ppc/tcg-target.c @@ -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) { |