From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- llvm/lib/Target/SystemZ/SystemZInstrFormats.td | 198 ++++++++++++++++++------- 1 file changed, 148 insertions(+), 50 deletions(-) (limited to 'llvm/lib/Target/SystemZ/SystemZInstrFormats.td') diff --git a/llvm/lib/Target/SystemZ/SystemZInstrFormats.td b/llvm/lib/Target/SystemZ/SystemZInstrFormats.td index f064d33ac2f3..50f1e09c6ee5 100644 --- a/llvm/lib/Target/SystemZ/SystemZInstrFormats.td +++ b/llvm/lib/Target/SystemZ/SystemZInstrFormats.td @@ -2334,49 +2334,49 @@ class FixedCmpBranchRSYb opcode, class BranchUnaryRI opcode, RegisterOperand cls> : InstRIb { + mnemonic#"\t$R1, $RI2", []> { let Constraints = "$R1 = $R1src"; let DisableEncoding = "$R1src"; } class BranchUnaryRIL opcode, RegisterOperand cls> : InstRILb { + mnemonic#"\t$R1, $RI2", []> { let Constraints = "$R1 = $R1src"; let DisableEncoding = "$R1src"; } class BranchUnaryRR opcode, RegisterOperand cls> : InstRR { + mnemonic#"\t$R1, $R2", []> { let Constraints = "$R1 = $R1src"; let DisableEncoding = "$R1src"; } class BranchUnaryRRE opcode, RegisterOperand cls> : InstRRE { + mnemonic#"\t$R1, $R2", []> { let Constraints = "$R1 = $R1src"; let DisableEncoding = "$R1src"; } class BranchUnaryRX opcode, RegisterOperand cls> : InstRXa { + mnemonic#"\t$R1, $XBD2", []> { let Constraints = "$R1 = $R1src"; let DisableEncoding = "$R1src"; } class BranchUnaryRXY opcode, RegisterOperand cls> : InstRXYa { + mnemonic#"\t$R1, $XBD2", []> { let Constraints = "$R1 = $R1src"; let DisableEncoding = "$R1src"; } class BranchBinaryRSI opcode, RegisterOperand cls> : InstRSI { + mnemonic#"\t$R1, $R3, $RI2", []> { let Constraints = "$R1 = $R1src"; let DisableEncoding = "$R1src"; } @@ -2384,7 +2384,7 @@ class BranchBinaryRSI opcode, RegisterOperand cls> class BranchBinaryRIEe opcode, RegisterOperand cls> : InstRIEe { + mnemonic#"\t$R1, $R3, $RI2", []> { let Constraints = "$R1 = $R1src"; let DisableEncoding = "$R1src"; } @@ -2392,7 +2392,7 @@ class BranchBinaryRIEe opcode, RegisterOperand cls> class BranchBinaryRS opcode, RegisterOperand cls> : InstRSa { + mnemonic#"\t$R1, $R3, $BD2", []> { let Constraints = "$R1 = $R1src"; let DisableEncoding = "$R1src"; } @@ -2400,7 +2400,7 @@ class BranchBinaryRS opcode, RegisterOperand cls> class BranchBinaryRSY opcode, RegisterOperand cls> : InstRSYa { + mnemonic#"\t$R1, $R3, $BD2", []> { let Constraints = "$R1 = $R1src"; let DisableEncoding = "$R1src"; } @@ -2421,7 +2421,7 @@ class LoadMultipleRSY opcode, RegisterOperand cls, multiclass LoadMultipleRSPair rsOpcode, bits<16> rsyOpcode, RegisterOperand cls> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : LoadMultipleRS; let DispSize = "20" in @@ -2487,7 +2487,7 @@ class StoreRXY opcode, SDPatternOperator operator, multiclass StoreRXPair rxOpcode, bits<16> rxyOpcode, SDPatternOperator operator, RegisterOperand cls, bits<5> bytes> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : StoreRX; let DispSize = "20" in @@ -2567,7 +2567,7 @@ class StoreMultipleRSY opcode, RegisterOperand cls, multiclass StoreMultipleRSPair rsOpcode, bits<16> rsyOpcode, RegisterOperand cls> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : StoreMultipleRS; let DispSize = "20" in @@ -2807,6 +2807,10 @@ class CondUnaryRSY opcode, let mayLoad = 1; let AccessBytes = bytes; let CCMaskLast = 1; + let OpKey = mnemonic#"r"#cls; + let OpType = "mem"; + let MemKey = mnemonic#cls; + let MemType = "target"; } // Like CondUnaryRSY, but used for the raw assembly form. The condition-code @@ -2884,7 +2888,7 @@ class UnaryRXY opcode, SDPatternOperator operator, multiclass UnaryRXPair rxOpcode, bits<16> rxyOpcode, SDPatternOperator operator, RegisterOperand cls, bits<5> bytes> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : UnaryRX; let DispSize = "20" in @@ -2907,13 +2911,15 @@ class UnaryVRIaGeneric opcode, ImmOpWithPattern imm> class UnaryVRRa opcode, SDPatternOperator operator, TypedReg tr1, TypedReg tr2, bits<4> type = 0, bits<4> m4 = 0, - bits<4> m5 = 0> + bits<4> m5 = 0, string fp_mnemonic = ""> : InstVRRa { let M3 = type; let M4 = m4; let M5 = m5; + let OpKey = fp_mnemonic#!subst("VR", "FP", !cast(tr1.op)); + let OpType = "reg"; } class UnaryVRRaGeneric opcode, bits<4> m4 = 0, @@ -2948,7 +2954,7 @@ multiclass UnaryExtraVRRaSPair opcode, def : InstAlias(NAME) tr1.op:$V1, tr2.op:$V2, 0)>; let Defs = [CC] in - def S : UnaryVRRa; } @@ -2992,17 +2998,17 @@ multiclass UnaryVRXAlign opcode> { class SideEffectBinaryRX opcode, RegisterOperand cls> : InstRXa; + mnemonic#"\t$R1, $XBD2", []>; class SideEffectBinaryRXY opcode, RegisterOperand cls> : InstRXYa; + mnemonic#"\t$R1, $XBD2", []>; class SideEffectBinaryRILPC opcode, RegisterOperand cls> : InstRILb { + mnemonic#"\t$R1, $RI2", []> { // We want PC-relative addresses to be tried ahead of BD and BDX addresses. // However, BDXs have two extra operands and are therefore 6 units more // complex. @@ -3045,16 +3051,16 @@ class SideEffectBinarySIL opcode, class SideEffectBinarySSa opcode> : InstSSa; + mnemonic#"\t$BDL1, $BD2", []>; class SideEffectBinarySSb opcode> : InstSSb; + mnemonic#"\t$BDL1, $BDL2", []>; class SideEffectBinarySSf opcode> : InstSSf; + mnemonic#"\t$BD1, $BDL2", []>; class SideEffectBinarySSE opcode> : InstSSE opcode, RegisterOperand cls1, let CCMaskLast = 1; let NumOpsKey = !subst("loc", "sel", mnemonic); let NumOpsValue = "2"; + let OpKey = mnemonic#cls1; + let OpType = "reg"; } // Like CondBinaryRRF, but used for the raw assembly form. The condition-code @@ -3252,6 +3260,8 @@ class CondBinaryRRFa opcode, RegisterOperand cls1, let CCMaskLast = 1; let NumOpsKey = mnemonic; let NumOpsValue = "3"; + let OpKey = mnemonic#cls1; + let OpType = "reg"; } // Like CondBinaryRRFa, but used for the raw assembly form. The condition-code @@ -3299,7 +3309,7 @@ multiclass BinaryRIAndK opcode1, bits<16> opcode2, ImmOpWithPattern imm> { let NumOpsKey = mnemonic in { let NumOpsValue = "3" in - def K : BinaryRIE, + def K : BinaryRIE, Requires<[FeatureDistinctOps]>; let NumOpsValue = "2" in def "" : BinaryRI; @@ -3376,7 +3386,7 @@ multiclass BinaryRSAndK opcode1, bits<16> opcode2, SDPatternOperator operator, RegisterOperand cls> { let NumOpsKey = mnemonic in { let NumOpsValue = "3" in - def K : BinaryRSY, + def K : BinaryRSY, Requires<[FeatureDistinctOps]>; let NumOpsValue = "2" in def "" : BinaryRS; @@ -3448,7 +3458,7 @@ class BinaryRXY opcode, SDPatternOperator operator, multiclass BinaryRXPair rxOpcode, bits<16> rxyOpcode, SDPatternOperator operator, RegisterOperand cls, SDPatternOperator load, bits<5> bytes> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : BinaryRX; @@ -3479,7 +3489,7 @@ class BinarySIY opcode, SDPatternOperator operator, multiclass BinarySIPair siOpcode, bits<16> siyOpcode, SDPatternOperator operator, Operand imm> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : BinarySI; let DispSize = "20" in @@ -3575,7 +3585,7 @@ multiclass BinaryVRRbSPair opcode, def "" : BinaryVRRb; let Defs = [CC] in - def S : BinaryVRRb; } @@ -3604,7 +3614,7 @@ multiclass BinaryExtraVRRbSPair opcode, (!cast(NAME) tr1.op:$V1, tr2.op:$V2, tr2.op:$V3, 0)>; let Defs = [CC] in - def S : BinaryVRRb; + def S : BinaryVRRb; } multiclass BinaryExtraVRRbSPairGeneric opcode> { @@ -3619,7 +3629,7 @@ multiclass BinaryExtraVRRbSPairGeneric opcode> { class BinaryVRRc opcode, SDPatternOperator operator, TypedReg tr1, TypedReg tr2, bits<4> type = 0, bits<4> m5 = 0, - bits<4> m6 = 0> + bits<4> m6 = 0, string fp_mnemonic = ""> : InstVRRc opcode, SDPatternOperator operator, let M4 = type; let M5 = m5; let M6 = m6; + let OpKey = fp_mnemonic#"MemFold"#!subst("VR", "FP", !cast(tr1.op)); + let OpType = "reg"; } class BinaryVRRcGeneric opcode, bits<4> m5 = 0, @@ -3655,7 +3667,7 @@ multiclass BinaryVRRcSPair opcode, def "" : BinaryVRRc; let Defs = [CC] in - def S : BinaryVRRc; } @@ -3752,7 +3764,7 @@ class StoreBinaryRSY opcode, RegisterOperand cls, multiclass StoreBinaryRSPair rsOpcode, bits<16> rsyOpcode, RegisterOperand cls, bits<5> bytes> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : StoreBinaryRS; let DispSize = "20" in @@ -3892,7 +3904,7 @@ class CompareRXY opcode, SDPatternOperator operator, multiclass CompareRXPair rxOpcode, bits<16> rxyOpcode, SDPatternOperator operator, RegisterOperand cls, SDPatternOperator load, bits<5> bytes> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : CompareRX; @@ -3920,7 +3932,7 @@ class CompareRSY opcode, RegisterOperand cls, multiclass CompareRSPair rsOpcode, bits<16> rsyOpcode, RegisterOperand cls, bits<5> bytes> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : CompareRS; let DispSize = "20" in @@ -3931,7 +3943,7 @@ multiclass CompareRSPair rsOpcode, bits<16> rsyOpcode, class CompareSSb opcode> : InstSSb { + mnemonic#"\t$BDL1, $BDL2", []> { let isCompare = 1; let mayLoad = 1; } @@ -3978,7 +3990,7 @@ multiclass CompareSIPair siOpcode, bits<16> siyOpcode, } class CompareVRRa opcode, SDPatternOperator operator, - TypedReg tr, bits<4> type> + TypedReg tr, bits<4> type, string fp_mnemonic = ""> : InstVRRa { @@ -3986,6 +3998,8 @@ class CompareVRRa opcode, SDPatternOperator operator, let M3 = type; let M4 = 0; let M5 = 0; + let OpKey = fp_mnemonic#!subst("VR", "FP", !cast(tr.op)); + let OpType = "reg"; } class CompareVRRaGeneric opcode> @@ -4043,7 +4057,7 @@ class TestVRRg opcode> class SideEffectTernarySSc opcode> : InstSSc; + mnemonic#"\t$BDL1, $BD2, $I3", []>; class SideEffectTernaryRRFa opcode, RegisterOperand cls1, RegisterOperand cls2, @@ -4179,7 +4193,7 @@ class TernaryRSY opcode, RegisterOperand cls, multiclass TernaryRSPair rsOpcode, bits<16> rsyOpcode, RegisterOperand cls, bits<5> bytes> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : TernaryRS; let DispSize = "20" in @@ -4303,7 +4317,7 @@ multiclass TernaryOptVRRbSPair opcode, (!cast(NAME) tr1.op:$V1, tr2.op:$V2, tr2.op:$V3, 0)>; let Defs = [CC] in - def S : TernaryVRRb; def : InstAlias(NAME#"S") tr1.op:$V1, tr2.op:$V2, @@ -4371,7 +4385,7 @@ class TernaryVRRdGeneric opcode> } // Ternary operation where the assembler mnemonic has an extra operand to -// optionally allow specifiying arbitrary M6 values. +// optionally allow specifying arbitrary M6 values. multiclass TernaryExtraVRRd opcode, SDPatternOperator operator, TypedReg tr1, TypedReg tr2, bits<4> type> { @@ -4399,7 +4413,8 @@ multiclass TernaryExtraVRRdGeneric opcode> { } class TernaryVRRe opcode, SDPatternOperator operator, - TypedReg tr1, TypedReg tr2, bits<4> m5 = 0, bits<4> type = 0> + TypedReg tr1, TypedReg tr2, bits<4> m5 = 0, bits<4> type = 0, + string fp_mnemonic = ""> : InstVRRe opcode, SDPatternOperator operator, (tr1.vt tr1.op:$V4)))]> { let M5 = m5; let M6 = type; + let OpKey = fp_mnemonic#"MemFold"#!subst("VR", "FP", !cast(tr1.op)); + let OpType = "reg"; } class TernaryVRReFloatGeneric opcode> @@ -4536,7 +4553,7 @@ multiclass QuaternaryOptVRRdSPair opcode, (!cast(NAME) tr1.op:$V1, tr2.op:$V2, tr2.op:$V3, tr2.op:$V4, 0)>; let Defs = [CC] in - def S : QuaternaryVRRd; def : InstAlias opcode, SDPatternOperator operator, multiclass CmpSwapRSPair rsOpcode, bits<16> rsyOpcode, SDPatternOperator operator, RegisterOperand cls> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { let DispSize = "12" in def "" : CmpSwapRS; let DispSize = "20" in @@ -4650,13 +4667,13 @@ class RotateSelectRIEf opcode, RegisterOperand cls1, class PrefetchRXY opcode, SDPatternOperator operator> : InstRXYb; class PrefetchRILPC opcode, SDPatternOperator operator> : InstRILc { // We want PC-relative addresses to be tried ahead of BD and BDX addresses. // However, BDXs have two extra operands and are therefore 6 units more @@ -4765,7 +4782,9 @@ multiclass BinaryRIAndKPseudo bytes, AddressingMode mode> : Pseudo<(outs cls:$R1), (ins cls:$R2, mode:$XBD2), []> { - let OpKey = mnemonic#"rk"#cls; + let OpKey = !subst("mscrk", "msrkc", + !subst("msgcrk", "msgrkc", + mnemonic#"rk"#cls)); let OpType = "mem"; let MemKey = mnemonic#cls; let MemType = "pseudo"; @@ -4775,6 +4794,40 @@ class MemFoldPseudo bytes, let hasNoSchedulingInfo = 1; } +// Same as MemFoldPseudo but for mapping a W... vector instruction +class MemFoldPseudo_FP bytes, + AddressingMode mode> + : MemFoldPseudo { + let OpKey = mnemonic#"r"#"MemFold"#cls; +} + +class MemFoldPseudo_FPTern bytes, + AddressingMode mode> + : Pseudo<(outs cls:$R1), (ins cls:$R2, cls:$R3, mode:$XBD2), []> { + let OpKey = mnemonic#"r"#"MemFold"#cls; + let OpType = "mem"; + let MemKey = mnemonic#cls; + let MemType = "pseudo"; + let mayLoad = 1; + let AccessBytes = bytes; + let HasIndex = 1; + let hasNoSchedulingInfo = 1; +} + +// Same as MemFoldPseudo but for Load On Condition with CC operands. +class MemFoldPseudo_CondMove bytes, + AddressingMode mode> + : Pseudo<(outs cls:$R1), + (ins cls:$R2, mode:$XBD2, cond4:$valid, cond4:$M3), []> { + let OpKey = !subst("loc", "sel", mnemonic)#"r"#cls; + let OpType = "mem"; + let MemKey = mnemonic#cls; + let MemType = "pseudo"; + let mayLoad = 1; + let AccessBytes = bytes; + let hasNoSchedulingInfo = 1; +} + // Like CompareRI, but expanded after RA depending on the choice of register. class CompareRIPseudo @@ -4813,6 +4866,8 @@ class CondBinaryRRFPseudo // Like CondUnaryRSY, but expanded after RA depending on the choice of // register. -class CondUnaryRSYPseudo bytes, AddressingMode mode = bdaddr20only> +class CondUnaryRSYPseudo bytes, + AddressingMode mode = bdaddr20only> : Pseudo<(outs cls:$R1), (ins cls:$R1src, mode:$BD2, cond4:$valid, cond4:$R3), [(set cls:$R1, @@ -4854,6 +4912,10 @@ class CondUnaryRSYPseudo opcode, SDPatternOperator operator, RegisterOperand cls, SDPatternOperator load, bits<5> bytes, AddressingMode mode = bdxaddr20only> { - def "" : BinaryRXY { let MemKey = mnemonic#cls; let MemType = "target"; @@ -5052,7 +5113,7 @@ multiclass BinaryRXPairAndPseudo rxOpcode, bits<16> rxyOpcode, SDPatternOperator operator, RegisterOperand cls, SDPatternOperator load, bits<5> bytes> { - let DispKey = mnemonic ## #cls in { + let DispKey = mnemonic # cls in { def "" : BinaryRX { let DispSize = "12"; @@ -5066,6 +5127,43 @@ multiclass BinaryRXPairAndPseudo rxOpcode, def _MemFoldPseudo : MemFoldPseudo; } +multiclass BinaryRXEAndPseudo opcode, + SDPatternOperator operator, RegisterOperand cls, + SDPatternOperator load, bits<5> bytes> { + def "" : BinaryRXE { + let MemKey = mnemonic#cls; + let MemType = "target"; + } + def _MemFoldPseudo : MemFoldPseudo_FP; +} + +multiclass TernaryRXFAndPseudo opcode, + SDPatternOperator operator, RegisterOperand cls1, + RegisterOperand cls2, SDPatternOperator load, + bits<5> bytes> { + def "" : TernaryRXF { + let MemKey = mnemonic#cls1; + let MemType = "target"; + } + def _MemFoldPseudo : MemFoldPseudo_FPTern; +} + +multiclass CondUnaryRSYPairAndMemFold opcode, + SDPatternOperator operator, + RegisterOperand cls, bits<5> bytes, + AddressingMode mode = bdaddr20only> { + defm "" : CondUnaryRSYPair; + def _MemFoldPseudo : MemFoldPseudo_CondMove; +} + +multiclass CondUnaryRSYPseudoAndMemFold bytes, + AddressingMode mode = bdaddr20only> { + def "" : CondUnaryRSYPseudo; + def _MemFoldPseudo : MemFoldPseudo_CondMove; +} + // Define an instruction that operates on two fixed-length blocks of memory, // and associated pseudo instructions for operating on blocks of any size. // The Sequence form uses a straight-line sequence of instructions and @@ -5086,7 +5184,7 @@ multiclass MemorySS opcode, } } -// The same, but setting a CC result as comparion operator. +// The same, but setting a CC result as comparison operator. multiclass CompareMemorySS opcode, SDPatternOperator sequence, SDPatternOperator loop> { def "" : SideEffectBinarySSa; -- cgit v1.3