tcg-sparc: Use the type parameter to tcg_target_const_match
authorRichard Henderson <rth@twiddle.net>
Mon, 31 Mar 2014 05:27:35 +0000 (22:27 -0700)
committerRichard Henderson <rth@twiddle.net>
Fri, 18 Apr 2014 23:57:36 +0000 (16:57 -0700)
Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg/sparc/tcg-target.c

index 73121e13cfc439ec8cb8230f38b8ec418bf9134f..35089b82c9d305b8cf5e4f6da63c2fc66c8f0ac8 100644 (file)
@@ -334,7 +334,13 @@ static inline int tcg_target_const_match(tcg_target_long val, TCGType type,
 
     if (ct & TCG_CT_CONST) {
         return 1;
-    } else if ((ct & TCG_CT_CONST_ZERO) && val == 0) {
+    }
+
+    if (type == TCG_TYPE_I32) {
+        val = (int32_t)val;
+    }
+
+    if ((ct & TCG_CT_CONST_ZERO) && val == 0) {
         return 1;
     } else if ((ct & TCG_CT_CONST_S11) && check_fit_tl(val, 11)) {
         return 1;