@@ -1433,11 +1433,13 @@ static void save_link_info(DisasContext *s, DisasOps *o)
tcg_gen_shri_i64(t1, psw_mask, 16);
/* Deposit pc to replace garbage bits below program mask. */
gen_psw_addr_disp(s, t2, s->ilen);
- tcg_gen_deposit_i64(o->out, t1, t2, 0, 24);
+ tcg_gen_deposit_i64(t1, t1, t2, 0, 24);
+ /*
+ * Deposit cc to replace garbage bits above program mask.
+ * Note that cc is in [0-3], thus [63:30] are set to zero.
+ */
tcg_gen_extu_i32_i64(t2, cc_op);
- tcg_gen_shli_i64(t2, t2, 28);
- tcg_gen_or_i64(o->out, o->out, t2);
-
+ tcg_gen_deposit_i64(t1, t1, t2, 28, 64 - 28);
/* Install ilen. */
tcg_gen_ori_i64(t1, t1, (s->ilen / 2) << 30);