summaryrefslogtreecommitdiffstats
path: root/tcg/ppc64
diff options
context:
space:
mode:
authorRichard Henderson2014-03-31 07:07:27 +0200
committerRichard Henderson2014-04-19 01:57:36 +0200
commit1194dcba22a1dbd9fb797fa087bd8f8ab0cb377e (patch)
treecbb3721320a39695d7234ad311f38b759548f760 /tcg/ppc64
parenttcg-aarch64: Remove w constraint (diff)
downloadqemu-1194dcba22a1dbd9fb797fa087bd8f8ab0cb377e.tar.gz
qemu-1194dcba22a1dbd9fb797fa087bd8f8ab0cb377e.tar.xz
qemu-1194dcba22a1dbd9fb797fa087bd8f8ab0cb377e.zip
tcg-ppc64: Use the type parameter to tcg_target_const_match
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg/ppc64')
-rw-r--r--tcg/ppc64/tcg-target.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
index a533698aa4..45b1c06910 100644
--- a/tcg/ppc64/tcg-target.c
+++ b/tcg/ppc64/tcg-target.c
@@ -296,7 +296,15 @@ static int tcg_target_const_match(tcg_target_long val, TCGType type,
int ct = arg_ct->ct;
if (ct & TCG_CT_CONST) {
return 1;
- } else if ((ct & TCG_CT_CONST_S16) && val == (int16_t)val) {
+ }
+
+ /* The only 32-bit constraint we use aside from
+ TCG_CT_CONST is TCG_CT_CONST_S16. */
+ if (type == TCG_TYPE_I32) {
+ val = (int32_t)val;
+ }
+
+ if ((ct & TCG_CT_CONST_S16) && val == (int16_t)val) {
return 1;
} else if ((ct & TCG_CT_CONST_U16) && val == (uint16_t)val) {
return 1;