From 2416f2436334450d216c7aa62a6624dc17765228 Mon Sep 17 00:00:00 2001 From: Ricky Taylor Date: Wed, 17 Mar 2021 13:29:02 -0700 Subject: [PATCH] [M68k] Use fixed asm string for MxPseudo instructions This is required because empty strings are not allowed when generating the assembly parser tables. Differential Revision: https://reviews.llvm.org/D98532 --- llvm/lib/Target/M68k/M68kInstrCompiler.td | 6 ++---- llvm/lib/Target/M68k/M68kInstrControl.td | 8 ++++---- llvm/lib/Target/M68k/M68kInstrData.td | 4 ++-- llvm/lib/Target/M68k/M68kInstrFormats.td | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/llvm/lib/Target/M68k/M68kInstrCompiler.td b/llvm/lib/Target/M68k/M68kInstrCompiler.td index 4d1d207..bcb815d 100644 --- a/llvm/lib/Target/M68k/M68kInstrCompiler.td +++ b/llvm/lib/Target/M68k/M68kInstrCompiler.td @@ -57,7 +57,6 @@ def : Pat<(i32 (MxWrapperPC tblockaddress :$src)), (LEA32q tblockaddress :$src)> let usesCustomInserter = 1, Uses = [CCR] in class MxCMove : MxPseudo<(outs TYPE.ROp:$dst), (ins TYPE.ROp:$t, TYPE.ROp:$f, i8imm:$cond), - "", [(set TYPE.VT:$dst, (TYPE.VT (MxCmov TYPE.VT:$t, TYPE.VT:$f, imm:$cond, CCR)))]>; @@ -78,11 +77,11 @@ def CMOV32r : MxCMove; let Defs = [SP, CCR], Uses = [SP] in { def ADJCALLSTACKDOWN - : MxPseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2), "#ADJCALLSTACKDOWN", + : MxPseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2), [(MxCallSeqStart timm:$amt1, timm:$amt2)]>; def ADJCALLSTACKUP - : MxPseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2), "#ADJCALLSTACKUP", + : MxPseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2), [(MxCallSeqEnd timm:$amt1, timm:$amt2)]>; } // Defs @@ -124,5 +123,4 @@ def : Pat<(MxTCRet (i32 texternalsym:$dst), imm:$adj), let Defs = [SP, CCR], Uses = [SP] in let usesCustomInserter = 1 in def SALLOCA : MxPseudo<(outs MxARD32:$dst), (ins MxARD32:$size), - "# variable sized alloca for segmented stacks", [(set iPTR:$dst, (MxSegAlloca iPTR:$size))]>; diff --git a/llvm/lib/Target/M68k/M68kInstrControl.td b/llvm/lib/Target/M68k/M68kInstrControl.td index 567e6b0..7084747 100644 --- a/llvm/lib/Target/M68k/M68kInstrControl.td +++ b/llvm/lib/Target/M68k/M68kInstrControl.td @@ -264,7 +264,7 @@ let isTerminator = 1, isReturn = 1, isBarrier = 1, hasCtrlDep = 1 in { def RTS : MxInst<(outs), (ins), "rts", [], MxEncFixed<0x4E75>>; let isCodeGenOnly = 1 in -def RET : MxPseudo<(outs), (ins i32imm:$adj, variable_ops), "", +def RET : MxPseudo<(outs), (ins i32imm:$adj, variable_ops), [(MxRet timm:$adj)]>; } // isTerminator = 1, isReturn = 1, isBarrier = 1, hasCtrlDep = 1 @@ -277,11 +277,11 @@ let Uses = [CCR], Defs = [CCR], isPseudo = 1 in { // FIXME These are pseudo ops that should be replaced with Pat<> patterns. // However, Pat<> can't replicate the destination reg into the inputs of the // result. -def SETCS_C8d : MxPseudo<(outs MxDRD8:$dst), (ins), "", +def SETCS_C8d : MxPseudo<(outs MxDRD8:$dst), (ins), [(set MxDRD8:$dst, (MxSetCC_C MxCONDcs, CCR))]>; -def SETCS_C16d : MxPseudo<(outs MxDRD16:$dst), (ins), "", +def SETCS_C16d : MxPseudo<(outs MxDRD16:$dst), (ins), [(set MxDRD16:$dst, (MxSetCC_C MxCONDcs, CCR))]>; -def SETCS_C32d : MxPseudo<(outs MxXRD32:$dst), (ins), "", +def SETCS_C32d : MxPseudo<(outs MxXRD32:$dst), (ins), [(set MxXRD32:$dst, (MxSetCC_C MxCONDcs, CCR))]>; } // Uses = [CCR], Defs = [CCR], isPseudo = 1 diff --git a/llvm/lib/Target/M68k/M68kInstrData.td b/llvm/lib/Target/M68k/M68kInstrData.td index 74db3a3..40b9e4a 100644 --- a/llvm/lib/Target/M68k/M68kInstrData.td +++ b/llvm/lib/Target/M68k/M68kInstrData.td @@ -588,10 +588,10 @@ def POP32r : MxPseudo<(outs XR32:$reg), (ins)>; let Defs = [CCR] in { class MxPseudoMove_RR PAT = []> - : MxPseudo<(outs DST.ROp:$dst), (ins SRC.ROp:$src), "", PAT>; + : MxPseudo<(outs DST.ROp:$dst), (ins SRC.ROp:$src), PAT>; class MxPseudoMove_RM PAT = []> - : MxPseudo<(outs DST.ROp:$dst), (ins SRCOpd:$src), "", PAT>; + : MxPseudo<(outs DST.ROp:$dst), (ins SRCOpd:$src), PAT>; } /// This group of Pseudos is analogues to the real x86 extending moves, but diff --git a/llvm/lib/Target/M68k/M68kInstrFormats.td b/llvm/lib/Target/M68k/M68kInstrFormats.td index b00db49..b147537 100644 --- a/llvm/lib/Target/M68k/M68kInstrFormats.td +++ b/llvm/lib/Target/M68k/M68kInstrFormats.td @@ -364,7 +364,7 @@ class MxInst pattern = []> - : MxInst { +class MxPseudo pattern = []> + : MxInst { let isPseudo = 1; } -- 2.7.4