Commit 419bafa517f777d56f851efce55a9d2328a657bc

Authored by aurel32
1 parent 506bfcbb

tcg-arm: fix qemu_ld64

Emulating fldl on arm doesn't seem to work too well. It's the way
qemu_ld64 is translated to arm instructions.

        tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
        tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);

Consider case where data_reg==0, data_reg2==1, and addr_reg==0. First load
overwrited addr_reg. So let's put an if (data_ref==addr_reg).

(Pablo Virolainen)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6808 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 7 additions and 2 deletions
tcg/arm/tcg-target.c
... ... @@ -1011,8 +1011,13 @@ static inline void tcg_out_qemu_ld(TCGContext *s, int cond,
1011 1011 case 3:
1012 1012 /* TODO: use block load -
1013 1013 * check that data_reg2 > data_reg or the other way */
1014   - tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
1015   - tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
  1014 + if (data_reg == addr_reg) {
  1015 + tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
  1016 + tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
  1017 + } else {
  1018 + tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0);
  1019 + tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4);
  1020 + }
1016 1021 break;
1017 1022 }
1018 1023 #endif
... ...