diff options
| author | Robert Norton | 2016-05-03 12:56:36 +0100 |
|---|---|---|
| committer | Robert Norton | 2016-05-03 12:56:36 +0100 |
| commit | e31c8b89760bfaf7b017c351f11780b418394045 (patch) | |
| tree | b17d99dd5c24ec3876abbb8f2d00d9ce124f4415 /cheri | |
| parent | fcb70746ae49099fead1db4519403a5ca4109a59 (diff) | |
immediate offset of load/store via capability is scaled by word size (ISA change).
Diffstat (limited to 'cheri')
| -rw-r--r-- | cheri/cheri_insts.sail | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cheri/cheri_insts.sail b/cheri/cheri_insts.sail index 486e33b1..20df3a62 100644 --- a/cheri/cheri_insts.sail +++ b/cheri/cheri_insts.sail @@ -515,7 +515,7 @@ function clause execute (CLoad(rd, cb, rt, offset, signext, width, linked)) = { size := wordWidthBytes(width); cursor := getCapCursor(cb_val); - vAddr := cursor + unsigned(rGPR(rt)) + signed(offset); + vAddr := cursor + unsigned(rGPR(rt)) + (size*signed(offset)); vAddr64:= (bit[64]) vAddr; if ((vAddr + size) > ((nat) (cb_val.base) + ((nat) (cb_val.length)))) then exit (raise_c2_exception(CapEx_LengthViolation, cb)) @@ -569,7 +569,7 @@ function clause execute (CStore(rs, cb, rt, rd, offset, width, conditional)) = { size := wordWidthBytes(width); cursor := getCapCursor(cb_val); - vAddr := cursor + unsigned(rGPR(rt)) + signed(offset); + vAddr := cursor + unsigned(rGPR(rt)) + (size * signed(offset)); vAddr64:= (bit[64]) vAddr; if ((vAddr + size) > ((nat) (cb_val.base) + ((nat) (cb_val.length)))) then exit (raise_c2_exception(CapEx_LengthViolation, cb)) |
