Skip to content

Commit

Permalink
Fix sign extension problems with smul and umul (Vince Weaver)
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5138 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
blueswir1 committed Sep 2, 2008
1 parent e55fd93 commit b991c38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions target-sparc/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,8 @@ static inline void gen_op_umul(TCGv dst, TCGv src1, TCGv src2)
r_temp = tcg_temp_new(TCG_TYPE_I64);
r_temp2 = tcg_temp_new(TCG_TYPE_I64);

tcg_gen_extu_tl_i64(r_temp, src2);
tcg_gen_extu_tl_i64(r_temp2, src1);
tcg_gen_extu_i32_i64(r_temp, src2);
tcg_gen_extu_i32_i64(r_temp2, src1);
tcg_gen_mul_i64(r_temp2, r_temp, r_temp2);

tcg_gen_shri_i64(r_temp, r_temp2, 32);
Expand All @@ -793,8 +793,8 @@ static inline void gen_op_smul(TCGv dst, TCGv src1, TCGv src2)
r_temp = tcg_temp_new(TCG_TYPE_I64);
r_temp2 = tcg_temp_new(TCG_TYPE_I64);

tcg_gen_ext_tl_i64(r_temp, src2);
tcg_gen_ext_tl_i64(r_temp2, src1);
tcg_gen_ext_i32_i64(r_temp, src2);
tcg_gen_ext_i32_i64(r_temp2, src1);
tcg_gen_mul_i64(r_temp2, r_temp, r_temp2);

tcg_gen_shri_i64(r_temp, r_temp2, 32);
Expand Down

0 comments on commit b991c38

Please sign in to comment.