From 1ad5bb9ea7b4462c0ec07b0f6021f6f228834eb5 Mon Sep 17 00:00:00 2001 From: Thomas Bauereiss Date: Thu, 6 Jun 2019 15:31:00 +0100 Subject: Add arith_shiftr to C and OCaml libraries --- src/sail_lib.ml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/sail_lib.ml b/src/sail_lib.ml index 21d95e64..2e00f980 100644 --- a/src/sail_lib.ml +++ b/src/sail_lib.ml @@ -741,6 +741,11 @@ let shiftr (x, y) = let rbits = zeros @ x in take (List.length x) rbits +let arith_shiftr (x, y) = + let msbs = replicate_bits (take 1 x, y) in + let rbits = msbs @ x in + take (List.length x) rbits + let shift_bits_right (x, y) = shiftr (x, uint(y)) -- cgit v1.2.3