@@ -832,32 +832,33 @@ def : CMHPriorityHint<"ph", 0b1>;
832832//===----------------------------------------------------------------------===//
833833
834834class TLBICommon<string name, bits<3> op1, bits<4> crn, bits<4> crm,
835- bits<3> op2, bit needsreg> {
835+ bits<3> op2, bit needsreg, bit optionalreg > {
836836 string Name = name;
837837 bits<14> Encoding;
838838 let Encoding{13-11} = op1;
839839 let Encoding{10-7} = crn;
840840 let Encoding{6-3} = crm;
841841 let Encoding{2-0} = op2;
842842 bit NeedsReg = needsreg;
843+ bit OptionalReg = optionalreg;
843844 list<string> Requires = [];
844845 list<string> ExtraRequires = [];
845846 code RequiresStr = [{ { }] # !interleave(Requires # ExtraRequires, [{, }]) # [{ } }];
846847}
847848
848849class TLBIEntry<string name, bits<3> op1, bits<4> crn, bits<4> crm,
849- bits<3> op2, bit needsreg>
850- : TLBICommon<name, op1, crn, crm, op2, needsreg>;
850+ bits<3> op2, bit needsreg, bit optionalreg >
851+ : TLBICommon<name, op1, crn, crm, op2, needsreg, optionalreg >;
851852
852853class TLBIPEntry<string name, bits<3> op1, bits<4> crn, bits<4> crm,
853- bits<3> op2, bit needsreg>
854- : TLBICommon<name, op1, crn, crm, op2, needsreg>;
854+ bits<3> op2, bit needsreg, bit optionalreg >
855+ : TLBICommon<name, op1, crn, crm, op2, needsreg, optionalreg >;
855856
856857multiclass TLBITableBase {
857858 def NAME # Table : GenericTable {
858859 let FilterClass = NAME # "Entry";
859860 let CppTypeName = NAME;
860- let Fields = ["Name", "Encoding", "NeedsReg", "RequiresStr"];
861+ let Fields = ["Name", "Encoding", "NeedsReg", "OptionalReg", " RequiresStr"];
861862 let PrimaryKey = ["Encoding"];
862863 let PrimaryKeyName = "lookup" # NAME # "ByEncoding";
863864 }
@@ -871,60 +872,60 @@ defm TLBI : TLBITableBase;
871872defm TLBIP : TLBITableBase;
872873
873874multiclass TLBI<string name, bit hasTLBIP, bits<3> op1, bits<4> crn, bits<4> crm,
874- bits<3> op2, bit needsreg = 1> {
875- def : TLBIEntry<name, op1, crn, crm, op2, needsreg>;
876- def : TLBIEntry<!strconcat(name, "nXS"), op1, crn, crm, op2, needsreg> {
875+ bits<3> op2, bit needsreg = 1, bit optionalreg = 0 > {
876+ def : TLBIEntry<name, op1, crn, crm, op2, needsreg, optionalreg >;
877+ def : TLBIEntry<!strconcat(name, "nXS"), op1, crn, crm, op2, needsreg, optionalreg > {
877878 let Encoding{7} = 1;
878879 let ExtraRequires = ["AArch64::FeatureXS"];
879880 }
880881 if !eq(hasTLBIP, true) then {
881- def : TLBIPEntry<name, op1, crn, crm, op2, needsreg>;
882- def : TLBIPEntry<!strconcat(name, "nXS"), op1, crn, crm, op2, needsreg> {
882+ def : TLBIPEntry<name, op1, crn, crm, op2, needsreg, optionalreg >;
883+ def : TLBIPEntry<!strconcat(name, "nXS"), op1, crn, crm, op2, needsreg, optionalreg > {
883884 let Encoding{7} = 1;
884885 let ExtraRequires = ["AArch64::FeatureXS"];
885886 }
886887 }
887888}
888889
889- // hasTLBIP op1 CRn CRm op2 needsreg
890+ // hasTLBIP op1 CRn CRm op2 needsreg, optreg
890891defm : TLBI<"IPAS2E1IS", 1, 0b100, 0b1000, 0b0000, 0b001>;
891892defm : TLBI<"IPAS2LE1IS", 1, 0b100, 0b1000, 0b0000, 0b101>;
892- defm : TLBI<"VMALLE1IS", 0, 0b000, 0b1000, 0b0011, 0b000, 0>;
893- defm : TLBI<"ALLE2IS", 0, 0b100, 0b1000, 0b0011, 0b000, 0>;
894- defm : TLBI<"ALLE3IS", 0, 0b110, 0b1000, 0b0011, 0b000, 0>;
893+ defm : TLBI<"VMALLE1IS", 0, 0b000, 0b1000, 0b0011, 0b000, 0, 1 >;
894+ defm : TLBI<"ALLE2IS", 0, 0b100, 0b1000, 0b0011, 0b000, 0, 1 >;
895+ defm : TLBI<"ALLE3IS", 0, 0b110, 0b1000, 0b0011, 0b000, 0, 1 >;
895896defm : TLBI<"VAE1IS", 1, 0b000, 0b1000, 0b0011, 0b001>;
896897defm : TLBI<"VAE2IS", 1, 0b100, 0b1000, 0b0011, 0b001>;
897898defm : TLBI<"VAE3IS", 1, 0b110, 0b1000, 0b0011, 0b001>;
898899defm : TLBI<"ASIDE1IS", 0, 0b000, 0b1000, 0b0011, 0b010>;
899900defm : TLBI<"VAAE1IS", 1, 0b000, 0b1000, 0b0011, 0b011>;
900- defm : TLBI<"ALLE1IS", 0, 0b100, 0b1000, 0b0011, 0b100, 0>;
901+ defm : TLBI<"ALLE1IS", 0, 0b100, 0b1000, 0b0011, 0b100, 0, 1 >;
901902defm : TLBI<"VALE1IS", 1, 0b000, 0b1000, 0b0011, 0b101>;
902903defm : TLBI<"VALE2IS", 1, 0b100, 0b1000, 0b0011, 0b101>;
903904defm : TLBI<"VALE3IS", 1, 0b110, 0b1000, 0b0011, 0b101>;
904- defm : TLBI<"VMALLS12E1IS", 0, 0b100, 0b1000, 0b0011, 0b110, 0>;
905+ defm : TLBI<"VMALLS12E1IS", 0, 0b100, 0b1000, 0b0011, 0b110, 0, 1 >;
905906defm : TLBI<"VAALE1IS", 1, 0b000, 0b1000, 0b0011, 0b111>;
906907defm : TLBI<"IPAS2E1", 1, 0b100, 0b1000, 0b0100, 0b001>;
907908defm : TLBI<"IPAS2LE1", 1, 0b100, 0b1000, 0b0100, 0b101>;
908- defm : TLBI<"VMALLE1", 0, 0b000, 0b1000, 0b0111, 0b000, 0>;
909- defm : TLBI<"ALLE2", 0, 0b100, 0b1000, 0b0111, 0b000, 0>;
910- defm : TLBI<"ALLE3", 0, 0b110, 0b1000, 0b0111, 0b000, 0>;
909+ defm : TLBI<"VMALLE1", 0, 0b000, 0b1000, 0b0111, 0b000, 0, 0 >;
910+ defm : TLBI<"ALLE2", 0, 0b100, 0b1000, 0b0111, 0b000, 0, 0 >;
911+ defm : TLBI<"ALLE3", 0, 0b110, 0b1000, 0b0111, 0b000, 0, 0 >;
911912defm : TLBI<"VAE1", 1, 0b000, 0b1000, 0b0111, 0b001>;
912913defm : TLBI<"VAE2", 1, 0b100, 0b1000, 0b0111, 0b001>;
913914defm : TLBI<"VAE3", 1, 0b110, 0b1000, 0b0111, 0b001>;
914915defm : TLBI<"ASIDE1", 0, 0b000, 0b1000, 0b0111, 0b010>;
915916defm : TLBI<"VAAE1", 1, 0b000, 0b1000, 0b0111, 0b011>;
916- defm : TLBI<"ALLE1", 0, 0b100, 0b1000, 0b0111, 0b100, 0>;
917+ defm : TLBI<"ALLE1", 0, 0b100, 0b1000, 0b0111, 0b100, 0, 0 >;
917918defm : TLBI<"VALE1", 1, 0b000, 0b1000, 0b0111, 0b101>;
918919defm : TLBI<"VALE2", 1, 0b100, 0b1000, 0b0111, 0b101>;
919920defm : TLBI<"VALE3", 1, 0b110, 0b1000, 0b0111, 0b101>;
920- defm : TLBI<"VMALLS12E1", 0, 0b100, 0b1000, 0b0111, 0b110, 0>;
921+ defm : TLBI<"VMALLS12E1", 0, 0b100, 0b1000, 0b0111, 0b110, 0, 0 >;
921922defm : TLBI<"VAALE1", 1, 0b000, 0b1000, 0b0111, 0b111>;
922923
923924// Armv8.4-A Translation Lookaside Buffer Instructions (TLBI)
924925let Requires = ["AArch64::FeatureTLB_RMI"] in {
925926// Armv8.4-A Outer Sharable TLB Maintenance instructions:
926- // hasTLBIP op1 CRn CRm op2 needsreg
927- defm : TLBI<"VMALLE1OS", 0, 0b000, 0b1000, 0b0001, 0b000, 0>;
927+ // hasTLBIP op1 CRn CRm op2 needsreg, optreg
928+ defm : TLBI<"VMALLE1OS", 0, 0b000, 0b1000, 0b0001, 0b000, 0, 1 >;
928929defm : TLBI<"VAE1OS", 1, 0b000, 0b1000, 0b0001, 0b001>;
929930defm : TLBI<"ASIDE1OS", 0, 0b000, 0b1000, 0b0001, 0b010>;
930931defm : TLBI<"VAAE1OS", 1, 0b000, 0b1000, 0b0001, 0b011>;
@@ -934,15 +935,15 @@ defm : TLBI<"IPAS2E1OS", 1, 0b100, 0b1000, 0b0100, 0b000>;
934935defm : TLBI<"IPAS2LE1OS", 1, 0b100, 0b1000, 0b0100, 0b100>;
935936defm : TLBI<"VAE2OS", 1, 0b100, 0b1000, 0b0001, 0b001>;
936937defm : TLBI<"VALE2OS", 1, 0b100, 0b1000, 0b0001, 0b101>;
937- defm : TLBI<"VMALLS12E1OS", 0, 0b100, 0b1000, 0b0001, 0b110, 0>;
938+ defm : TLBI<"VMALLS12E1OS", 0, 0b100, 0b1000, 0b0001, 0b110, 0, 1 >;
938939defm : TLBI<"VAE3OS", 1, 0b110, 0b1000, 0b0001, 0b001>;
939940defm : TLBI<"VALE3OS", 1, 0b110, 0b1000, 0b0001, 0b101>;
940- defm : TLBI<"ALLE2OS", 0, 0b100, 0b1000, 0b0001, 0b000, 0>;
941- defm : TLBI<"ALLE1OS", 0, 0b100, 0b1000, 0b0001, 0b100, 0>;
942- defm : TLBI<"ALLE3OS", 0, 0b110, 0b1000, 0b0001, 0b000, 0>;
941+ defm : TLBI<"ALLE2OS", 0, 0b100, 0b1000, 0b0001, 0b000, 0, 1 >;
942+ defm : TLBI<"ALLE1OS", 0, 0b100, 0b1000, 0b0001, 0b100, 0, 1 >;
943+ defm : TLBI<"ALLE3OS", 0, 0b110, 0b1000, 0b0001, 0b000, 0, 1 >;
943944
944945// Armv8.4-A TLB Range Maintenance instructions:
945- // hasTLBIP op1 CRn CRm op2 needsreg
946+ // hasTLBIP op1 CRn CRm op2
946947defm : TLBI<"RVAE1", 1, 0b000, 0b1000, 0b0110, 0b001>;
947948defm : TLBI<"RVAAE1", 1, 0b000, 0b1000, 0b0110, 0b011>;
948949defm : TLBI<"RVALE1", 1, 0b000, 0b1000, 0b0110, 0b101>;
@@ -977,18 +978,19 @@ defm : TLBI<"RVALE3OS", 1, 0b110, 0b1000, 0b0101, 0b101>;
977978
978979// Armv9-A Realm Management Extension TLBI Instructions
979980let Requires = ["AArch64::FeatureRME"] in {
981+ // hasTLBIP op1 CRn CRm op2 needsreg
980982defm : TLBI<"RPAOS", 0, 0b110, 0b1000, 0b0100, 0b011>;
981983defm : TLBI<"RPALOS", 0, 0b110, 0b1000, 0b0100, 0b111>;
982- defm : TLBI<"PAALLOS", 0, 0b110, 0b1000, 0b0001, 0b100, 0>;
983- defm : TLBI<"PAALL", 0, 0b110, 0b1000, 0b0111, 0b100, 0>;
984+ defm : TLBI<"PAALLOS", 0, 0b110, 0b1000, 0b0001, 0b100, 0, 0 >;
985+ defm : TLBI<"PAALL", 0, 0b110, 0b1000, 0b0111, 0b100, 0, 0 >;
984986}
985987
986988// Armv9.5-A TLBI VMALL for Dirty State
987989let Requires = ["AArch64::FeatureTLBIW"] in {
988- // op1, CRn, CRm, op2, needsreg
989- defm : TLBI<"VMALLWS2E1", 0, 0b100, 0b1000, 0b0110, 0b010, 0>;
990- defm : TLBI<"VMALLWS2E1IS", 0, 0b100, 0b1000, 0b0010, 0b010, 0>;
991- defm : TLBI<"VMALLWS2E1OS", 0, 0b100, 0b1000, 0b0101, 0b010, 0>;
990+ // hasTLBIP op1 CRn CRm op2 needsreg, optreg
991+ defm : TLBI<"VMALLWS2E1", 0, 0b100, 0b1000, 0b0110, 0b010, 0 , 0>;
992+ defm : TLBI<"VMALLWS2E1IS", 0, 0b100, 0b1000, 0b0010, 0b010, 0, 1 >;
993+ defm : TLBI<"VMALLWS2E1OS", 0, 0b100, 0b1000, 0b0101, 0b010, 0, 1 >;
992994}
993995
994996//===----------------------------------------------------------------------===//
0 commit comments