diff options
| author | Alasdair Armstrong | 2018-04-04 15:03:45 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-04-05 18:40:36 +0100 |
| commit | 3604e9e94b766147b482c4c653c4d09bb4ee7a7c (patch) | |
| tree | 75ea0e29a1f16d96140d5e100292923df5a8fa2e /src/gen_lib | |
| parent | 252460bc33fc26d8ef8aa905592fd4029d97d419 (diff) | |
Add generic prelude library that pulls in various basic sail
definitions from sail/lib.
Diffstat (limited to 'src/gen_lib')
| -rw-r--r-- | src/gen_lib/sail_values.lem | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gen_lib/sail_values.lem b/src/gen_lib/sail_values.lem index a89456b9..2fe69211 100644 --- a/src/gen_lib/sail_values.lem +++ b/src/gen_lib/sail_values.lem @@ -276,6 +276,8 @@ let ext_list pad len xs = if longer < 0 then drop (nat_of_int (abs (longer))) xs else pad_list pad xs longer +let vector_truncate bs len = ext_list B0 len bs + let extz_bools len bs = ext_list false len bs let exts_bools len bs = match bs with @@ -341,6 +343,8 @@ let exts_bits len bits = | _ -> ext_list B0 len bits end +let zero_extend bits len = extz_bits len bits + let rec add_one_bit_ignore_overflow_aux bits = match bits with | [] -> [] | B0 :: bits -> B1 :: bits |
