diff options
author | Helge Deller <deller@gmx.de> | 2018-01-02 21:31:45 +0100 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2018-01-31 05:30:50 -0800 |
commit | 2330504ceec94e2cfa1138e5b256b5e1b4a1b444 (patch) | |
tree | 69a782dd0e748433691d094513f7396f29c48cbc | |
parent | 3f7367e2ccc33aefd962c9459624ce40efa7e7ad (diff) |
target/hppa: Implement LDSID for system mode
Signed-off-by: Helge Deller <deller@gmx.de>
Message-Id: <20180102203145.GA17059@ls3530.fritz.box>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r-- | target/hppa/translate.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/target/hppa/translate.c b/target/hppa/translate.c index b773b0ef09..2f8e87bba9 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2211,8 +2211,20 @@ static DisasJumpType trans_ldsid(DisasContext *ctx, uint32_t insn, unsigned rt = extract32(insn, 0, 5); TCGv_reg dest = dest_gpr(ctx, rt); - /* Since we don't implement space registers, this returns zero. */ +#ifdef CONFIG_USER_ONLY + /* We don't implement space registers in user mode. */ tcg_gen_movi_reg(dest, 0); +#else + unsigned rb = extract32(insn, 21, 5); + unsigned sp = extract32(insn, 14, 2); + TCGv_i64 t0 = tcg_temp_new_i64(); + + tcg_gen_mov_i64(t0, space_select(ctx, sp, load_gpr(ctx, rb))); + tcg_gen_shri_i64(t0, t0, 32); + tcg_gen_trunc_i64_reg(dest, t0); + + tcg_temp_free_i64(t0); +#endif save_gpr(ctx, rt, dest); cond_free(&ctx->null_cond); |