summaryrefslogtreecommitdiff
path: root/src/gen_lib/sail_operators_mwords.lem
diff options
context:
space:
mode:
authorBrian Campbell2017-10-06 14:26:21 +0100
committerBrian Campbell2017-10-06 14:26:21 +0100
commit819209a3f47678e346f4bd9e0e482801898ff09d (patch)
tree135ee9cf54a68a76fc0039f75ce4180a6b39cddd /src/gen_lib/sail_operators_mwords.lem
parent2a6b7e421b9c5b74bc775b0473ccb8aa5e944562 (diff)
Implement replicate_bits for mwords
Diffstat (limited to 'src/gen_lib/sail_operators_mwords.lem')
-rw-r--r--src/gen_lib/sail_operators_mwords.lem5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gen_lib/sail_operators_mwords.lem b/src/gen_lib/sail_operators_mwords.lem
index 63c9bfcc..e0e66c3e 100644
--- a/src/gen_lib/sail_operators_mwords.lem
+++ b/src/gen_lib/sail_operators_mwords.lem
@@ -501,6 +501,11 @@ let mod_VIV = arith_op_vec_range_no0 hardware_mod false 1
let duplicate (bit, length) =
vec_to_bvec (Vector (repeat [bit] length) (length - 1) false)
+(* TODO: replace with better native versions *)
+let replicate_bits (v, count) =
+ let v = bvec_to_vec true 0 v in
+ vec_to_bvec (Vector (repeat (get_elems v) count) ((length v * count) - 1) false)
+
let compare_op op (l,r) = (op l r)
let lt = compare_op (<)