summaryrefslogtreecommitdiff
path: root/cheri
diff options
context:
space:
mode:
authorRobert Norton2018-03-13 17:56:54 +0000
committerRobert Norton2018-03-14 09:39:20 +0000
commitb34c3fb76e00296caf60c651ee37ac025a5bc092 (patch)
tree069e1a01c7ff48dae31aa47d103479cfaeb6c7ee /cheri
parenta6a392775d6717579d99ad18018a1df3e5766e22 (diff)
minor cleanup of load -- we no longer need to separate out by access size because the type checker is more clever.
Diffstat (limited to 'cheri')
-rw-r--r--cheri/cheri_insts.sail21
1 files changed, 6 insertions, 15 deletions
diff --git a/cheri/cheri_insts.sail b/cheri/cheri_insts.sail
index ebdc474e..fa6ae0fd 100644
--- a/cheri/cheri_insts.sail
+++ b/cheri/cheri_insts.sail
@@ -1167,10 +1167,10 @@ function clause execute (CLoad(rd, cb, rt, offset, signext, width, linked)) =
raise_c2_exception(CapEx_PermitLoadViolation, cb)
else
{
- size = wordWidthBytes(width);
- cursor = getCapCursor(cb_val);
- vAddr = cursor + unsigned(rGPR(rt)) + (size*signed(offset));
- vAddr64= to_bits(64, vAddr);
+ let 'size = wordWidthBytes(width);
+ let cursor = getCapCursor(cb_val);
+ let vAddr = cursor + unsigned(rGPR(rt)) + (size*signed(offset));
+ let vAddr64 = to_bits(64, vAddr);
if ((vAddr + size) > getCapTop(cb_val)) then
raise_c2_exception(CapEx_LengthViolation, cb)
else if (vAddr < getCapBase(cb_val)) then
@@ -1180,23 +1180,14 @@ function clause execute (CLoad(rd, cb, rt, offset, signext, width, linked)) =
else
{
pAddr = (TLBTranslate(vAddr64, LoadData));
- widthBytes = wordWidthBytes(width);
memResult : bits(64) = if (linked) then
{
CP0LLBit = 0b1;
CP0LLAddr = pAddr;
- if widthBytes == 1 then extendLoad(MEMr_reserve_wrapper(pAddr, 1), signext)
- else if widthBytes == 2 then extendLoad(MEMr_reserve_wrapper(pAddr, 2), signext)
- else if widthBytes == 4 then extendLoad(MEMr_reserve_wrapper(pAddr, 4), signext)
- else extendLoad(MEMr_reserve_wrapper(pAddr, 8), signext)
+ extendLoad(MEMr_reserve_wrapper(pAddr, size), signext)
}
else
- {
- if widthBytes == 1 then extendLoad(MEMr_wrapper(pAddr, 1), signext)
- else if widthBytes == 2 then extendLoad(MEMr_wrapper(pAddr, 2), signext)
- else if widthBytes == 4 then extendLoad(MEMr_wrapper(pAddr, 4), signext)
- else extendLoad(MEMr_wrapper(pAddr, 8), signext)
- };
+ extendLoad(MEMr_wrapper(pAddr, size), signext);
wGPR(rd) = memResult;
}
}