summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Norton2016-05-09 15:56:23 +0100
committerRobert Norton2016-05-09 15:57:53 +0100
commit89d455ae3254ee73cb5c8ae433280892db659ad3 (patch)
treead1c0b63678eb1de06a1b871f9f6950ad1ba94d2
parentb517bab3f8259359c645507db78f30a11286abbd (diff)
work around problem with <_s using signed
-rw-r--r--mips/mips_insts.sail4
1 files changed, 3 insertions, 1 deletions
diff --git a/mips/mips_insts.sail b/mips/mips_insts.sail
index 16af5c22..cfa35ab1 100644
--- a/mips/mips_insts.sail
+++ b/mips/mips_insts.sail
@@ -514,7 +514,9 @@ function clause decode (0b001010 : (regno) rs : (regno) rt : (imm16) imm) =
Some(SLTI(rs, rt, imm))
function clause execute (SLTI(rs, rt, imm)) =
{
- wGPR(rt) := if (rGPR(rs) <_s ((bit[64]) (EXTS(imm)))) then 1 else 0
+ let imm_val = signed(imm) in
+ let rs_val = signed(rGPR(rs)) in
+ wGPR(rt) := EXTZ(if (rs_val < imm_val) then 1 else 0)
}
(* SLTU set if less than unsigned *)