summaryrefslogtreecommitdiff
path: root/src/gen_lib
diff options
context:
space:
mode:
authorRobert Norton2017-07-06 11:54:33 +0100
committerRobert Norton2017-07-06 11:54:33 +0100
commitce962ff43ea0025c41735faa0df52f5546cdbec9 (patch)
treef6fcf180845e4e9c9e76556cccc160a2976ad796 /src/gen_lib
parent4d36f113efaec653f9125192c62874009cb433f4 (diff)
substitute all uses of mod_big_int and div_big_int for Z.rem and Z.div which have correct rounding behaviour. Missed these when changing quot and mod functions.
Diffstat (limited to 'src/gen_lib')
-rw-r--r--src/gen_lib/sail_values.ml16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gen_lib/sail_values.ml b/src/gen_lib/sail_values.ml
index 8332aa5c..d160e84a 100644
--- a/src/gen_lib/sail_values.ml
+++ b/src/gen_lib/sail_values.ml
@@ -920,8 +920,8 @@ let rec arith_op_no0_big op (l,r) =
then None
else Some (op l r)
-let modulo_no0_big = arith_op_no0_big mod_big_int
-let quot_no0_big = arith_op_no0_big div_big_int
+let modulo_no0_big = arith_op_no0_big (Z.rem)
+let quot_no0_big = arith_op_no0_big (Z.div)
let rec arith_op_no0_int op (l,r) =
if r = 0
@@ -970,9 +970,9 @@ let rec arith_op_vec_no0_big op sign size (l,r) =
Vvector((Array.make act_size Vundef), start, ord)
| _ -> assert false
-let mod_vec_big = arith_op_vec_no0_big mod_big_int false unit_big_int
-let quot_vec_big = arith_op_vec_no0_big div_big_int false unit_big_int
-let quot_vec_signed_big = arith_op_vec_no0_big div_big_int true unit_big_int
+let mod_vec_big = arith_op_vec_no0_big (Z.rem) false unit_big_int
+let quot_vec_big = arith_op_vec_no0_big (Z.div) false unit_big_int
+let quot_vec_signed_big = arith_op_vec_no0_big (Z.div) true unit_big_int
let mod_vec = mod_vec_big
let quot_vec = quot_vec_big
@@ -1031,8 +1031,8 @@ let arith_op_overflow_no0_vec_big op sign size (l,r) =
let overflow = if representable then Vzero else Vone in
(correct_size_num,overflow,most_significant one_more)
-let quot_overflow_vec_big = arith_op_overflow_no0_vec_big div_big_int false unit_big_int
-let quot_overflow_vec_signed_big = arith_op_overflow_no0_vec_big div_big_int true unit_big_int
+let quot_overflow_vec_big = arith_op_overflow_no0_vec_big (Z.div) false unit_big_int
+let quot_overflow_vec_signed_big = arith_op_overflow_no0_vec_big (Z.div) true unit_big_int
let quot_overflow_vec = quot_overflow_vec_big
let quot_overflow_vec_signed = quot_overflow_vec_signed_big
@@ -1048,7 +1048,7 @@ let arith_op_vec_range_no0_big op sign size (l,r) =
let ord = get_ord l in
arith_op_vec_no0_big op sign size (l,(to_vec_big ord (length_big l) r))
-let mod_vec_range_big = arith_op_vec_range_no0_big mod_big_int false unit_big_int
+let mod_vec_range_big = arith_op_vec_range_no0_big (Z.rem) false unit_big_int
let mod_vec_range = mod_vec_range_big