Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,13 @@ class MipsMCInstrAnalysis : public MCInstrAnalysis {
switch (Info->get(Inst.getOpcode()).operands()[NumOps - 1].OperandType) {
case MCOI::OPERAND_UNKNOWN:
case MCOI::OPERAND_IMMEDIATE: {
const MCOperand& Op = Inst.getOperand(NumOps - 1);
if (!Op.isImm())
return false;
// j, jal, jalx, jals
// Absolute branch within the current 256 MB-aligned region
uint64_t Region = Addr & ~uint64_t(0xfffffff);
Target = Region + Inst.getOperand(NumOps - 1).getImm();
Target = Region + Op.getImm();
return true;
}
case MCOI::OPERAND_PCREL:
Expand Down
Loading