Skip to content

Commit bf140c9

Browse files
committed
fixup! [AArch64][llvm] Add support for Permission Overlays Extension 2 (FEAT_S1POE2)
Properly fix `plbi alle3`
1 parent f56135e commit bf140c9

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

llvm/lib/Target/AArch64/AArch64SystemOperands.td

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,24 +2849,24 @@ def lookupPLBIByName : SearchIndex {
28492849
}
28502850

28512851
multiclass PLBI<string name, bits<3> op1, bits<4> crn, bits<3> op2,
2852-
bit needsreg> {
2852+
bit needsreg, bit optreg> {
28532853
// Entries containing "IS" or "OS" allow optional regs when +tlbid enabled
28542854
def : PLBIEntry<op1, crn, 0b0111, op2, name, needsreg, 0>;
2855-
def : PLBIEntry<op1, crn, 0b0011, op2, name#"IS", needsreg, 1>;
2856-
def : PLBIEntry<op1, crn, 0b0001, op2, name#"OS", needsreg, 1>;
2855+
def : PLBIEntry<op1, crn, 0b0011, op2, name#"IS", needsreg, optreg>;
2856+
def : PLBIEntry<op1, crn, 0b0001, op2, name#"OS", needsreg, optreg>;
28572857
def : PLBIEntry<op1, crn, 0b1111, op2, name#"NXS", needsreg, 0>;
2858-
def : PLBIEntry<op1, crn, 0b1011, op2, name#"ISNXS", needsreg, 1>;
2859-
def : PLBIEntry<op1, crn, 0b1001, op2, name#"OSNXS", needsreg, 1>;
2858+
def : PLBIEntry<op1, crn, 0b1011, op2, name#"ISNXS", needsreg, optreg>;
2859+
def : PLBIEntry<op1, crn, 0b1001, op2, name#"OSNXS", needsreg, optreg>;
28602860
}
28612861

28622862
// CRm defines above six variants of each instruction. It is omitted here.
2863-
// Op1 CRn Op2 needsreg
2864-
defm : PLBI<"ALLE3", 0b110, 0b1010, 0b000, 1>;
2865-
defm : PLBI<"ALLE2", 0b100, 0b1010, 0b000, 0>;
2866-
defm : PLBI<"ALLE1", 0b100, 0b1010, 0b100, 0>;
2867-
defm : PLBI<"VMALLE1", 0b000, 0b1010, 0b000, 0>;
2868-
defm : PLBI<"ASIDE1", 0b000, 0b1010, 0b010, 1>;
2869-
defm : PLBI<"PERME3", 0b110, 0b1010, 0b001, 1>;
2870-
defm : PLBI<"PERME2", 0b100, 0b1010, 0b001, 1>;
2871-
defm : PLBI<"PERME1", 0b000, 0b1010, 0b001, 1>;
2872-
defm : PLBI<"PERMAE1", 0b000, 0b1010, 0b011, 1>;
2863+
// Op1 CRn Op2 nr optreg
2864+
defm : PLBI<"ALLE3", 0b110, 0b1010, 0b000, 0, 0>;
2865+
defm : PLBI<"ALLE2", 0b100, 0b1010, 0b000, 0, 1>;
2866+
defm : PLBI<"ALLE1", 0b100, 0b1010, 0b100, 0, 1>;
2867+
defm : PLBI<"VMALLE1", 0b000, 0b1010, 0b000, 0, 1>;
2868+
defm : PLBI<"ASIDE1", 0b000, 0b1010, 0b010, 1, 0>;
2869+
defm : PLBI<"PERME3", 0b110, 0b1010, 0b001, 1, 0>;
2870+
defm : PLBI<"PERME2", 0b100, 0b1010, 0b001, 1, 0>;
2871+
defm : PLBI<"PERME1", 0b000, 0b1010, 0b001, 1, 0>;
2872+
defm : PLBI<"PERMAE1", 0b000, 0b1010, 0b011, 1, 0>;

llvm/test/MC/AArch64/arm-poe2.s

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,22 +2938,22 @@ tchangeb x1, #9, nB
29382938
// CHECK-ERROR: error: instruction requires: poe2
29392939

29402940

2941-
PLBI ALLE3, x3
2942-
// CHECK-INST: plbi alle3, x3
2943-
// CHECK-ENCODING: [0x03,0xa7,0x0e,0xd5]
2944-
// CHECK-UNKNOWN: d50ea703 sys #6, c10, c7, #0, x3
2941+
PLBI ALLE3
2942+
// CHECK-INST: plbi alle3
2943+
// CHECK-ENCODING: [0x1f,0xa7,0x0e,0xd5]
2944+
// CHECK-UNKNOWN: d50ea71f sys #6, c10, c7, #0
29452945
// CHECK-ERROR: error: PLBI ALLE3 requires: poe2
29462946

2947-
PLBI ALLE3IS, x3
2948-
// CHECK-INST: plbi alle3is, x3
2949-
// CHECK-ENCODING: [0x03,0xa3,0x0e,0xd5]
2950-
// CHECK-UNKNOWN: d50ea303 sys #6, c10, c3, #0, x3
2947+
PLBI ALLE3IS
2948+
// CHECK-INST: plbi alle3is
2949+
// CHECK-ENCODING: [0x1f,0xa3,0x0e,0xd5]
2950+
// CHECK-UNKNOWN: d50ea31f sys #6, c10, c3, #0
29512951
// CHECK-ERROR: error: PLBI ALLE3IS requires: poe2
29522952

2953-
PLBI ALLE3OS, x3
2954-
// CHECK-INST: plbi alle3os, x3
2955-
// CHECK-ENCODING: [0x03,0xa1,0x0e,0xd5]
2956-
// CHECK-UNKNOWN: d50ea103 sys #6, c10, c1, #0, x3
2953+
PLBI ALLE3OS
2954+
// CHECK-INST: plbi alle3os
2955+
// CHECK-ENCODING: [0x1f,0xa1,0x0e,0xd5]
2956+
// CHECK-UNKNOWN: d50ea11f sys #6, c10, c1, #0
29572957
// CHECK-ERROR: error: PLBI ALLE3OS requires: poe2
29582958

29592959
PLBI ALLE2
@@ -3082,22 +3082,22 @@ PLBI PERME1OS, X3
30823082
// CHECK-UNKNOWN: d508a123 sys #0, c10, c1, #1, x3
30833083
// CHECK-ERROR: error: PLBI PERME1OS requires: poe2
30843084

3085-
PLBI ALLE3NXS, X3
3086-
// CHECK-INST: plbi alle3nxs, x3
3087-
// CHECK-ENCODING: [0x03,0xaf,0x0e,0xd5]
3088-
// CHECK-UNKNOWN: d50eaf03 sys #6, c10, c15, #0, x3
3085+
PLBI ALLE3NXS
3086+
// CHECK-INST: plbi alle3nxs
3087+
// CHECK-ENCODING: [0x1f,0xaf,0x0e,0xd5]
3088+
// CHECK-UNKNOWN: d50eaf1f sys #6, c10, c15, #0
30893089
// CHECK-ERROR: error: PLBI ALLE3NXS requires: poe2
30903090

3091-
PLBI ALLE3ISNXS, X3
3092-
// CHECK-INST: plbi alle3isnxs, x3
3093-
// CHECK-ENCODING: [0x03,0xab,0x0e,0xd5]
3094-
// CHECK-UNKNOWN: d50eab03 sys #6, c10, c11, #0, x3
3091+
PLBI ALLE3ISNXS
3092+
// CHECK-INST: plbi alle3isnxs
3093+
// CHECK-ENCODING: [0x1f,0xab,0x0e,0xd5]
3094+
// CHECK-UNKNOWN: d50eab1f sys #6, c10, c11, #0
30953095
// CHECK-ERROR: error: PLBI ALLE3ISNXS requires: poe2
30963096

3097-
PLBI ALLE3OSNXS, X3
3098-
// CHECK-INST: plbi alle3osnxs, x3
3099-
// CHECK-ENCODING: [0x03,0xa9,0x0e,0xd5]
3100-
// CHECK-UNKNOWN: d50ea903 sys #6, c10, c9, #0, x3
3097+
PLBI ALLE3OSNXS
3098+
// CHECK-INST: plbi alle3osnxs
3099+
// CHECK-ENCODING: [0x1f,0xa9,0x0e,0xd5]
3100+
// CHECK-UNKNOWN: d50ea91f sys #6, c10, c9, #0
31013101
// CHECK-ERROR: error: PLBI ALLE3OSNXS requires: poe2
31023102

31033103
PLBI ALLE2NXS

0 commit comments

Comments
 (0)