Skip to contentSkip to conversation

[5138] Fix sign extension problems with smul and umul (Vince Weaver)

Qemu-devel Blue Swirl 1 participant 1 message Sep 2, 2008

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

Revision: 5138

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5138
Author:   blueswir1
Date:     2008-09-02 16:33:23 +0000 (Tue, 02 Sep 2008)

Log Message:
-----------
Fix sign extension problems with smul and umul (Vince Weaver)

Modified Paths:
--------------
trunk/target-sparc/translate.c

Modified: trunk/target-sparc/translate.c
===================================================================

target-sparc/translate.c +4 -4
@@ -769,8 +769,8 @@
     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 @@
     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);