aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-21 14:49:09 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-21 14:49:09 +0000
commita7ec4229125bdaf5cdf5b553c98ceb86c02642f7 (patch)
tree80561f85d868d69b36ae46e1406e83719bacc483
parent36aa55dcd9775a2164d831d3d3e2a16977995f14 (diff)
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
-rw-r--r--target-sparc/helper.h1
-rw-r--r--target-sparc/op_helper.c5
-rw-r--r--target-sparc/translate.c36
3 files changed, 20 insertions, 22 deletions
diff --git a/target-sparc/helper.h b/target-sparc/helper.h
index adef1f292e..9320bc813d 100644
--- a/target-sparc/helper.h
+++ b/target-sparc/helper.h
@@ -44,7 +44,6 @@ DEF_HELPER(void, helper_restore, (void))
DEF_HELPER(void, helper_flush, (target_ulong addr))
DEF_HELPER(target_ulong, helper_udiv, (target_ulong a, target_ulong b))
DEF_HELPER(target_ulong, helper_sdiv, (target_ulong a, target_ulong b))
-DEF_HELPER(uint64_t, helper_pack64, (target_ulong high, target_ulong low))
DEF_HELPER(void, helper_stdf, (target_ulong addr, int mem_idx))
DEF_HELPER(void, helper_lddf, (target_ulong addr, int mem_idx))
DEF_HELPER(void, helper_ldqf, (target_ulong addr, int mem_idx))
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index 7bbe0c6f0d..cf15cd342d 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -2281,11 +2281,6 @@ target_ulong helper_sdiv(target_ulong a, target_ulong b)
}
}
-uint64_t helper_pack64(target_ulong high, target_ulong low)
-{
- return ((uint64_t)high << 32) | (uint64_t)(low & 0xffffffff);
-}
-
void helper_stdf(target_ulong addr, int mem_idx)
{
helper_check_align(addr, 7);
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index fa34d27133..be00054ae2 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -1715,13 +1715,14 @@ static inline void gen_ldda_asi(TCGv hi, TCGv addr, int insn, int rd)
static inline void gen_stda_asi(TCGv hi, TCGv addr, int insn, int rd)
{
- TCGv r_temp, r_asi, r_size;
-
- r_temp = tcg_temp_new(TCG_TYPE_TL);
- gen_movl_reg_TN(rd + 1, r_temp);
- tcg_gen_helper_1_2(helper_pack64, cpu_tmp64, hi,
- r_temp);
- tcg_temp_free(r_temp);
+ TCGv r_low, r_asi, r_size;
+
+ gen_movl_reg_TN(rd + 1, cpu_tmp0);
+ r_low = tcg_temp_new(TCG_TYPE_I32);
+ tcg_gen_trunc_tl_i32(r_low, cpu_tmp0);
+ tcg_gen_trunc_tl_i32(cpu_tmp32, hi);
+ tcg_gen_concat_i32_i64(cpu_tmp64, r_low, cpu_tmp32);
+ tcg_temp_free(r_low);
r_asi = gen_get_asi(insn, addr);
r_size = tcg_const_i32(8);
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)
static inline void gen_stda_asi(TCGv hi, TCGv addr, int insn, int rd)
{
- TCGv r_temp, r_asi, r_size;
+ TCGv r_low, r_asi, r_size;
- r_temp = tcg_temp_new(TCG_TYPE_TL);
- gen_movl_reg_TN(rd + 1, r_temp);
- tcg_gen_helper_1_2(helper_pack64, cpu_tmp64, hi, r_temp);
- tcg_temp_free(r_temp);
+ gen_movl_reg_TN(rd + 1, cpu_tmp0);
+ r_low = tcg_temp_new(TCG_TYPE_I32);
+ tcg_gen_trunc_tl_i32(r_low, cpu_tmp0);
+ tcg_gen_trunc_tl_i32(cpu_tmp32, hi);
+ tcg_gen_concat_i32_i64(cpu_tmp64, r_low, cpu_tmp32);
+ tcg_temp_free(r_low);
r_asi = tcg_const_i32(GET_FIELD(insn, 19, 26));
r_size = tcg_const_i32(8);
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)
tcg_gen_helper_0_2(helper_check_align, cpu_addr,
r_const); // XXX remove
tcg_temp_free(r_const);
- r_low = tcg_temp_new(TCG_TYPE_TL);
- gen_movl_reg_TN(rd + 1, r_low);
- tcg_gen_helper_1_2(helper_pack64, cpu_tmp64, cpu_val,
- r_low);
+ gen_movl_reg_TN(rd + 1, cpu_tmp0);
+ r_low = tcg_temp_new(TCG_TYPE_I32);
+ tcg_gen_trunc_tl_i32(r_low, cpu_tmp0);
+ tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_val);
+ tcg_gen_concat_i32_i64(cpu_tmp64, r_low, cpu_tmp32);
tcg_temp_free(r_low);
tcg_gen_qemu_st64(cpu_tmp64, cpu_addr, dc->mem_idx);
}