aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@eecs.berkeley.edu>2012-08-01 22:55:02 -0700
committerAndrew Waterman <waterman@eecs.berkeley.edu>2012-08-01 22:55:02 -0700
commitb3d3f82d4e38f2712d5ccf9c69051137ec5fca76 (patch)
tree88e233dfe5c1456745d96c359bc0f3165338dfcf
parent07d126d57ede2d3c7e28fddd08338b2171f884bb (diff)
downloadspike-b3d3f82d4e38f2712d5ccf9c69051137ec5fca76.zip
spike-b3d3f82d4e38f2712d5ccf9c69051137ec5fca76.tar.gz
spike-b3d3f82d4e38f2712d5ccf9c69051137ec5fca76.tar.bz2
new tohost/fromhost semantics
-rw-r--r--riscv/insns/mtpcr.h3
-rw-r--r--riscv/processor.cc2
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;
}
}