From b3d3f82d4e38f2712d5ccf9c69051137ec5fca76 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Wed, 1 Aug 2012 22:55:02 -0700 Subject: [PATCH] new tohost/fromhost semantics --- riscv/insns/mtpcr.h | 3 ++- riscv/processor.cc | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) 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; } } -- 2.30.2