Fix sign extension problems with smul and umul (Vince Weaver)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5138 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
e55fd9340e
commit
b991c38519
@ -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);
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user