Skip to content

Commit 671347f

Browse files
committed
fixup! [AArch64][llvm] Armv9.7-A: Add support for GICv5 (FEAT_GCIE)
Avoid repetition. PPI and Virtual PPI registers can share code.
1 parent f6e728b commit 671347f

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

llvm/lib/Target/AArch64/AArch64SystemOperands.td

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,18 +2520,6 @@ def : RWSysReg<"ICV_HAPR_EL1", 0b11, 0b001, 0b1100, 0b0000, 0b011>;
25202520
def : RWSysReg<"ICV_HPPIR_EL1", 0b11, 0b000, 0b1100, 0b1010, 0b011>;
25212521
def : RWSysReg<"ICV_PCR_EL1", 0b11, 0b001, 0b1100, 0b0000, 0b010>;
25222522

2523-
// PPI Registers
2524-
foreach n=0-1 in {
2525-
defvar nb = !cast<bit>(n);
2526-
// Op0 Op1 CRn CRm Op2
2527-
def : RWSysReg<"ICC_PPI_CACTIVER"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b00,nb}>;
2528-
def : RWSysReg<"ICC_PPI_CPENDR"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b10,nb}>;
2529-
def : RWSysReg<"ICC_PPI_ENABLER"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1010, {0b11,nb}>;
2530-
def : RWSysReg<"ICC_PPI_SACTIVER"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b01,nb}>;
2531-
def : RWSysReg<"ICC_PPI_SPENDR"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b11,nb}>;
2532-
def : ROSysReg<"ICC_PPI_HMR"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1010, {0b00,nb}>;
2533-
}
2534-
25352523
foreach n=0-3 in {
25362524
defvar nb = !cast<bits<2>>(n);
25372525
// Op0 Op1 CRn CRm Op2
@@ -2545,18 +2533,23 @@ foreach n=0-15 in{
25452533
def : RWSysReg<"ICC_PPI_PRIORITYR"#n#"_EL1", 0b11, 0b000, 0b1100, {0b111,nb{3}}, nb{2-0}>;
25462534
}
25472535

2548-
// Virtual PPI Registers
2549-
foreach n=0-1 in {
2550-
defvar nb = !cast<bit>(n);
2551-
// Op0 Op1 CRn CRm Op2
2552-
def : RWSysReg<"ICV_PPI_CACTIVER"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b00,nb}>;
2553-
def : RWSysReg<"ICV_PPI_CPENDR"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b10,nb}>;
2554-
def : RWSysReg<"ICV_PPI_ENABLER"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1010, {0b11,nb}>;
2555-
def : RWSysReg<"ICV_PPI_SACTIVER"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b01,nb}>;
2556-
def : RWSysReg<"ICV_PPI_SPENDR"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b11,nb}>;
2557-
def : RWSysReg<"ICV_PPI_HMR"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1010, {0b00,nb}>;
2536+
// PPI and Virtual PPI Registers
2537+
multiclass PPIRegisters<string prefix> {
2538+
foreach n=0-1 in {
2539+
defvar nb = !cast<bit>(n);
2540+
// Op0 Op1 CRn CRm Op2
2541+
def : RWSysReg<prefix#"_PPI_CACTIVER"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b00,nb}>;
2542+
def : RWSysReg<prefix#"_PPI_CPENDR"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b10,nb}>;
2543+
def : RWSysReg<prefix#"_PPI_ENABLER"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1010, {0b11,nb}>;
2544+
def : RWSysReg<prefix#"_PPI_SACTIVER"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b01,nb}>;
2545+
def : RWSysReg<prefix#"_PPI_SPENDR"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1101, {0b11,nb}>;
2546+
def : RWSysReg<prefix#"_PPI_HMR"#n#"_EL1", 0b11, 0b000, 0b1100, 0b1010, {0b00,nb}>;
2547+
}
25582548
}
25592549

2550+
defm : PPIRegisters<"ICC">; // PPI Registers
2551+
defm : PPIRegisters<"ICV">; // Virtual PPI Registers
2552+
25602553
foreach n=0-15 in {
25612554
defvar nb = !cast<bits<4>>(n);
25622555
// Op0 Op1 CRn CRm Op2

0 commit comments

Comments
 (0)