Go to the documentation of this file.
18 #define DEBUG_TYPE "ppcmcexpr"
68 if (!
Value.isAbsolute())
71 Res = evaluateAsInt64(
Value.getConstant());
76 PPCMCExpr::evaluateAsInt64(int64_t
Value)
const {
79 return Value & 0xffff;
81 return (
Value >> 16) & 0xffff;
83 return ((
Value + 0x8000) >> 16) & 0xffff;
85 return (
Value >> 16) & 0xffff;
87 return ((
Value + 0x8000) >> 16) & 0xffff;
89 return (
Value >> 32) & 0xffff;
91 return ((
Value + 0x8000) >> 32) & 0xffff;
93 return (
Value >> 48) & 0xffff;
95 return ((
Value + 0x8000) >> 48) & 0xffff;
111 if (
Value.isAbsolute()) {
112 int64_t Result = evaluateAsInt64(
Value.getConstant());
118 bool IsHalf = IsHalf16 || IsHalf16DS || IsHalf16DQ;
120 if (!IsHalf && Result >= 0x8000)
122 if ((IsHalf16DS && (Result & 0
x3)) || (IsHalf16DQ && (Result & 0xf)))
VariantKind getKind() const
void visitUsedExpr(const MCExpr &Expr)
This is an optimization pass for GlobalISel generic memory operations.
Context object for machine code objects.
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const override
This class is intended to be used as a base class for asm properties and features specific to the tar...
const MCExpr * getSubExpr() const
getSubExpr - Get the child of this expression.
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
Streaming machine code generation interface.
In x86 we generate this spiffy xmm0 xmm0 ret in x86 we generate this which could be xmm1 movss xmm1 xmm0 ret In sse4 we could use insertps to make both better Here s another testcase that could use x3
MCContext & getContext() const
@ fixup_ppc_half16dq
A 16-bit fixup corresponding to lo16(_foo) with implied 3 zero bits for instrs like 'lxv'.
This class implements an extremely fast bulk output stream that can only output to a stream.
const MCSymbol & getSymbol() const
@ fixup_ppc_half16
A 16-bit fixup corresponding to lo16(_foo) or ha16(_foo) for instrs like 'li' or 'addis'.
static MCValue get(const MCSymbolRefExpr *SymA, const MCSymbolRefExpr *SymB=nullptr, int64_t Val=0, uint32_t RefKind=0)
Represent a reference to a symbol from inside an expression.
@ fixup_ppc_half16ds
A 14-bit fixup corresponding to lo16(_foo) with implied 2 zero bits for instrs like 'std'.
PowerPC TLS Dynamic Call Fixup
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static const PPCMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
Encapsulates the layout of an assembly file at a particular point in time.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
bool evaluateAsConstant(int64_t &Res) const
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
void visitUsedExpr(MCStreamer &Streamer) const override
MCAssembler & getAssembler() const
Get the assembler object this is a layout for.
This represents an "assembler immediate".
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
LLVM Value Representation.
Base class for the full range of assembler expressions which are needed for parsing.