Skip to content

Commit 2416f24

Browse files
ricky26mshockwave
authored andcommitted
[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
1 parent a14263e commit 2416f24

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

llvm/lib/Target/M68k/M68kInstrCompiler.td

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def : Pat<(i32 (MxWrapperPC tblockaddress :$src)), (LEA32q tblockaddress :$src)>
5757
let usesCustomInserter = 1, Uses = [CCR] in
5858
class MxCMove<MxType TYPE>
5959
: MxPseudo<(outs TYPE.ROp:$dst), (ins TYPE.ROp:$t, TYPE.ROp:$f, i8imm:$cond),
60-
"",
6160
[(set TYPE.VT:$dst,
6261
(TYPE.VT (MxCmov TYPE.VT:$t, TYPE.VT:$f, imm:$cond, CCR)))]>;
6362

@@ -78,11 +77,11 @@ def CMOV32r : MxCMove<MxType32r>;
7877
let Defs = [SP, CCR], Uses = [SP] in {
7978

8079
def ADJCALLSTACKDOWN
81-
: MxPseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2), "#ADJCALLSTACKDOWN",
80+
: MxPseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),
8281
[(MxCallSeqStart timm:$amt1, timm:$amt2)]>;
8382

8483
def ADJCALLSTACKUP
85-
: MxPseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2), "#ADJCALLSTACKUP",
84+
: MxPseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),
8685
[(MxCallSeqEnd timm:$amt1, timm:$amt2)]>;
8786

8887
} // Defs
@@ -124,5 +123,4 @@ def : Pat<(MxTCRet (i32 texternalsym:$dst), imm:$adj),
124123
let Defs = [SP, CCR], Uses = [SP] in
125124
let usesCustomInserter = 1 in
126125
def SALLOCA : MxPseudo<(outs MxARD32:$dst), (ins MxARD32:$size),
127-
"# variable sized alloca for segmented stacks",
128126
[(set iPTR:$dst, (MxSegAlloca iPTR:$size))]>;

llvm/lib/Target/M68k/M68kInstrControl.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ let isTerminator = 1, isReturn = 1, isBarrier = 1, hasCtrlDep = 1 in {
264264
def RTS : MxInst<(outs), (ins), "rts", [], MxEncFixed<0x4E75>>;
265265

266266
let isCodeGenOnly = 1 in
267-
def RET : MxPseudo<(outs), (ins i32imm:$adj, variable_ops), "",
267+
def RET : MxPseudo<(outs), (ins i32imm:$adj, variable_ops),
268268
[(MxRet timm:$adj)]>;
269269
} // isTerminator = 1, isReturn = 1, isBarrier = 1, hasCtrlDep = 1
270270

@@ -277,11 +277,11 @@ let Uses = [CCR], Defs = [CCR], isPseudo = 1 in {
277277
// FIXME These are pseudo ops that should be replaced with Pat<> patterns.
278278
// However, Pat<> can't replicate the destination reg into the inputs of the
279279
// result.
280-
def SETCS_C8d : MxPseudo<(outs MxDRD8:$dst), (ins), "",
280+
def SETCS_C8d : MxPseudo<(outs MxDRD8:$dst), (ins),
281281
[(set MxDRD8:$dst, (MxSetCC_C MxCONDcs, CCR))]>;
282-
def SETCS_C16d : MxPseudo<(outs MxDRD16:$dst), (ins), "",
282+
def SETCS_C16d : MxPseudo<(outs MxDRD16:$dst), (ins),
283283
[(set MxDRD16:$dst, (MxSetCC_C MxCONDcs, CCR))]>;
284-
def SETCS_C32d : MxPseudo<(outs MxXRD32:$dst), (ins), "",
284+
def SETCS_C32d : MxPseudo<(outs MxXRD32:$dst), (ins),
285285
[(set MxXRD32:$dst, (MxSetCC_C MxCONDcs, CCR))]>;
286286
} // Uses = [CCR], Defs = [CCR], isPseudo = 1
287287

llvm/lib/Target/M68k/M68kInstrData.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,10 +588,10 @@ def POP32r : MxPseudo<(outs XR32:$reg), (ins)>;
588588

589589
let Defs = [CCR] in {
590590
class MxPseudoMove_RR<MxType DST, MxType SRC, list<dag> PAT = []>
591-
: MxPseudo<(outs DST.ROp:$dst), (ins SRC.ROp:$src), "", PAT>;
591+
: MxPseudo<(outs DST.ROp:$dst), (ins SRC.ROp:$src), PAT>;
592592

593593
class MxPseudoMove_RM<MxType DST, MxOperand SRCOpd, list<dag> PAT = []>
594-
: MxPseudo<(outs DST.ROp:$dst), (ins SRCOpd:$src), "", PAT>;
594+
: MxPseudo<(outs DST.ROp:$dst), (ins SRCOpd:$src), PAT>;
595595
}
596596

597597
/// This group of Pseudos is analogues to the real x86 extending moves, but

llvm/lib/Target/M68k/M68kInstrFormats.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ class MxInst<dag outs, dag ins,
364364
}
365365

366366
// M68k PSEUDO INSTRUCTION
367-
class MxPseudo<dag outs, dag ins, string asmStr = "", list<dag> pattern = []>
368-
: MxInst<outs, ins, asmStr, pattern> {
367+
class MxPseudo<dag outs, dag ins, list<dag> pattern = []>
368+
: MxInst<outs, ins, "; error: this should not be emitted", pattern> {
369369
let isPseudo = 1;
370370
}

0 commit comments

Comments
 (0)