diff options
author | Dominik Steenken <dost@de.ibm.com> | 2024-04-19 14:39:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-19 14:39:19 +0200 |
commit | ae9a5b07e0dca10cd44a11f11915be5eab002307 (patch) | |
tree | d2402bfb4122ef4434cd9189afc502313ff01a86 | |
parent | 0a5f50d50be429734074584702cd20cf54c27420 (diff) | |
download | llvm-ae9a5b07e0dca10cd44a11f11915be5eab002307.zip llvm-ae9a5b07e0dca10cd44a11f11915be5eab002307.tar.gz llvm-ae9a5b07e0dca10cd44a11f11915be5eab002307.tar.bz2 |
[SystemZ] Add TPEI instruction and Associated Facility (#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.
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZFeatures.td | 8 | ||||
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZInstrSystem.td | 4 | ||||
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZScheduleZ14.td | 2 | ||||
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZScheduleZ15.td | 2 | ||||
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZScheduleZ16.td | 2 | ||||
-rw-r--r-- | llvm/test/MC/Disassembler/SystemZ/insns-z14.txt | 8 | ||||
-rw-r--r-- | llvm/test/MC/SystemZ/insn-bad-z13.s | 3 | ||||
-rw-r--r-- | llvm/test/MC/SystemZ/insn-good-z14.s | 6 |
8 files changed, 31 insertions, 4 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZFeatures.td b/llvm/lib/Target/SystemZ/SystemZFeatures.td index a1e2a92..e6b95d3 100644 --- a/llvm/lib/Target/SystemZ/SystemZFeatures.td +++ b/llvm/lib/Target/SystemZ/SystemZFeatures.td @@ -246,6 +246,11 @@ def FeatureInsertReferenceBitsMultiple : SystemZFeature< "Assume that the insert-reference-bits-multiple facility is installed" >; +def FeatureTestPendingExternalInterruption : SystemZFeature< + "test-pending-external-interruption", "TestPendingExternalInterruption", (all_of FeatureTestPendingExternalInterruption), + "Assume that the test-pending-external-interruption facility is installed" +>; + def Arch12NewFeatures : SystemZFeatureList<[ FeatureMiscellaneousExtensions2, FeatureGuardedStorage, @@ -253,7 +258,8 @@ def Arch12NewFeatures : SystemZFeatureList<[ FeatureMessageSecurityAssist8, FeatureVectorEnhancements1, FeatureVectorPackedDecimal, - FeatureInsertReferenceBitsMultiple + FeatureInsertReferenceBitsMultiple, + FeatureTestPendingExternalInterruption ]>; //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/SystemZ/SystemZInstrSystem.td b/llvm/lib/Target/SystemZ/SystemZInstrSystem.td index 497844b..1f153cc 100644 --- a/llvm/lib/Target/SystemZ/SystemZInstrSystem.td +++ b/llvm/lib/Target/SystemZ/SystemZInstrSystem.td @@ -541,6 +541,10 @@ let hasSideEffects = 1, Defs = [CC] in let hasSideEffects = 1, Defs = [CC] in def TPI : StoreInherentS<"tpi", 0xB236, null_frag, 0>; +// Test pending external interruption. +let hasSideEffects = 1, Defs = [CC], Predicates = [FeatureTestPendingExternalInterruption] in + def TPEI : UnaryRRE<"tpei", 0xB9A1, null_frag, GR64, GR64>; + // Set address limit. let hasSideEffects = 1, Uses = [R1L] in def SAL : SideEffectInherentS<"sal", 0xB237, null_frag>; diff --git a/llvm/lib/Target/SystemZ/SystemZScheduleZ14.td b/llvm/lib/Target/SystemZ/SystemZScheduleZ14.td index 7e6302a..120d4a4 100644 --- a/llvm/lib/Target/SystemZ/SystemZScheduleZ14.td +++ b/llvm/lib/Target/SystemZ/SystemZScheduleZ14.td @@ -1640,7 +1640,7 @@ def : InstRW<[WLat30, MCD], (instregex "(M|S|ST|T)SCH$")>; def : InstRW<[WLat30, MCD], (instregex "RCHP$")>; def : InstRW<[WLat30, MCD], (instregex "SCHM$")>; def : InstRW<[WLat30, MCD], (instregex "STC(PS|RW)$")>; -def : InstRW<[WLat30, MCD], (instregex "TPI$")>; +def : InstRW<[WLat30, MCD], (instregex "TPE?I$")>; def : InstRW<[WLat30, MCD], (instregex "SAL$")>; } diff --git a/llvm/lib/Target/SystemZ/SystemZScheduleZ15.td b/llvm/lib/Target/SystemZ/SystemZScheduleZ15.td index 89edcf4..acba3a1 100644 --- a/llvm/lib/Target/SystemZ/SystemZScheduleZ15.td +++ b/llvm/lib/Target/SystemZ/SystemZScheduleZ15.td @@ -1686,7 +1686,7 @@ def : InstRW<[WLat30, MCD], (instregex "(M|S|ST|T)SCH$")>; def : InstRW<[WLat30, MCD], (instregex "RCHP$")>; def : InstRW<[WLat30, MCD], (instregex "SCHM$")>; def : InstRW<[WLat30, MCD], (instregex "STC(PS|RW)$")>; -def : InstRW<[WLat30, MCD], (instregex "TPI$")>; +def : InstRW<[WLat30, MCD], (instregex "TPE?I$")>; def : InstRW<[WLat30, MCD], (instregex "SAL$")>; } diff --git a/llvm/lib/Target/SystemZ/SystemZScheduleZ16.td b/llvm/lib/Target/SystemZ/SystemZScheduleZ16.td index 8f6dc3b..dd82b2b 100644 --- a/llvm/lib/Target/SystemZ/SystemZScheduleZ16.td +++ b/llvm/lib/Target/SystemZ/SystemZScheduleZ16.td @@ -1719,7 +1719,7 @@ def : InstRW<[WLat30, MCD], (instregex "(M|S|ST|T)SCH$")>; def : InstRW<[WLat30, MCD], (instregex "RCHP$")>; def : InstRW<[WLat30, MCD], (instregex "SCHM$")>; def : InstRW<[WLat30, MCD], (instregex "STC(PS|RW)$")>; -def : InstRW<[WLat30, MCD], (instregex "TPI$")>; +def : InstRW<[WLat30, MCD], (instregex "TPE?I$")>; def : InstRW<[WLat30, MCD], (instregex "SAL$")>; } diff --git a/llvm/test/MC/Disassembler/SystemZ/insns-z14.txt b/llvm/test/MC/Disassembler/SystemZ/insns-z14.txt index c73b50c..f1657bd 100644 --- a/llvm/test/MC/Disassembler/SystemZ/insns-z14.txt +++ b/llvm/test/MC/Disassembler/SystemZ/insns-z14.txt @@ -3251,3 +3251,11 @@ # CHECK: wftcixb %v4, %v21, 1656 0xe7 0x45 0x67 0x88 0x44 0x4a +# CHECK: tpei %r0, %r15 +0xb9 0xa1 0x00 0x0f + +# CHECK: tpei %r15, %r0 +0xb9 0xa1 0x00 0xf0 + +# CHECK: tpei %r4, %r10 +0xb9 0xa1 0x00 0x4a diff --git a/llvm/test/MC/SystemZ/insn-bad-z13.s b/llvm/test/MC/SystemZ/insn-bad-z13.s index 4ae4fd9..46aebc7 100644 --- a/llvm/test/MC/SystemZ/insn-bad-z13.s +++ b/llvm/test/MC/SystemZ/insn-bad-z13.s @@ -3024,3 +3024,6 @@ wledb %v0, %v0, -1, 0 wledb %v0, %v0, 16, 0 + #CHECK: error: instruction requires: test-pending-external-interrupt + #CHECK: tpei %r0, %r1 + tpei %r0, %r1 diff --git a/llvm/test/MC/SystemZ/insn-good-z14.s b/llvm/test/MC/SystemZ/insn-good-z14.s index ec12283..385fd3c 100644 --- a/llvm/test/MC/SystemZ/insn-good-z14.s +++ b/llvm/test/MC/SystemZ/insn-good-z14.s @@ -2720,3 +2720,9 @@ wftcixb %v31, %v0, 0 wftcixb %v4, %v21, 0x678 +#CHECK: tpei %r0, %r15 # encoding: [0xb9,0xa1,0x00,0x0f] +#CHECK: tpei %r15, %r0 # encoding: [0xb9,0xa1,0x00,0xf0] +#CHECK: tpei %r4, %r10 # encoding: [0xb9,0xa1,0x00,0x4a] + tpei %r0, %r15 + tpei %r15, %r0 + tpei %r4, %r10 |