Skip to content

Commit ae9a5b0

Browse files
[SystemZ] Add TPEI instruction and Associated Facility (llvm#89372)
This PR adds the TPEI (Test Pending External Interruption) instruction, along with the facility that contains it. This is a millicoded system instruction that is not used for code generation, so it will be used exclusively by the Assembler and Disassembler. Accordingly, this commit also adds tests for both.
1 parent 0a5f50d commit ae9a5b0

File tree

8 files changed

+31
-4
lines changed

8 files changed

+31
-4
lines changed

llvm/lib/Target/SystemZ/SystemZFeatures.td

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,20 @@ def FeatureInsertReferenceBitsMultiple : SystemZFeature<
246246
"Assume that the insert-reference-bits-multiple facility is installed"
247247
>;
248248

249+
def FeatureTestPendingExternalInterruption : SystemZFeature<
250+
"test-pending-external-interruption", "TestPendingExternalInterruption", (all_of FeatureTestPendingExternalInterruption),
251+
"Assume that the test-pending-external-interruption facility is installed"
252+
>;
253+
249254
def Arch12NewFeatures : SystemZFeatureList<[
250255
FeatureMiscellaneousExtensions2,
251256
FeatureGuardedStorage,
252257
FeatureMessageSecurityAssist7,
253258
FeatureMessageSecurityAssist8,
254259
FeatureVectorEnhancements1,
255260
FeatureVectorPackedDecimal,
256-
FeatureInsertReferenceBitsMultiple
261+
FeatureInsertReferenceBitsMultiple,
262+
FeatureTestPendingExternalInterruption
257263
]>;
258264

259265
//===----------------------------------------------------------------------===//

llvm/lib/Target/SystemZ/SystemZInstrSystem.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,10 @@ let hasSideEffects = 1, Defs = [CC] in
541541
let hasSideEffects = 1, Defs = [CC] in
542542
def TPI : StoreInherentS<"tpi", 0xB236, null_frag, 0>;
543543

544+
// Test pending external interruption.
545+
let hasSideEffects = 1, Defs = [CC], Predicates = [FeatureTestPendingExternalInterruption] in
546+
def TPEI : UnaryRRE<"tpei", 0xB9A1, null_frag, GR64, GR64>;
547+
544548
// Set address limit.
545549
let hasSideEffects = 1, Uses = [R1L] in
546550
def SAL : SideEffectInherentS<"sal", 0xB237, null_frag>;

llvm/lib/Target/SystemZ/SystemZScheduleZ14.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ def : InstRW<[WLat30, MCD], (instregex "(M|S|ST|T)SCH$")>;
16401640
def : InstRW<[WLat30, MCD], (instregex "RCHP$")>;
16411641
def : InstRW<[WLat30, MCD], (instregex "SCHM$")>;
16421642
def : InstRW<[WLat30, MCD], (instregex "STC(PS|RW)$")>;
1643-
def : InstRW<[WLat30, MCD], (instregex "TPI$")>;
1643+
def : InstRW<[WLat30, MCD], (instregex "TPE?I$")>;
16441644
def : InstRW<[WLat30, MCD], (instregex "SAL$")>;
16451645

16461646
}

llvm/lib/Target/SystemZ/SystemZScheduleZ15.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,7 @@ def : InstRW<[WLat30, MCD], (instregex "(M|S|ST|T)SCH$")>;
16861686
def : InstRW<[WLat30, MCD], (instregex "RCHP$")>;
16871687
def : InstRW<[WLat30, MCD], (instregex "SCHM$")>;
16881688
def : InstRW<[WLat30, MCD], (instregex "STC(PS|RW)$")>;
1689-
def : InstRW<[WLat30, MCD], (instregex "TPI$")>;
1689+
def : InstRW<[WLat30, MCD], (instregex "TPE?I$")>;
16901690
def : InstRW<[WLat30, MCD], (instregex "SAL$")>;
16911691

16921692
}

llvm/lib/Target/SystemZ/SystemZScheduleZ16.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,7 @@ def : InstRW<[WLat30, MCD], (instregex "(M|S|ST|T)SCH$")>;
17191719
def : InstRW<[WLat30, MCD], (instregex "RCHP$")>;
17201720
def : InstRW<[WLat30, MCD], (instregex "SCHM$")>;
17211721
def : InstRW<[WLat30, MCD], (instregex "STC(PS|RW)$")>;
1722-
def : InstRW<[WLat30, MCD], (instregex "TPI$")>;
1722+
def : InstRW<[WLat30, MCD], (instregex "TPE?I$")>;
17231723
def : InstRW<[WLat30, MCD], (instregex "SAL$")>;
17241724

17251725
}

llvm/test/MC/Disassembler/SystemZ/insns-z14.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3251,3 +3251,11 @@
32513251
# CHECK: wftcixb %v4, %v21, 1656
32523252
0xe7 0x45 0x67 0x88 0x44 0x4a
32533253

3254+
# CHECK: tpei %r0, %r15
3255+
0xb9 0xa1 0x00 0x0f
3256+
3257+
# CHECK: tpei %r15, %r0
3258+
0xb9 0xa1 0x00 0xf0
3259+
3260+
# CHECK: tpei %r4, %r10
3261+
0xb9 0xa1 0x00 0x4a

llvm/test/MC/SystemZ/insn-bad-z13.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3024,3 +3024,6 @@
30243024
wledb %v0, %v0, -1, 0
30253025
wledb %v0, %v0, 16, 0
30263026

3027+
#CHECK: error: instruction requires: test-pending-external-interrupt
3028+
#CHECK: tpei %r0, %r1
3029+
tpei %r0, %r1

llvm/test/MC/SystemZ/insn-good-z14.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,3 +2720,9 @@
27202720
wftcixb %v31, %v0, 0
27212721
wftcixb %v4, %v21, 0x678
27222722

2723+
#CHECK: tpei %r0, %r15 # encoding: [0xb9,0xa1,0x00,0x0f]
2724+
#CHECK: tpei %r15, %r0 # encoding: [0xb9,0xa1,0x00,0xf0]
2725+
#CHECK: tpei %r4, %r10 # encoding: [0xb9,0xa1,0x00,0x4a]
2726+
tpei %r0, %r15
2727+
tpei %r15, %r0
2728+
tpei %r4, %r10

0 commit comments

Comments
 (0)