diff options
| author | Thomas Bauereiss | 2019-06-06 15:31:00 +0100 |
|---|---|---|
| committer | Thomas Bauereiss | 2019-06-06 17:57:25 +0100 |
| commit | 1ad5bb9ea7b4462c0ec07b0f6021f6f228834eb5 (patch) | |
| tree | 762b1a7bab992259218c2d759ac04521c1282e0a /src | |
| parent | 5728e7ad2fc8258e82bcd09953d0ad6a2e4fecd1 (diff) | |
Add arith_shiftr to C and OCaml libraries
Diffstat (limited to 'src')
| -rw-r--r-- | src/sail_lib.ml | 5 |
1 files changed, 5 insertions, 0 deletions
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)) |
