diff options
| author | Brian Campbell | 2018-02-14 17:13:29 +0000 |
|---|---|---|
| committer | Brian Campbell | 2018-02-14 17:13:29 +0000 |
| commit | 4fd52d03967cc4e5609378dd59d9307991f2271d (patch) | |
| tree | ff3d4f505cb5d0b8c680f483fc2ab43e1dbfd3be /lib | |
| parent | 23e4a6318260b38be4549ec7bbfab76dbb5eab13 (diff) | |
Another mono rewrite for aarch64
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mono_rewrites.sail | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/mono_rewrites.sail b/lib/mono_rewrites.sail index 167a2fdd..2958c890 100644 --- a/lib/mono_rewrites.sail +++ b/lib/mono_rewrites.sail @@ -130,6 +130,15 @@ function UInt_slice(xs,i,l) = { UInt(xs) } +val UInt_subrange : forall 'n, 'n >= 0. + (bits('n), int, int) -> int effect pure + +function UInt_subrange(xs,i,j) = { + let xs = (xs & slice_mask(j,i-j)) >> i in + UInt(xs) +} + + val zext_ones : forall 'n, 'n >= 0. int -> bits('n) effect pure function zext_ones(m) = { |
