diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sail.c | 9 | ||||
| -rw-r--r-- | lib/sail.h | 2 |
2 files changed, 11 insertions, 0 deletions
@@ -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. */ @@ -288,6 +288,8 @@ void sail_truncateLSB(lbits *rop, const lbits op, const sail_int len); fbits bitvector_access(const lbits op, const sail_int n_mpz); +fbits update_fbits(const fbits op, const uint64_t n, const fbits bit); + void sail_unsigned(sail_int *rop, const lbits op); void sail_signed(sail_int *rop, const lbits op); |
