diff options
| author | Robert Norton | 2017-06-16 14:03:19 +0100 |
|---|---|---|
| committer | Robert Norton | 2017-06-16 14:03:19 +0100 |
| commit | 37620cb56337d3846801f992c93e0eea7bb86719 (patch) | |
| tree | 950d83829803b6ab267cca0865159acb09efcae6 | |
| parent | a17d0d93ceb445800bb35f7bc558ab51a21ef01b (diff) | |
prefer arithmetic on integers followed by cast to bit[64] in CCopyType.
| -rw-r--r-- | cheri/cheri_insts.sail | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cheri/cheri_insts.sail b/cheri/cheri_insts.sail index 33dacd63..ad933dea 100644 --- a/cheri/cheri_insts.sail +++ b/cheri/cheri_insts.sail @@ -598,12 +598,12 @@ function clause execute (CCopyType(cd, cb, ct)) = raise_c2_exception(CapEx_SealViolation, cb) else { - let (bit[64]) newOffset = if (ct_val.sealed) + let newOffset = if (ct_val.sealed) then - ((bit[64]) (EXTZ(ct_val.otype))) - cb_base + unsigned(ct_val.otype) - cb_base else - (bit[64]) -1 in - let (success, cap) = setCapOffset(cb_val, newOffset) in { + -1 in + let (success, cap) = setCapOffset(cb_val, (bit[64]) newOffset) in { writeCapReg(cd, cap); assert(success, None); (*XXX TODO can this fail*) } |
