mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
MC: support different sized constants in constant pools
On AArch64 the pseudo instruction ldr <reg>, =... supports both 32-bit and 64-bit constants. Add support for 64 bit constants for the pools to support the pseudo instruction fully. Changes the AArch64 ldr-pseudo tests to use 32-bit registers and adds tests with 64-bit registers. Patch by Janne Grunau! Differential Revision: http://reviews.llvm.org/D4279 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213387 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -22,10 +22,17 @@ class MCExpr;
|
||||
class MCSection;
|
||||
class MCStreamer;
|
||||
class MCSymbol;
|
||||
|
||||
struct ConstantPoolEntry {
|
||||
MCSymbol *Label;
|
||||
const MCExpr *Value;
|
||||
unsigned Size;
|
||||
};
|
||||
|
||||
// A class to keep track of assembler-generated constant pools that are use to
|
||||
// implement the ldr-pseudo.
|
||||
class ConstantPool {
|
||||
typedef SmallVector<std::pair<MCSymbol *, const MCExpr *>, 4> EntryVecTy;
|
||||
typedef SmallVector<ConstantPoolEntry, 4> EntryVecTy;
|
||||
EntryVecTy Entries;
|
||||
|
||||
public:
|
||||
@@ -34,9 +41,11 @@ public:
|
||||
|
||||
// Add a new entry to the constant pool in the next slot.
|
||||
// \param Value is the new entry to put in the constant pool.
|
||||
// \param Size is the size in bytes of the entry
|
||||
//
|
||||
// \returns a MCExpr that references the newly inserted value
|
||||
const MCExpr *addEntry(const MCExpr *Value, MCContext &Context);
|
||||
const MCExpr *addEntry(const MCExpr *Value, MCContext &Context,
|
||||
unsigned Size);
|
||||
|
||||
// Emit the contents of the constant pool using the provided streamer.
|
||||
void emitEntries(MCStreamer &Streamer);
|
||||
@@ -69,7 +78,8 @@ public:
|
||||
|
||||
void emitAll(MCStreamer &Streamer);
|
||||
void emitForCurrentSection(MCStreamer &Streamer);
|
||||
const MCExpr *addEntry(MCStreamer &Streamer, const MCExpr *Expr);
|
||||
const MCExpr *addEntry(MCStreamer &Streamer, const MCExpr *Expr,
|
||||
unsigned Size);
|
||||
|
||||
private:
|
||||
ConstantPool *getConstantPool(const MCSection *Section);
|
||||
|
Reference in New Issue
Block a user