Commit a7ec4229125bdaf5cdf5b553c98ceb86c02642f7
1 parent
36aa55dc
Use the new concat_i32_i64 op for std and stda
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5281 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
20 additions
and
22 deletions
target-sparc/helper.h
@@ -44,7 +44,6 @@ DEF_HELPER(void, helper_restore, (void)) | @@ -44,7 +44,6 @@ DEF_HELPER(void, helper_restore, (void)) | ||
44 | DEF_HELPER(void, helper_flush, (target_ulong addr)) | 44 | DEF_HELPER(void, helper_flush, (target_ulong addr)) |
45 | DEF_HELPER(target_ulong, helper_udiv, (target_ulong a, target_ulong b)) | 45 | DEF_HELPER(target_ulong, helper_udiv, (target_ulong a, target_ulong b)) |
46 | DEF_HELPER(target_ulong, helper_sdiv, (target_ulong a, target_ulong b)) | 46 | DEF_HELPER(target_ulong, helper_sdiv, (target_ulong a, target_ulong b)) |
47 | -DEF_HELPER(uint64_t, helper_pack64, (target_ulong high, target_ulong low)) | ||
48 | DEF_HELPER(void, helper_stdf, (target_ulong addr, int mem_idx)) | 47 | DEF_HELPER(void, helper_stdf, (target_ulong addr, int mem_idx)) |
49 | DEF_HELPER(void, helper_lddf, (target_ulong addr, int mem_idx)) | 48 | DEF_HELPER(void, helper_lddf, (target_ulong addr, int mem_idx)) |
50 | DEF_HELPER(void, helper_ldqf, (target_ulong addr, int mem_idx)) | 49 | DEF_HELPER(void, helper_ldqf, (target_ulong addr, int mem_idx)) |
target-sparc/op_helper.c
@@ -2281,11 +2281,6 @@ target_ulong helper_sdiv(target_ulong a, target_ulong b) | @@ -2281,11 +2281,6 @@ target_ulong helper_sdiv(target_ulong a, target_ulong b) | ||
2281 | } | 2281 | } |
2282 | } | 2282 | } |
2283 | 2283 | ||
2284 | -uint64_t helper_pack64(target_ulong high, target_ulong low) | ||
2285 | -{ | ||
2286 | - return ((uint64_t)high << 32) | (uint64_t)(low & 0xffffffff); | ||
2287 | -} | ||
2288 | - | ||
2289 | void helper_stdf(target_ulong addr, int mem_idx) | 2284 | void helper_stdf(target_ulong addr, int mem_idx) |
2290 | { | 2285 | { |
2291 | helper_check_align(addr, 7); | 2286 | helper_check_align(addr, 7); |
target-sparc/translate.c
@@ -1715,13 +1715,14 @@ static inline void gen_ldda_asi(TCGv hi, TCGv addr, int insn, int rd) | @@ -1715,13 +1715,14 @@ static inline void gen_ldda_asi(TCGv hi, TCGv addr, int insn, int rd) | ||
1715 | 1715 | ||
1716 | static inline void gen_stda_asi(TCGv hi, TCGv addr, int insn, int rd) | 1716 | static inline void gen_stda_asi(TCGv hi, TCGv addr, int insn, int rd) |
1717 | { | 1717 | { |
1718 | - TCGv r_temp, r_asi, r_size; | ||
1719 | - | ||
1720 | - r_temp = tcg_temp_new(TCG_TYPE_TL); | ||
1721 | - gen_movl_reg_TN(rd + 1, r_temp); | ||
1722 | - tcg_gen_helper_1_2(helper_pack64, cpu_tmp64, hi, | ||
1723 | - r_temp); | ||
1724 | - tcg_temp_free(r_temp); | 1718 | + TCGv r_low, r_asi, r_size; |
1719 | + | ||
1720 | + gen_movl_reg_TN(rd + 1, cpu_tmp0); | ||
1721 | + r_low = tcg_temp_new(TCG_TYPE_I32); | ||
1722 | + tcg_gen_trunc_tl_i32(r_low, cpu_tmp0); | ||
1723 | + tcg_gen_trunc_tl_i32(cpu_tmp32, hi); | ||
1724 | + tcg_gen_concat_i32_i64(cpu_tmp64, r_low, cpu_tmp32); | ||
1725 | + tcg_temp_free(r_low); | ||
1725 | r_asi = gen_get_asi(insn, addr); | 1726 | r_asi = gen_get_asi(insn, addr); |
1726 | r_size = tcg_const_i32(8); | 1727 | r_size = tcg_const_i32(8); |
1727 | tcg_gen_helper_0_4(helper_st_asi, addr, cpu_tmp64, r_asi, r_size); | 1728 | tcg_gen_helper_0_4(helper_st_asi, addr, cpu_tmp64, r_asi, r_size); |
@@ -1817,12 +1818,14 @@ static inline void gen_ldda_asi(TCGv hi, TCGv addr, int insn, int rd) | @@ -1817,12 +1818,14 @@ static inline void gen_ldda_asi(TCGv hi, TCGv addr, int insn, int rd) | ||
1817 | 1818 | ||
1818 | static inline void gen_stda_asi(TCGv hi, TCGv addr, int insn, int rd) | 1819 | static inline void gen_stda_asi(TCGv hi, TCGv addr, int insn, int rd) |
1819 | { | 1820 | { |
1820 | - TCGv r_temp, r_asi, r_size; | 1821 | + TCGv r_low, r_asi, r_size; |
1821 | 1822 | ||
1822 | - r_temp = tcg_temp_new(TCG_TYPE_TL); | ||
1823 | - gen_movl_reg_TN(rd + 1, r_temp); | ||
1824 | - tcg_gen_helper_1_2(helper_pack64, cpu_tmp64, hi, r_temp); | ||
1825 | - tcg_temp_free(r_temp); | 1823 | + gen_movl_reg_TN(rd + 1, cpu_tmp0); |
1824 | + r_low = tcg_temp_new(TCG_TYPE_I32); | ||
1825 | + tcg_gen_trunc_tl_i32(r_low, cpu_tmp0); | ||
1826 | + tcg_gen_trunc_tl_i32(cpu_tmp32, hi); | ||
1827 | + tcg_gen_concat_i32_i64(cpu_tmp64, r_low, cpu_tmp32); | ||
1828 | + tcg_temp_free(r_low); | ||
1826 | r_asi = tcg_const_i32(GET_FIELD(insn, 19, 26)); | 1829 | r_asi = tcg_const_i32(GET_FIELD(insn, 19, 26)); |
1827 | r_size = tcg_const_i32(8); | 1830 | r_size = tcg_const_i32(8); |
1828 | tcg_gen_helper_0_4(helper_st_asi, addr, cpu_tmp64, r_asi, r_size); | 1831 | tcg_gen_helper_0_4(helper_st_asi, addr, cpu_tmp64, r_asi, r_size); |
@@ -4482,10 +4485,11 @@ static void disas_sparc_insn(DisasContext * dc) | @@ -4482,10 +4485,11 @@ static void disas_sparc_insn(DisasContext * dc) | ||
4482 | tcg_gen_helper_0_2(helper_check_align, cpu_addr, | 4485 | tcg_gen_helper_0_2(helper_check_align, cpu_addr, |
4483 | r_const); // XXX remove | 4486 | r_const); // XXX remove |
4484 | tcg_temp_free(r_const); | 4487 | tcg_temp_free(r_const); |
4485 | - r_low = tcg_temp_new(TCG_TYPE_TL); | ||
4486 | - gen_movl_reg_TN(rd + 1, r_low); | ||
4487 | - tcg_gen_helper_1_2(helper_pack64, cpu_tmp64, cpu_val, | ||
4488 | - r_low); | 4488 | + gen_movl_reg_TN(rd + 1, cpu_tmp0); |
4489 | + r_low = tcg_temp_new(TCG_TYPE_I32); | ||
4490 | + tcg_gen_trunc_tl_i32(r_low, cpu_tmp0); | ||
4491 | + tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_val); | ||
4492 | + tcg_gen_concat_i32_i64(cpu_tmp64, r_low, cpu_tmp32); | ||
4489 | tcg_temp_free(r_low); | 4493 | tcg_temp_free(r_low); |
4490 | tcg_gen_qemu_st64(cpu_tmp64, cpu_addr, dc->mem_idx); | 4494 | tcg_gen_qemu_st64(cpu_tmp64, cpu_addr, dc->mem_idx); |
4491 | } | 4495 | } |