aboutsummaryrefslogtreecommitdiff
path: root/target-s390x/helper.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2012-09-24 12:06:15 -0700
committerRichard Henderson <rth@twiddle.net>2013-01-05 12:00:27 -0800
commit51855ecf1a9d5a8388778571b8ab32134e83f378 (patch)
tree4051cc2789b484a534b55f055a84ffe90f201d73 /target-s390x/helper.c
parent2f22e2ec79c07de03016adefb166cf01745fc852 (diff)
target-s390: Fix PSW_MASK handling
We were treating psw.mask as the 32-bit quantity it is in ESA mode. In particular, the CC field was at the wrong place. Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-s390x/helper.c')
-rw-r--r--target-s390x/helper.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index 42e06eb85e..7dc4d46eac 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -454,18 +454,19 @@ void load_psw(CPUS390XState *env, uint64_t mask, uint64_t addr)
env->psw.addr = addr;
env->psw.mask = mask;
- env->cc_op = (mask >> 13) & 3;
+ env->cc_op = (mask >> 44) & 3;
}
static uint64_t get_psw_mask(CPUS390XState *env)
{
- uint64_t r = env->psw.mask;
+ uint64_t r;
env->cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst, env->cc_vr);
- r &= ~(3ULL << 13);
+ r = env->psw.mask;
+ r &= ~PSW_MASK_CC;
assert(!(env->cc_op & ~3));
- r |= env->cc_op << 13;
+ r |= (uint64_t)env->cc_op << 44;
return r;
}