mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
Completely reject instructions that have an operand in their
ins/outs list that isn't specified by their asmstring. Previously the asmmatcher would just force a 0 register into it, which clearly isn't right. Mark a bunch of ARM instructions that use this as isCodeGenOnly. Some of them are clearly pseudo instructions (like t2TBB) others use a weird hasExtraSrcRegAllocReq thing that will either need to be removed or the asmmatcher will need to be taught about it (someday). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118119 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
e6c6cec82b
commit
a1ca91af4e
3 files changed
+60
-56
No files matched your search
@@ -1176,27 +1176,21 @@ static void EmitConvertToMCInst(CodeGenTarget &Target,
|
||||
continue;
|
||||
}
|
||||
|
||||
// Otherwise, this must be a tied operand if not, it is something that is
|
||||
// mentioned in the ins/outs list but not in the asm string.
|
||||
int TiedOp = OpInfo.getTiedRegister();
|
||||
if (TiedOp == -1)
|
||||
throw TGError(II.TheDef->getLoc(), "Instruction '" +
|
||||
II.TheDef->getName() + "' has operand '" + OpInfo.Name +
|
||||
"' that doesn't appear in asm string!");
|
||||
|
||||
// If this operand is tied to a previous one, just copy the MCInst operand
|
||||
// from the earlier one.
|
||||
int TiedOp = OpInfo.getTiedRegister();
|
||||
if (TiedOp != -1) {
|
||||
// Copy the tied operand. We can only tie single MCOperand values.
|
||||
assert(OpInfo.MINumOperands == 1 && "Not a singular MCOperand");
|
||||
assert(i > unsigned(TiedOp) && "Tied operand preceeds its target!");
|
||||
CaseOS << " Inst.addOperand(Inst.getOperand(" << TiedOp << "));\n";
|
||||
Signature += "__Tie" + itostr(TiedOp);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Otherwise this is some sort of dummy operand that is mentioned in the
|
||||
// ins/outs list but not mentioned in the asmstring, brutalize a dummy
|
||||
// value into the operand.
|
||||
// FIXME: This is a terrible hack: If an MCInst operand doesn't occur in
|
||||
// the asmstring, there is no way to parse something meaningful.
|
||||
// Just assume it is a zero register for now.
|
||||
CaseOS << " Inst.addOperand(MCOperand::CreateReg(0));\n";
|
||||
Signature += "__Imp";
|
||||
// Copy the tied operand. We can only tie single MCOperand values.
|
||||
assert(OpInfo.MINumOperands == 1 && "Not a singular MCOperand");
|
||||
assert(i > unsigned(TiedOp) && "Tied operand preceeds its target!");
|
||||
CaseOS << " Inst.addOperand(Inst.getOperand(" << TiedOp << "));\n";
|
||||
Signature += "__Tie" + itostr(TiedOp);
|
||||
}
|
||||
|
||||
II.ConversionFnKind = Signature;
|
||||
|
||||
Reference in new issue
Block a user