Go to the documentation of this file.
39 #define DEBUG_TYPE "hexagonmcelfstreamer"
45 cl::desc(
"Global Pointer Addressing Size. The default size is 8."),
51 std::unique_ptr<MCObjectWriter> OW, std::unique_ptr<MCCodeEmitter> Emitter)
57 std::unique_ptr<MCObjectWriter> OW, std::unique_ptr<MCCodeEmitter> Emitter,
91 unsigned AccessSize) {
93 StringRef sbss[4] = {
".sbss.1",
".sbss.2",
".sbss.4",
".sbss.8"};
95 auto ELFSymbol = cast<MCSymbolELF>(
Symbol);
96 if (!ELFSymbol->isBindingSet()) {
98 ELFSymbol->setExternal(
true);
105 ((AccessSize == 0) || (Size == 0) || (Size >
GPSize))
113 if (ELFSymbol->isUndefined()) {
127 " redeclared as different type");
128 if ((AccessSize) && (Size <=
GPSize)) {
133 ELFSymbol->setIndex(SectionIndex);
143 unsigned AccessSize) {
145 auto ELFSymbol = cast<MCSymbolELF>(
Symbol);
147 ELFSymbol->setExternal(
false);
154 std::unique_ptr<MCAsmBackend> MAB,
155 std::unique_ptr<MCObjectWriter> OW,
156 std::unique_ptr<MCCodeEmitter> CE) {
void visitUsedExpr(const MCExpr &Expr)
This is an optimization pass for GlobalISel generic memory operations.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
Context object for machine code objects.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Triple - Helper class for working with autoconf configuration names.
static cl::opt< unsigned > GPSize("gpsize", cl::NotHidden, cl::desc("Global Pointer Addressing Size. The default size is 8."), cl::Prefix, cl::init(8))
MCSectionSubPair getCurrentSection() const
Return the current section that the streamer is emitting code to.
Instances of this class represent a single low-level machine instruction.
unsigned getNumOperands() const
Streaming machine code generation interface.
unsigned Log2_64(uint64_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
MCStreamer * createHexagonELFStreamer(Triple const &TT, MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > CE)
MCContext & getContext() const
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
virtual void switchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
iterator_range< Hexagon::PacketIterator > bundleInstructions(MCInstrInfo const &MCII, MCInst const &MCI)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
size_t bundleSize(MCInst const &MCI)
void emitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
MCInstrInfo * createHexagonMCInstrInfo()
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
initializer< Ty > init(const Ty &Val)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
MCAssembler & getAssembler()
StringRef - Represent a constant reference to a string, i.e.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
HexagonMCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
const MCExpr * getExpr() const
unsigned getOpcode() const
void EmitSymbol(const MCInst &Inst)
MCContext & getContext() const
const MCOperand & getOperand(unsigned i) const
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
void HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, unsigned AccessSize)
#define HEXAGON_PACKET_SIZE
Generic base class for all target subtargets.
void HexagonMCEmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, unsigned AccessSize)
void emitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.