summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorSven Schnelle2019-03-11 20:15:58 +0100
committerRichard Henderson2019-03-12 17:13:43 +0100
commit6e5f530025116b0c8c41e1a775d4b1ec87e4bd73 (patch)
tree57621a543ed582644b85a74080e0465f3db6c822 /target
parenttarget/hppa: ignore DIAG opcode (diff)
downloadqemu-6e5f530025116b0c8c41e1a775d4b1ec87e4bd73.tar.gz
qemu-6e5f530025116b0c8c41e1a775d4b1ec87e4bd73.tar.xz
qemu-6e5f530025116b0c8c41e1a775d4b1ec87e4bd73.zip
target/hppa: fix b,gate instruction
b,gate does GR[t] ← cat(GR[t]{0..29},IAOQ_Front{30..31}); instead of saving the link address to register t. Signed-off-by: Sven Schnelle <svens@stackframe.org> Message-Id: <20190311191602.25796-8-svens@stackframe.org> [rth: Move link check outside of ifndef CONFIG_USER_ONLY; use ctx->privilege; nullify the insn earlier.] Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/hppa/translate.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index f3e78b8e22..6ac196804b 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -3446,6 +3446,8 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a)
{
target_ureg dest = iaoq_dest(ctx, a->disp);
+ nullify_over(ctx);
+
/* Make sure the caller hasn't done something weird with the queue.
* ??? This is not quite the same as the PSW[B] bit, which would be
* expensive to track. Real hardware will trap for
@@ -3483,7 +3485,16 @@ static bool trans_b_gate(DisasContext *ctx, arg_b_gate *a)
}
#endif
- return do_dbranch(ctx, dest, a->l, a->n);
+ if (a->l) {
+ TCGv_reg tmp = dest_gpr(ctx, a->l);
+ if (ctx->privilege < 3) {
+ tcg_gen_andi_reg(tmp, tmp, -4);
+ }
+ tcg_gen_ori_reg(tmp, tmp, ctx->privilege);
+ save_gpr(ctx, a->l, tmp);
+ }
+
+ return do_dbranch(ctx, dest, 0, a->n);
}
static bool trans_blr(DisasContext *ctx, arg_blr *a)