mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Emit some boilerplate for targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23983 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
99ea9da872
commit
f071bb5b87
@ -1859,6 +1859,35 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
|
||||
<< " SDOperand Tmp0 = Select(N.getOperand(0));\n"
|
||||
<< " if (!N.Val->hasOneUse()) CodeGenMap[N] = Tmp0;\n"
|
||||
<< " return Tmp0;\n"
|
||||
<< " }\n"
|
||||
<< " case ISD::TokenFactor:\n"
|
||||
<< " if (N.getNumOperands() == 2) {\n"
|
||||
<< " SDOperand Op0 = Select(N.getOperand(0));\n"
|
||||
<< " SDOperand Op1 = Select(N.getOperand(1));\n"
|
||||
<< " return CodeGenMap[N] =\n"
|
||||
<< " CurDAG->getNode(ISD::TokenFactor, MVT::Other, Op0, Op1);\n"
|
||||
<< " } else {\n"
|
||||
<< " std::vector<SDOperand> Ops;\n"
|
||||
<< " for (unsigned i = 0, e = N.getNumOperands(); i != e; ++i)\n"
|
||||
<< " Ops.push_back(Select(N.getOperand(i)));\n"
|
||||
<< " return CodeGenMap[N] = \n"
|
||||
<< " CurDAG->getNode(ISD::TokenFactor, MVT::Other, Ops);\n"
|
||||
<< " }\n"
|
||||
<< " case ISD::CopyFromReg: {\n"
|
||||
<< " SDOperand Chain = Select(N.getOperand(0));\n"
|
||||
<< " if (Chain == N.getOperand(0)) return N; // No change\n"
|
||||
<< " SDOperand New = CurDAG->getCopyFromReg(Chain,\n"
|
||||
<< " cast<RegisterSDNode>(N.getOperand(1))->getReg(),\n"
|
||||
<< " N.Val->getValueType(0));\n"
|
||||
<< " return New.getValue(N.ResNo);\n"
|
||||
<< " }\n"
|
||||
<< " case ISD::CopyToReg: {\n"
|
||||
<< " SDOperand Chain = Select(N.getOperand(0));\n"
|
||||
<< " SDOperand Reg = N.getOperand(1);\n"
|
||||
<< " SDOperand Val = Select(N.getOperand(2));\n"
|
||||
<< " return CodeGenMap[N] = \n"
|
||||
<< " CurDAG->getNode(ISD::CopyToReg, MVT::Other,\n"
|
||||
<< " Chain, Reg, Val);\n"
|
||||
<< " }\n";
|
||||
|
||||
// Group the patterns by their top-level opcodes.
|
||||
|
Loading…
Reference in New Issue
Block a user