From 8f4a6b668e2fa02aa3eb37a62e964e6320b02ee6 Mon Sep 17 00:00:00 2001 From: Robert Norton Date: Fri, 21 Apr 2017 13:11:47 +0100 Subject: remove unnecessary cast in incrementCP0Count (run every instruction) for potential speedup. --- mips/mips_prelude.sail | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mips/mips_prelude.sail b/mips/mips_prelude.sail index 22e2f138..fcac3d98 100644 --- a/mips/mips_prelude.sail +++ b/mips/mips_prelude.sail @@ -483,11 +483,11 @@ function unit checkCP0Access () = } function unit incrementCP0Count() = { - TLBRandom := (if (unsigned(TLBRandom) == unsigned(TLBWired)) + TLBRandom := (if (TLBRandom == TLBWired) then (TLBIndexMax) else (TLBRandom - 1)); CP0Count := (CP0Count + 1); - if (unsigned(CP0Count) == unsigned(CP0Compare)) then { + if (CP0Count == CP0Compare) then { (CP0Cause[15]) := bitone; (* XXX indexing IP field here doesn't seem to work *) }; -- cgit v1.2.3