From: Andrew Waterman Date: Thu, 2 Aug 2012 05:55:02 +0000 (-0700) Subject: new tohost/fromhost semantics X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3d3f82d4e38f2712d5ccf9c69051137ec5fca76;p=riscv-isa-sim.git new tohost/fromhost semantics --- diff --git a/riscv/insns/mtpcr.h b/riscv/insns/mtpcr.h index 5cd0134..9b0beba 100644 --- a/riscv/insns/mtpcr.h +++ b/riscv/insns/mtpcr.h @@ -1,4 +1,5 @@ require_supervisor; reg_t val = get_pcr(insn.rtype.rs1); -set_pcr(insn.rtype.rs1, RS2); +if (val == 0 || insn.rtype.rs1 != PCR_TOHOST) + set_pcr(insn.rtype.rs1, RS2); RD = val; diff --git a/riscv/processor.cc b/riscv/processor.cc index c116575..070ec15 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -271,12 +271,10 @@ void processor_t::set_pcr(int which, reg_t val) vecbanks_count = __builtin_popcountll(vecbanks); break; case PCR_TOHOST: - fromhost = 0; tohost = val; break; case PCR_FROMHOST: fromhost = val; - tohost = 0; break; } }