37 return Value & 0xfffc;
40 return Value & 0x3fffffc;
42 return Value & 0xffff;
44 return Value & 0xfffc;
85 {
"fixup_ppc_br24abs", 6, 24, 0 },
86 {
"fixup_ppc_brcond14abs", 16, 14, 0 },
87 {
"fixup_ppc_half16", 0, 16, 0 },
88 {
"fixup_ppc_half16ds", 0, 14, 0 },
89 {
"fixup_ppc_nofixup", 0, 0, 0 }
100 void applyFixup(
const MCFixup &Fixup,
char *Data,
unsigned DataSize,
101 uint64_t
Value)
const {
111 for (
unsigned i = 0; i != NumBytes; ++i)
112 Data[Offset + i] |= uint8_t((Value >> ((NumBytes - i - 1)*8)) & 0xff);
115 bool mayNeedRelaxation(
const MCInst &Inst)
const {
120 bool fixupNeedsRelaxation(
const MCFixup &Fixup,
129 void relaxInstruction(
const MCInst &Inst,
MCInst &Res)
const {
135 uint64_t NumNops = Count / 4;
136 for (uint64_t i = 0; i != NumNops; ++i)
141 case 1: OW->
Write8(0);
break;
151 if (Name ==
"ppc64" || Name ==
"ppc64le")
return 8;
152 assert(Name ==
"ppc32" &&
"Unknown target name!");
161 class DarwinPPCAsmBackend :
public PPCAsmBackend {
163 DarwinPPCAsmBackend(
const Target &
T) : PPCAsmBackend(T) { }
179 class ELFPPCAsmBackend :
public PPCAsmBackend {
182 ELFPPCAsmBackend(
const Target &
T, uint8_t OSABI) :
183 PPCAsmBackend(T), OSABI(OSABI) { }
201 if (
Triple(TT).isOSDarwin())
202 return new DarwinPPCAsmBackend(T);
205 return new ELFPPCAsmBackend(T, OSABI);
MCObjectWriter * createPPCELFObjectWriter(raw_ostream &OS, bool Is64Bit, uint8_t OSABI)
createPPCELFObjectWriter - Construct an PPC ELF object writer.
void Write32(uint32_t Value)
static uint64_t getPointerSize(const Value *V, AliasAnalysis &AA)
#define llvm_unreachable(msg)
static unsigned getFixupKindNumBytes(unsigned Kind)
uint32_t getOffset() const
void Write8(uint8_t Value)
MCAsmBackend * createPPCAsmBackend(const Target &T, const MCRegisterInfo &MRI, StringRef TT, StringRef CPU)
MCFixupKind
MCFixupKind - Extensible enumeration to represent the type of a fixup.
MCFixupKind getKind() const
MCObjectWriter * createPPCMachObjectWriter(raw_ostream &OS, bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
createPPCELFObjectWriter - Construct a PPC Mach-O object writer.
void Write16(uint16_t Value)
MCFixupKindInfo - Target independent information on a fixup kind.
LLVM Value Representation.
MCAsmBackend - Generic interface to target specific assembler backends.
static uint64_t adjustFixupValue(unsigned Kind, uint64_t Value)
const MCRegisterInfo & MRI
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
getFixupKindInfo - Get information on a fixup kind.