aboutsummaryrefslogtreecommitdiff
path: root/model/prelude.sail
diff options
context:
space:
mode:
authorTim Hutt <timothy.hutt@codasip.com>2024-02-12 10:39:23 +0000
committerBill McSpadden <bill@riscv.org>2024-02-27 08:52:15 -0600
commitc287c34df944647fcfd1923e37f4d97466f264bd (patch)
treef7af48c1fce145ab60f3339b75521464977f221d /model/prelude.sail
parentbaafe6f01eb11428ebe62874c91d29df3f5ef465 (diff)
downloadsail-riscv-c287c34df944647fcfd1923e37f4d97466f264bd.zip
sail-riscv-c287c34df944647fcfd1923e37f4d97466f264bd.tar.gz
sail-riscv-c287c34df944647fcfd1923e37f4d97466f264bd.tar.bz2
Add missing comparison operators
Some less-than/greater-than operators were missing. This adds the full set.
Diffstat (limited to 'model/prelude.sail')
-rw-r--r--model/prelude.sail15
1 files changed, 12 insertions, 3 deletions
diff --git a/model/prelude.sail b/model/prelude.sail
index 792c2e6..b1814b1 100644
--- a/model/prelude.sail
+++ b/model/prelude.sail
@@ -116,22 +116,31 @@ val to_bits : forall 'l, 'l >= 0.(atom('l), int) -> bits('l)
function to_bits (l, n) = get_slice_int(l, n, 0)
infix 4 <_s
+infix 4 >_s
+infix 4 <=_s
infix 4 >=_s
infix 4 <_u
-infix 4 >=_u
+infix 4 >_u
infix 4 <=_u
+infix 4 >=_u
val operator <_s : forall 'n, 'n > 0. (bits('n), bits('n)) -> bool
+val operator >_s : forall 'n, 'n > 0. (bits('n), bits('n)) -> bool
+val operator <=_s : forall 'n, 'n > 0. (bits('n), bits('n)) -> bool
val operator >=_s : forall 'n, 'n > 0. (bits('n), bits('n)) -> bool
val operator <_u : forall 'n. (bits('n), bits('n)) -> bool
-val operator >=_u : forall 'n. (bits('n), bits('n)) -> bool
+val operator >_u : forall 'n. (bits('n), bits('n)) -> bool
val operator <=_u : forall 'n. (bits('n), bits('n)) -> bool
+val operator >=_u : forall 'n. (bits('n), bits('n)) -> bool
function operator <_s (x, y) = signed(x) < signed(y)
+function operator >_s (x, y) = signed(x) > signed(y)
+function operator <=_s (x, y) = signed(x) <= signed(y)
function operator >=_s (x, y) = signed(x) >= signed(y)
function operator <_u (x, y) = unsigned(x) < unsigned(y)
-function operator >=_u (x, y) = unsigned(x) >= unsigned(y)
+function operator >_u (x, y) = unsigned(x) > unsigned(y)
function operator <=_u (x, y) = unsigned(x) <= unsigned(y)
+function operator >=_u (x, y) = unsigned(x) >= unsigned(y)
infix 7 >>
infix 7 <<