Skip to content

Commit 51fe17b

Browse files
committed
[AArch64] Add support for the SPE-EEF feature
This is an addition to the existing Statistical Profiling extension, which introduces an extra system register that is enabled by the new 'spe-eef' subtarget feature. Patch written by Simon Tatham. Reviewed By: ostannard Differential Revision: https://reviews.llvm.org/D92391
1 parent da21f7e commit 51fe17b

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

llvm/lib/Target/AArch64/AArch64.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,9 @@ def FeatureLS64 : SubtargetFeature<"ls64", "HasLS64",
415415
def FeatureBRBE : SubtargetFeature<"brbe", "HasBRBE",
416416
"true", "Enable Branch Record Buffer Extension">;
417417

418+
def FeatureSPE_EEF : SubtargetFeature<"spe-eef", "HasSPE_EEF",
419+
"true", "Enable extra register in the Statistical Profiling Extension">;
420+
418421
def FeatureFineGrainedTraps : SubtargetFeature<"fgt", "HasFineGrainedTraps",
419422
"true", "Enable fine grained virtualization traps extension">;
420423

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ def HasLS64 : Predicate<"Subtarget->hasLS64()">,
159159
AssemblerPredicate<(all_of FeatureLS64), "ls64">;
160160
def HasBRBE : Predicate<"Subtarget->hasBRBE()">,
161161
AssemblerPredicate<(all_of FeatureBRBE), "brbe">;
162+
def HasSPE_EEF : Predicate<"Subtarget->hasSPE_EEF()">,
163+
AssemblerPredicate<(all_of FeatureSPE_EEF), "spe-eef">;
162164
def IsLE : Predicate<"Subtarget->isLittleEndian()">;
163165
def IsBE : Predicate<"!Subtarget->isLittleEndian()">;
164166
def IsWindows : Predicate<"Subtarget->isTargetWindows()">;

llvm/lib/Target/AArch64/AArch64Subtarget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class AArch64Subtarget final : public AArch64GenSubtargetInfo {
185185
bool HasETE = false;
186186
bool HasTRBE = false;
187187
bool HasBRBE = false;
188+
bool HasSPE_EEF = false;
188189

189190
// HasZeroCycleRegMove - Has zero-cycle register mov instructions.
190191
bool HasZeroCycleRegMove = false;

llvm/lib/Target/AArch64/AArch64SystemOperands.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,10 @@ foreach n = 0-31 in {
15931593
}
15941594
}
15951595

1596+
// Statistical Profiling Extension system register
1597+
let Requires = [{ {AArch64::FeatureSPE_EEF} }] in
1598+
def : RWSysReg<"PMSNEVFR_EL1", 0b11, 0b000, 0b1001, 0b1001, 0b001>;
1599+
15961600
// Cyclone specific system registers
15971601
// Op0 Op1 CRn CRm Op2
15981602
let Requires = [{ {AArch64::ProcAppleA7} }] in

llvm/test/MC/AArch64/spe.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: llvm-mc -triple aarch64 -mattr +spe-eef -show-encoding %s 2>%t | FileCheck %s
2+
3+
msr PMSNEVFR_EL1, x0
4+
mrs x1, PMSNEVFR_EL1
5+
// CHECK: msr PMSNEVFR_EL1, x0 // encoding: [0x20,0x99,0x18,0xd5]
6+
// CHECK: mrs x1, PMSNEVFR_EL1 // encoding: [0x21,0x99,0x38,0xd5]

0 commit comments

Comments
 (0)