Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/M68k/M68kInstrInfo.cpp
Show First 20 Lines • Show All 603 Lines • ▼ Show 20 Lines | bool M68kInstrInfo::isPCRelRegisterOperandLegal( | ||||
assert(MO.isReg()); | assert(MO.isReg()); | ||||
// Check whether this MO belongs to an instruction with addressing mode 'k', | // Check whether this MO belongs to an instruction with addressing mode 'k', | ||||
// Refer to TargetInstrInfo.h for more information about this function. | // Refer to TargetInstrInfo.h for more information about this function. | ||||
const MachineInstr *MI = MO.getParent(); | const MachineInstr *MI = MO.getParent(); | ||||
const unsigned NameIndices = M68kInstrNameIndices[MI->getOpcode()]; | const unsigned NameIndices = M68kInstrNameIndices[MI->getOpcode()]; | ||||
StringRef InstrName(&M68kInstrNameData[NameIndices]); | StringRef InstrName(&M68kInstrNameData[NameIndices]); | ||||
const unsigned OperandNo = MI->getOperandNo(&MO); | const unsigned OperandNo = MO.getOperandNo(); | ||||
// If this machine operand is the 2nd operand, then check | // If this machine operand is the 2nd operand, then check | ||||
// whether the instruction has destination addressing mode 'k'. | // whether the instruction has destination addressing mode 'k'. | ||||
if (OperandNo == 1) | if (OperandNo == 1) | ||||
return Regex("[A-Z]+(8|16|32)k[a-z](_TC)?$").match(InstrName); | return Regex("[A-Z]+(8|16|32)k[a-z](_TC)?$").match(InstrName); | ||||
// If this machine operand is the last one, then check | // If this machine operand is the last one, then check | ||||
// whether the instruction has source addressing mode 'k'. | // whether the instruction has source addressing mode 'k'. | ||||
▲ Show 20 Lines • Show All 237 Lines • Show Last 20 Lines |