@@ -1880,12 +1880,6 @@ def : ROSysReg<"ERXPFGF_EL1", 0b11, 0b000, 0b0101, 0b0100, 0b100>;
18801880// v8.4a MPAM registers
18811881// Op0 Op1 CRn CRm Op2
18821882let Requires = [{ {AArch64::FeatureMPAM} }] in {
1883- def : RWSysReg<"MPAM0_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b001>;
1884- def : RWSysReg<"MPAM1_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b000>;
1885- def : RWSysReg<"MPAM2_EL2", 0b11, 0b100, 0b1010, 0b0101, 0b000>;
1886- def : RWSysReg<"MPAM3_EL3", 0b11, 0b110, 0b1010, 0b0101, 0b000>;
1887- def : RWSysReg<"MPAM1_EL12", 0b11, 0b101, 0b1010, 0b0101, 0b000>;
1888- def : RWSysReg<"MPAMHCR_EL2", 0b11, 0b100, 0b1010, 0b0100, 0b000>;
18891883def : RWSysReg<"MPAMVPMV_EL2", 0b11, 0b100, 0b1010, 0b0100, 0b001>;
18901884def : RWSysReg<"MPAMVPM0_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b000>;
18911885def : RWSysReg<"MPAMVPM1_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b001>;
@@ -1895,7 +1889,6 @@ def : RWSysReg<"MPAMVPM4_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b100>;
18951889def : RWSysReg<"MPAMVPM5_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b101>;
18961890def : RWSysReg<"MPAMVPM6_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b110>;
18971891def : RWSysReg<"MPAMVPM7_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b111>;
1898- def : ROSysReg<"MPAMIDR_EL1", 0b11, 0b000, 0b1010, 0b0100, 0b100>;
18991892} //FeatureMPAM
19001893
19011894// v8.4a Activity Monitor registers
@@ -2336,6 +2329,26 @@ def : RWSysReg<"MPAMBW0_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b101>;
23362329def : RWSysReg<"MPAMBWCAP_EL2", 0b11, 0b100, 0b1010, 0b0101, 0b110>;
23372330def : RWSysReg<"MPAMBWSM_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b111>;
23382331
2332+ // v9.7a Memory partitioning and monitoring version 2
2333+ // (FEAT_MPAMv2) registers
2334+ // Op0 Op1 CRn CRm Op2
2335+ // MPAM system registers that are also available for MPAMv2
2336+ def : RWSysReg<"MPAM0_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b001>;
2337+ def : RWSysReg<"MPAM1_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b000>;
2338+ def : RWSysReg<"MPAM1_EL12", 0b11, 0b101, 0b1010, 0b0101, 0b000>;
2339+ def : RWSysReg<"MPAM2_EL2", 0b11, 0b100, 0b1010, 0b0101, 0b000>;
2340+ def : RWSysReg<"MPAM3_EL3", 0b11, 0b110, 0b1010, 0b0101, 0b000>;
2341+ def : RWSysReg<"MPAMHCR_EL2", 0b11, 0b100, 0b1010, 0b0100, 0b000>;
2342+ def : ROSysReg<"MPAMIDR_EL1", 0b11, 0b000, 0b1010, 0b0100, 0b100>;
2343+ // Only MPAMv2 registers
2344+ def : RWSysReg<"MPAMCTL_EL1", 0b11, 0b000, 0b1010, 0b0101, 0b010>;
2345+ def : RWSysReg<"MPAMCTL_EL12", 0b11, 0b101, 0b1010, 0b0101, 0b010>;
2346+ def : RWSysReg<"MPAMCTL_EL2", 0b11, 0b100, 0b1010, 0b0101, 0b010>;
2347+ def : RWSysReg<"MPAMCTL_EL3", 0b11, 0b110, 0b1010, 0b0101, 0b010>;
2348+ def : RWSysReg<"MPAMVIDCR_EL2", 0b11, 0b100, 0b1010, 0b0111, 0b000>;
2349+ def : RWSysReg<"MPAMVIDSR_EL2", 0b11, 0b100, 0b1010, 0b0111, 0b001>;
2350+ def : RWSysReg<"MPAMVIDSR_EL3", 0b11, 0b110, 0b1010, 0b0111, 0b001>;
2351+
23392352//===----------------------------------------------------------------------===//
23402353// FEAT_SRMASK v9.6a registers
23412354//===----------------------------------------------------------------------===//
@@ -2429,3 +2442,35 @@ def : DC<"CIVAPS", 0b000, 0b0111, 0b1111, 0b001>;
24292442let Requires = [{ {AArch64::FeaturePoPS, AArch64::FeatureMTE} }] in {
24302443def : DC<"CIGDVAPS", 0b000, 0b0111, 0b1111, 0b101>;
24312444}
2445+
2446+ // MPAM Lookaside Buffer Invalidate (MLBI) instructions
2447+ class MLBI<string name, bits<3> op1, bits<4> crn, bits<4> crm, bits<3> op2, bit needsreg> {
2448+ string Name = name;
2449+ bits<14> Encoding;
2450+ let Encoding{13-11} = op1;
2451+ let Encoding{10-7} = crn;
2452+ let Encoding{6-3} = crm;
2453+ let Encoding{2-0} = op2;
2454+ bit NeedsReg = needsreg;
2455+ string RequiresStr = [{ {AArch64::FeatureMPAMv2} }];
2456+ }
2457+
2458+ def MLBITable : GenericTable {
2459+ let FilterClass = "MLBI";
2460+ let CppTypeName = "MLBI";
2461+ let Fields = ["Name", "Encoding", "NeedsReg", "RequiresStr"];
2462+
2463+ let PrimaryKey = ["Encoding"];
2464+ let PrimaryKeyName = "lookupMLBIByEncoding";
2465+ }
2466+
2467+ def lookupMLBIByName : SearchIndex {
2468+ let Table = MLBITable;
2469+ let Key = ["Name"];
2470+ }
2471+
2472+ // Op1 CRn CRm Op2 needsReg
2473+ def : MLBI<"ALLE1", 0b100, 0b0111, 0b0000, 0b100, 0>;
2474+ def : MLBI<"VMALLE1", 0b100, 0b0111, 0b0000, 0b101, 0>;
2475+ def : MLBI<"VPIDE1", 0b100, 0b0111, 0b0000, 0b110, 1>;
2476+ def : MLBI<"VPMGE1", 0b100, 0b0111, 0b0000, 0b111, 1>;
0 commit comments