LLVM 20.0.0git
|
#include "MCTargetDesc/X86BaseInfo.h"
#include "MCTargetDesc/X86FixupKinds.h"
#include "MCTargetDesc/X86MCTargetDesc.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixup.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include <cstdint>
#include <cstdlib>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "mccodeemitter" |
Enumerations | |
enum | GlobalOffsetTableExprKind { GOT_None , GOT_Normal , GOT_SymDiff } |
Functions | |
static uint8_t | modRMByte (unsigned Mod, unsigned RegOpcode, unsigned RM) |
static void | emitConstant (uint64_t Val, unsigned Size, SmallVectorImpl< char > &CB) |
static bool | isDispOrCDisp8 (uint64_t TSFlags, int Value, int &ImmOffset) |
Determine if this immediate can fit in a disp8 or a compressed disp8 for EVEX instructions. | |
static MCFixupKind | getImmFixupKind (uint64_t TSFlags) |
static GlobalOffsetTableExprKind | startsWithGlobalOffsetTable (const MCExpr *Expr) |
Check if this expression starts with GLOBAL_OFFSET_TABLE and if it is of the form GLOBAL_OFFSET_TABLE-symbol. | |
static bool | hasSecRelSymbolRef (const MCExpr *Expr) |
static bool | isPCRel32Branch (const MCInst &MI, const MCInstrInfo &MCII) |
#define DEBUG_TYPE "mccodeemitter" |
Definition at line 35 of file X86MCCodeEmitter.cpp.
Enumerator | |
---|---|
GOT_None | |
GOT_Normal | |
GOT_SymDiff |
Definition at line 455 of file X86MCCodeEmitter.cpp.
|
static |
Definition at line 404 of file X86MCCodeEmitter.cpp.
References Size.
|
static |
Definition at line 440 of file X86MCCodeEmitter.cpp.
References llvm::MCFixup::getKindForSize(), llvm::X86II::getSizeOfImm(), llvm::X86II::isImmPCRel(), llvm::X86II::isImmSigned(), isPCRel(), llvm_unreachable, llvm::X86::reloc_signed_4byte, and Size.
Referenced by isPCRel32Branch().
Definition at line 483 of file X86MCCodeEmitter.cpp.
References llvm::MCExpr::getKind(), llvm::Ref, llvm::MCExpr::SymbolRef, and llvm::MCSymbolRefExpr::VK_SECREL.
Determine if this immediate can fit in a disp8 or a compressed disp8 for EVEX instructions.
will
be set to the value to pass to the ImmOffset parameter of emitImmediate.
Definition at line 416 of file X86MCCodeEmitter.cpp.
References assert(), llvm::X86II::CD8_Scale_Mask, llvm::X86II::CD8_Scale_Shift, llvm::X86II::EncodingMask, llvm::X86II::EVEX, and llvm::isPowerOf2_32().
|
static |
Definition at line 491 of file X86MCCodeEmitter.cpp.
References llvm::FK_PCRel_4, llvm::MCInstrInfo::get(), getImmFixupKind(), llvm::X86II::getOperandBias(), MI, llvm::Ref, and llvm::MCSymbolRefExpr::VK_None.
Definition at line 399 of file X86MCCodeEmitter.cpp.
|
static |
Check if this expression starts with GLOBAL_OFFSET_TABLE and if it is of the form GLOBAL_OFFSET_TABLE-symbol.
This is needed to support PIC on ELF i386 as GLOBAL_OFFSET_TABLE is magical. We check only simple case that are know to be used: GLOBAL_OFFSET_TABLE by itself or at the start of a binary expression.
Definition at line 463 of file X86MCCodeEmitter.cpp.
References llvm::MCExpr::Binary, llvm::MCExpr::getKind(), llvm::MCBinaryExpr::getLHS(), llvm::MCSymbol::getName(), llvm::MCBinaryExpr::getRHS(), GOT_None, GOT_Normal, GOT_SymDiff, llvm::Ref, RHS, and llvm::MCExpr::SymbolRef.