llvm.org GIT mirror llvm / 64b3444
Move a check to the validateInstruction() function where it more properly belongs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162954 91177308-0d34-0410-b5e6-96231b3b80d8 Chad Rosier 7 years ago
1 changed file(s) with 13 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
41494149 bool ARMAsmParser::
41504150 cvtThumbMultiply(MCInst &Inst, unsigned Opcode,
41514151 const SmallVectorImpl &Operands) {
4152 // The second source operand must be the same register as the destination
4153 // operand.
4154 if (Operands.size() == 6 &&
4155 (((ARMOperand*)Operands[3])->getReg() !=
4156 ((ARMOperand*)Operands[5])->getReg()) &&
4157 (((ARMOperand*)Operands[3])->getReg() !=
4158 ((ARMOperand*)Operands[4])->getReg())) {
4159 Error(Operands[3]->getStartLoc(),
4160 "destination register must match source register");
4161 return false;
4162 }
41634152 ((ARMOperand*)Operands[3])->addRegOperands(Inst, 1);
41644153 ((ARMOperand*)Operands[1])->addCCOutOperands(Inst, 1);
41654154 // If we have a three-operand form, make sure to set Rn to be the operand
53745363 return Error(Operands[4]->getStartLoc(),
53755364 "writeback operator '!' not allowed when base register "
53765365 "in register list");
5366 break;
5367 }
5368 case ARM::tMUL: {
5369 // The second source operand must be the same register as the destination
5370 // operand.
5371 if (Operands.size() == 6 &&
5372 (((ARMOperand*)Operands[3])->getReg() !=
5373 ((ARMOperand*)Operands[5])->getReg()) &&
5374 (((ARMOperand*)Operands[3])->getReg() !=
5375 ((ARMOperand*)Operands[4])->getReg())) {
5376 Error(Operands[3]->getStartLoc(),
5377 "destination register must match source register");
5378 }
53775379 break;
53785380 }
53795381 // Like for ldm/stm, push and pop have hi-reg handling version in Thumb2,