|
LLVM 22.0.0git
|
#include "MCTargetDesc/X86BaseInfo.h"#include "MCTargetDesc/X86FixupKinds.h"#include "MCTargetDesc/X86MCAsmInfo.h"#include "MCTargetDesc/X86MCTargetDesc.h"#include "llvm/ADT/SmallVector.h"#include "llvm/BinaryFormat/ELF.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 37 of file X86MCCodeEmitter.cpp.
| Enumerator | |
|---|---|
| GOT_None | |
| GOT_Normal | |
| GOT_SymDiff | |
Definition at line 466 of file X86MCCodeEmitter.cpp.
|
static |
Definition at line 406 of file X86MCCodeEmitter.cpp.
References Size.
|
static |
Definition at line 442 of file X86MCCodeEmitter.cpp.
References llvm::FK_Data_1, llvm::FK_Data_2, llvm::FK_Data_4, llvm::FK_Data_8, llvm::X86II::getSizeOfImm(), llvm::X86II::isImmSigned(), llvm_unreachable, llvm::X86::reloc_signed_4byte, and Size.
Referenced by isPCRel32Branch().
Definition at line 497 of file X86MCCodeEmitter.cpp.
References llvm::MCExpr::getKind(), llvm::Ref, llvm::X86::S_COFF_SECREL, and llvm::MCExpr::SymbolRef.
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 418 of file X86MCCodeEmitter.cpp.
References assert(), llvm::X86II::CD8_Scale_Mask, llvm::X86II::CD8_Scale_Shift, llvm::X86II::EncodingMask, llvm::X86II::EVEX, llvm::isInt(), and llvm::isPowerOf2_32().
|
static |
Definition at line 505 of file X86MCCodeEmitter.cpp.
References llvm::dyn_cast(), llvm::FK_Data_4, llvm::MCInstrInfo::get(), getImmFixupKind(), llvm::X86II::getOperandBias(), llvm::X86II::isImmPCRel(), MI, llvm::Ref, and llvm::X86::S_None.
Definition at line 401 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.
TODO: Move this to X86AsmBackend.cpp at relocation decision phase so that we don't have to mess with MCExpr.
Definition at line 477 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.