target-sparc: implement UA2005 rdhpstate and wrhpstate instructions

Backports commit f7f17ef75c9c90db63c44d11dc16fc085ca2c474 from qemu
This commit is contained in:
Artyom Tarasenko 2018-03-01 21:11:37 -05:00 committed by Lioncash
parent 0a124b2199
commit 2f2bde32bf
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -3670,7 +3670,8 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn, bool hook_ins
rs1 = GET_FIELD(insn, 13, 17);
switch (rs1) {
case 0: // hpstate
// gen_op_rdhpstate();
tcg_gen_ld_i64(tcg_ctx, cpu_dst, tcg_ctx->cpu_env,
offsetof(CPUSPARCState, hpstate));
break;
case 1: // htstate
// gen_op_rdhtstate();
@ -4794,7 +4795,9 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn, bool hook_ins
tcg_gen_xor_tl(tcg_ctx, cpu_tmp0, cpu_src1, cpu_src2);
switch (rd) {
case 0: // hpstate
// XXX gen_op_wrhpstate();
tcg_gen_st_i64(tcg_ctx, cpu_tmp0, tcg_ctx->cpu_env,
offsetof(CPUSPARCState,
hpstate));
save_state(dc);
gen_op_next_insn(dc);
tcg_gen_exit_tb(tcg_ctx, 0);