Added ccopytype_bypass

This commit is contained in:
Marno
2021-11-10 11:48:11 +00:00
parent aec3e404ed
commit 4d1dc29f79
3 changed files with 6 additions and 0 deletions

View File

@@ -22,4 +22,5 @@
`CAP_CHECK_FIELD(src1_derivable,"src1_derivable")
`CAP_CHECK_FIELD(cfromptr_bypass,"cfromptr_bypass")
`CAP_CHECK_FIELD(ccseal_bypass,"ccseal_bypass")
`CAP_CHECK_FIELD(ccopytype_bypass,"ccopytype_bypass")
`CAP_CHECK_FIELD(cap_exact,"cap_exact")

View File

@@ -1174,6 +1174,7 @@ function DecodeResult decode(Instruction inst, Bool cap_mode);
dInst.capChecks.check_low_src = Src1Type;
dInst.capChecks.check_high_src = Src1Type;
dInst.capChecks.check_inclusive = False;
dInst.capChecks.ccopytype_bypass = True;
dInst.iType = Cap;
regs.dst = Valid(tagged Gpr rd);

View File

@@ -424,6 +424,10 @@ function ExecResult basicExec(DecodedInst dInst, CapPipe rVal1, CapPipe rVal2, C
capException = Invalid;
boundsCheck = Invalid;
end
if (dInst.capChecks.ccopytype_bypass && isValidCap(rVal1) && getKind(rVal1) == UNSEALED && !validAsType(rVal1, zeroExtend(getKind(rVal1).SEALED_WITH_TYPE))) begin
capException = Invalid;
boundsCheck = Invalid;
end
cf.nextPc = setKind(cf.nextPc, UNSEALED);
cf.mispredict = cf.nextPc != ppc;