summaryrefslogtreecommitdiff
path: root/lib/sail.h
diff options
context:
space:
mode:
authorRobert Norton2019-03-22 16:50:48 +0000
committerRobert Norton2019-03-22 16:55:23 +0000
commitf4acbce30be2aecdfc491478a24c5eb551824f24 (patch)
treed09f2561e19ab1c4928f053c9f5226c06ce94ee6 /lib/sail.h
parentc9471630ad64af00a58a3c92f4b6a22f2194e9ee (diff)
Tidy up of div and mod operators (C implementation was previously inconsistent with ocaml etc.). Rename div and mod builtins to ediv_int/emod_int and tdiv_int/tmod_int and add corresponding implementations. Add a test with negative operands. This will break existing models but will mean users have to think about which versions they want and won't accidentally use the wrong one.
Diffstat (limited to 'lib/sail.h')
-rw-r--r--lib/sail.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sail.h b/lib/sail.h
index 5a7722de..666c75fe 100644
--- a/lib/sail.h
+++ b/lib/sail.h
@@ -138,6 +138,8 @@ SAIL_INT_FUNCTION(add_int, sail_int, const sail_int, const sail_int);
SAIL_INT_FUNCTION(sub_int, sail_int, const sail_int, const sail_int);
SAIL_INT_FUNCTION(sub_nat, sail_int, const sail_int, const sail_int);
SAIL_INT_FUNCTION(mult_int, sail_int, const sail_int, const sail_int);
+SAIL_INT_FUNCTION(ediv_int, sail_int, const sail_int, const sail_int);
+SAIL_INT_FUNCTION(emod_int, sail_int, const sail_int, const sail_int);
SAIL_INT_FUNCTION(tdiv_int, sail_int, const sail_int, const sail_int);
SAIL_INT_FUNCTION(tmod_int, sail_int, const sail_int, const sail_int);
SAIL_INT_FUNCTION(fdiv_int, sail_int, const sail_int, const sail_int);