diff options
Diffstat (limited to 'cheri')
| -rw-r--r-- | cheri/cheri_insts.sail | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cheri/cheri_insts.sail b/cheri/cheri_insts.sail index c340ef32..c8ca156d 100644 --- a/cheri/cheri_insts.sail +++ b/cheri/cheri_insts.sail @@ -487,7 +487,7 @@ function clause decode (0b010010 : 0b10000 : (regno) rd : (regno) cb : 0b0000000 function clause decode (0b010010 : 0b10000 : (regno) rd : (regno) cb : 0b00000001 : 0b1 : 0b10) = Some(CLoad(rd, cb, 0b00000, 0b00000000, true, W, true)) (* CLLW *) function clause decode (0b010010 : 0b10000 : (regno) rd : (regno) cb : 0b00000001 : 0b0 : 0b11) = Some(CLoad(rd, cb, 0b00000, 0b00000000, false, D, true)) (* CLLD *) -function clause execute (CLoad(rd, cb, rt, offset, signed, width, linked)) = +function clause execute (CLoad(rd, cb, rt, offset, signext, width, linked)) = { cb_val := readCapReg(cb); if (register_inaccessible(cb)) then @@ -502,7 +502,7 @@ function clause execute (CLoad(rd, cb, rt, offset, signed, width, linked)) = { size := wordWidthBytes(width); cursor := getCapCursor(cb_val); - vAddr := cursor + (int) (rGPR(rt)) + (int) offset; + vAddr := cursor + signed(rGPR(rt)) + 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)) @@ -522,7 +522,7 @@ function clause execute (CLoad(rd, cb, rt, offset, signed, width, linked)) = } else MEMr(pAddr, widthBytes); - if (signed) then + if (signext) then wGPR(rd) := EXTS(memResult) else wGPR(rd) := EXTZ(memResult) @@ -556,7 +556,7 @@ function clause execute (CStore(rs, cb, rt, rd, offset, width, conditional)) = { size := wordWidthBytes(width); cursor := getCapCursor(cb_val); - vAddr := cursor + (int) (rGPR(rt)) + (int) offset; + vAddr := cursor + signed(rGPR(rt)) + 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)) @@ -616,7 +616,7 @@ function clause execute (CSC(cs, cb, rt, rd, offset, conditional)) = else { cursor := getCapCursor(cb_val); - vAddr := cursor + (int) (rGPR(rt)) + (int) offset; + vAddr := cursor + signed(rGPR(rt)) + signed(offset); vAddr64:= (bit[64]) vAddr; if ((vAddr + cap_size) > ((nat) (cb_val.base) + ((nat) (cb_val.length)))) then exit (raise_c2_exception(CapEx_LengthViolation, cb)) @@ -660,7 +660,7 @@ function clause execute (CLC(cd, cb, rt, offset, linked)) = else { cursor := getCapCursor(cb_val); - vAddr := cursor + (int) (rGPR(rt)) + (int) offset; + vAddr := cursor + signed(rGPR(rt)) + signed(offset); vAddr64:= (bit[64]) vAddr; if ((vAddr + cap_size) > ((nat) (cb_val.base) + ((nat) (cb_val.length)))) then exit (raise_c2_exception(CapEx_LengthViolation, cb)) |
