summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2014-03-30 22:27:35 -0700
committerRichard Henderson <rth@twiddle.net>2014-04-18 16:57:36 -0700
commit4b304cfae13e66d95de8bb67ce769881fc3a3f1b (patch)
tree725257c099c441ebb306387cc8bc7a73fafa726b
parent1194dcba22a1dbd9fb797fa087bd8f8ab0cb377e (diff)
downloadqemu-4b304cfae13e66d95de8bb67ce769881fc3a3f1b.tar.gz
qemu-4b304cfae13e66d95de8bb67ce769881fc3a3f1b.tar.bz2
qemu-4b304cfae13e66d95de8bb67ce769881fc3a3f1b.zip
tcg-sparc: Use the type parameter to tcg_target_const_match
Signed-off-by: Richard Henderson <rth@twiddle.net>
-rw-r--r--tcg/sparc/tcg-target.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c
index 73121e13cf..35089b82c9 100644
--- a/tcg/sparc/tcg-target.c
+++ b/tcg/sparc/tcg-target.c
@@ -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;