Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | unsigned BPFMCCodeEmitter::getMachineOpValue(const MCInst &MI, | ||||
const MCExpr *Expr = MO.getExpr(); | const MCExpr *Expr = MO.getExpr(); | ||||
assert(Expr->getKind() == MCExpr::SymbolRef); | assert(Expr->getKind() == MCExpr::SymbolRef); | ||||
if (MI.getOpcode() == BPF::JAL) | if (MI.getOpcode() == BPF::JAL) | ||||
// func call name | // func call name | ||||
Fixups.push_back(MCFixup::create(0, Expr, FK_PCRel_4)); | Fixups.push_back(MCFixup::create(0, Expr, FK_PCRel_4)); | ||||
else if (MI.getOpcode() == BPF::LD_imm64) | else if (MI.getOpcode() == BPF::LD_imm64) | ||||
Fixups.push_back(MCFixup::create(0, Expr, FK_SecRel_8)); | Fixups.push_back(MCFixup::create(0, Expr, FK_SecRel_4)); | ||||
else | else | ||||
// bb label | // bb label | ||||
Fixups.push_back(MCFixup::create(0, Expr, FK_PCRel_2)); | Fixups.push_back(MCFixup::create(0, Expr, FK_PCRel_2)); | ||||
return 0; | return 0; | ||||
} | } | ||||
static uint8_t SwapBits(uint8_t Val) | static uint8_t SwapBits(uint8_t Val) | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |