diff options
| author | Alasdair | 2019-02-21 23:15:15 +0000 |
|---|---|---|
| committer | Alasdair | 2019-02-21 23:18:23 +0000 |
| commit | 084fb032de3495671d557e31dbc55dc8400f9d81 (patch) | |
| tree | da26657dd4d71173aa94c756d5877988846b3c4a /lib | |
| parent | 9c13d5888fdd12aa46f9a3b1a752cf040bc94939 (diff) | |
Allow monomorphisation with C generation
Run C tests with -O -Oconstant_fold -auto_mono
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sail.c | 14 | ||||
| -rw-r--r-- | lib/sail.h | 3 |
2 files changed, 16 insertions, 1 deletions
@@ -1460,7 +1460,8 @@ void get_time_ns(sail_int *rop, const unit u) // ARM specific optimisations -void arm_align(lbits *rop, const lbits x_bv, const sail_int y_mpz) { +void arm_align(lbits *rop, const lbits x_bv, const sail_int y_mpz) +{ uint64_t x = mpz_get_ui(*x_bv.bits); uint64_t y = mpz_get_ui(y_mpz); uint64_t z = y * (x / y); @@ -1468,3 +1469,14 @@ void arm_align(lbits *rop, const lbits x_bv, const sail_int y_mpz) { mpz_set_ui(*rop->bits, safe_rshift(UINT64_MAX, 64l - (n - 1)) & z); rop->len = n; } + +// Monomorphisation +void make_the_value(sail_int *rop, const sail_int op) +{ + mpz_set(*rop, op); +} + +void size_itself_int(sail_int *rop, const sail_int op) +{ + mpz_set(*rop, op); +} @@ -153,6 +153,9 @@ SAIL_INT_FUNCTION(pow_int, sail_int, const sail_int, const sail_int); SAIL_INT_FUNCTION(pow2, sail_int, const sail_int); +void make_the_value(sail_int *, const sail_int); +void size_itself_int(sail_int *, const sail_int); + /* ***** Sail bitvectors ***** */ typedef uint64_t fbits; |
