summaryrefslogtreecommitdiff
path: root/lib/sail.c
diff options
context:
space:
mode:
authorjp2020-02-12 17:46:48 +0000
committerjp2020-02-12 17:46:48 +0000
commited8bccd927306551f93d5aab8d0e2a92b9e5d227 (patch)
tree55bf788c8155f0c7d024f2147f5eb3873729b02a /lib/sail.c
parent31a65c9b7383d2a87da0fbcf5c265d533146ac23 (diff)
parent4a72cb8084237161d0bccc66f27d5fb6d24315e0 (diff)
Merge branch 'sail2' of https://github.com/rems-project/sail into sail2
Diffstat (limited to 'lib/sail.c')
-rw-r--r--lib/sail.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sail.c b/lib/sail.c
index 1753ab8e..94065f0a 100644
--- a/lib/sail.c
+++ b/lib/sail.c
@@ -837,6 +837,15 @@ fbits bitvector_access(const lbits op, const sail_int n_mpz)
return (fbits) mpz_tstbit(*op.bits, n);
}
+fbits update_fbits(const fbits op, const uint64_t n, const fbits bit)
+{
+ if ((bit & 1) == 1) {
+ return op | (bit << n);
+ } else {
+ return op & ~(bit << n);
+ }
+}
+
void sail_unsigned(sail_int *rop, const lbits op)
{
/* Normal form of bv_t is always positive so just return the bits. */