@@ -174,17 +174,19 @@ static void gen_psw_addr_disp(DisasContext *s, TCGv_i64 dest, int64_t disp)
static void pc_to_link_info(TCGv_i64 out, DisasContext *s)
{
- uint64_t pc = s->pc_tmp;
+ TCGv_i64 tmp;
- if (s->base.tb->flags & FLAG_MASK_32) {
- if (s->base.tb->flags & FLAG_MASK_64) {
- tcg_gen_movi_i64(out, pc);
- return;
- }
- pc |= 0x80000000;
+ if (s->base.tb->flags & FLAG_MASK_64) {
+ gen_psw_addr_disp(s, out, s->ilen);
+ return;
}
- assert(!(s->base.tb->flags & FLAG_MASK_64));
- tcg_gen_deposit_i64(out, out, tcg_constant_i64(pc), 0, 32);
+
+ tmp = tcg_temp_new_i64();
+ gen_psw_addr_disp(s, tmp, s->ilen);
+ if (s->base.tb->flags & FLAG_MASK_32) {
+ tcg_gen_ori_i64(tmp, tmp, 0x80000000);
+ }
+ tcg_gen_deposit_i64(out, out, tmp, 0, 32);
}
static TCGv_i64 psw_addr;