Add CSetEqualExact

This commit is contained in:
Peter Rugg
2021-02-22 17:44:36 +00:00
parent 53eb073fb2
commit 5b6e8d88f6
4 changed files with 12 additions and 1 deletions

View File

@@ -155,7 +155,8 @@ Bit #(7) f7_cap_CBuildCap = 7'h1d;
Bit #(7) f7_cap_CCopyType = 7'h1e;
Bit #(7) f7_cap_CCSeal = 7'h1f;
Bit #(7) f7_cap_CTestSubset = 7'h20;
// 7'h21-7'hfb unused
Bit #(7) f7_cap_CSetEqualExact = 7'h21;
// 7'h22-7'hfb unused
Bit #(7) f7_cap_Stores = 7'h7c;
Bit #(7) f7_cap_Loads = 7'h7d;
Bit #(7) f7_cap_TwoSrc = 7'h7e;

View File

@@ -1134,6 +1134,13 @@ function DecodeResult decode(Instruction inst, Bool cap_mode);
dInst.scr = rs1 == 0 ? Valid (scrAddrDDC) : Invalid;
dInst.capFunc = CapInspect (TestSubset);
end
f7_cap_CSetEqualExact: begin
dInst.iType = Cap;
regs.dst = Valid(tagged Gpr rd);
regs.src1 = Valid(tagged Gpr rs1);
regs.src2 = Valid(tagged Gpr rs2);
dInst.capFunc = CapInspect (SetEqualExact);
end
f7_cap_CCopyType: begin
dInst.capChecks.src2_tag = True;
dInst.capChecks.src2_unsealed = True;

View File

@@ -287,6 +287,8 @@ function Data capInspect(CapPipe a, CapPipe b, CapInspectFunc func);
&& ((getPerms(a) & getPerms(b)) == getPerms(a))
&& (getBase(a) >= getBase(b))
&& (getTop(a) <= getTop(b))));
tagged SetEqualExact :
zeroExtend(pack(toMem(a) == toMem(b)));
tagged GetLen :
truncate(getLength(a));
tagged GetBase :

View File

@@ -340,6 +340,7 @@ typedef union tagged {
typedef union tagged {
void TestSubset;
void SetEqualExact;
void CSub;
void GetLen;
void GetBase;