LLVM: lib/Target/X86/X86FloatingPoint.cpp File Reference (original) (raw)
Go to the source code of this file.
| Macros | |
|---|---|
| #define | DEBUG_TYPE "x86-fp-stackifier" |
| #define | ASSERT_SORTED(TABLE) |
| Functions | |
|---|---|
| STATISTIC (NumFXCH, "Number of fxch instructions inserted") | |
| STATISTIC (NumFP, "Number of floating point instructions") | |
| INITIALIZE_PASS_BEGIN (X86FPStackifierLegacy, DEBUG_TYPE, "X86 FP Stackifier", false, false) INITIALIZE_PASS_END(X86FPStackifierLegacy | |
| static unsigned | getFPReg (const MachineOperand &MO) |
| getFPReg - Return the X86::FPx register number for the specified operand. | |
| static int | Lookup (ArrayRef< TableEntry > Table, unsigned Opcode) |
| static unsigned | getConcreteOpcode (unsigned Opcode) |
| static bool | doesInstructionSetFPSW (MachineInstr &MI) |
| static MachineBasicBlock::iterator | getNextFPInstruction (MachineBasicBlock::iterator I) |
| Variables | |
|---|---|
| DEBUG_TYPE | |
| X86 FP | Stackifier |
| X86 FP | false |
| static const TableEntry | OpcodeTable [] |
| static const TableEntry | PopTable [] |
| static const TableEntry | ForwardST0Table [] |
| static const TableEntry | ReverseST0Table [] |
| static const TableEntry | ForwardSTiTable [] |
| static const TableEntry | ReverseSTiTable [] |
◆ ASSERT_SORTED
| #define ASSERT_SORTED | ( | TABLE | ) |
|---|
Value:
{ \
static std::atomic TABLE##Checked(false); \
if (!TABLE##Checked.load(std::memory_order_relaxed)) { \
"All lookup tables must be sorted for efficient access!"); \
TABLE##Checked.store(true, std::memory_order_relaxed); \
} \
}
bool is_sorted(R &&Range, Compare C)
Wrapper function around std::is_sorted to check if elements in a range R are sorted with respect to a...
Definition at line 645 of file X86FloatingPoint.cpp.
Referenced by getConcreteOpcode().
◆ DEBUG_TYPE
#define DEBUG_TYPE "x86-fp-stackifier"
◆ doesInstructionSetFPSW()
◆ getConcreteOpcode()
◆ getFPReg()
◆ getNextFPInstruction()
◆ INITIALIZE_PASS_BEGIN()
| INITIALIZE_PASS_BEGIN | ( | X86FPStackifierLegacy | , |
|---|---|---|---|
| DEBUG_TYPE | , | ||
| "X86 FP Stackifier" | , | ||
| false | , | ||
| false | ) |
◆ Lookup()
Definition at line 635 of file X86FloatingPoint.cpp.
References llvm::ArrayRef< T >::end(), I, and llvm::lower_bound().
Referenced by llvm::PointerSumType< TagT, MemberTs... >::cast(), llvm::PointerSumType< TagT, MemberTs... >::create(), llvm::TargetLowering::CTTZTableLookup(), llvm::PointerSumType< TagT, MemberTs... >::get(), getConcreteOpcode(), llvm::getExtInstName(), llvm::getLinkStringForBuiltIn(), llvm::SelectionDAG::getNodeIfExists(), llvm::ConstantUniqueMap< ConstantArray >::getOrCreate(), llvm::ReachingDefInfo::getReachingDef(), llvm::getSpirvBuiltInIdByName(), llvm::getSymbolicOperandMaxVersion(), llvm::getSymbolicOperandMinVersion(), llvm::getSymbolicOperandMnemonic(), llvm::orc::EPCGenericDylibManager::lookup(), llvm::orc::EPCGenericDylibManager::lookup(), llvm::orc::EPCGenericDylibManager::lookupAsync(), llvm::orc::EPCGenericDylibManager::lookupAsync(), llvm::ConstantUniqueMap< ConstantArray >::replaceOperandsInPlace(), llvm::PointerSumType< TagT, MemberTs... >::set(), and llvm::FunctionImporter::SortedImportList::SortedImportList().
◆ STATISTIC() [1/2]
| STATISTIC | ( | NumFP | , |
|---|---|---|---|
| "Number of floating point instructions" | ) |
References TII.
◆ STATISTIC() [2/2]
| STATISTIC | ( | NumFXCH | , |
|---|---|---|---|
| "Number of fxch instructions inserted" | ) |
◆ DEBUG_TYPE
◆ false
◆ ForwardST0Table
Initial value:
= {
{X86::ADD_Fp32, X86::ADD_FST0r}, {X86::ADD_Fp64, X86::ADD_FST0r},
{X86::ADD_Fp80, X86::ADD_FST0r}, {X86::DIV_Fp32, X86::DIV_FST0r},
{X86::DIV_Fp64, X86::DIV_FST0r}, {X86::DIV_Fp80, X86::DIV_FST0r},
{X86::MUL_Fp32, X86::MUL_FST0r}, {X86::MUL_Fp64, X86::MUL_FST0r},
{X86::MUL_Fp80, X86::MUL_FST0r}, {X86::SUB_Fp32, X86::SUB_FST0r},
{X86::SUB_Fp64, X86::SUB_FST0r}, {X86::SUB_Fp80, X86::SUB_FST0r},
}
Definition at line 1309 of file X86FloatingPoint.cpp.
◆ ForwardSTiTable
Initial value:
= {
{X86::ADD_Fp32, X86::ADD_FrST0},
{X86::ADD_Fp64, X86::ADD_FrST0},
{X86::ADD_Fp80, X86::ADD_FrST0},
{X86::DIV_Fp32, X86::DIVR_FrST0},
{X86::DIV_Fp64, X86::DIVR_FrST0},
{X86::DIV_Fp80, X86::DIVR_FrST0},
{X86::MUL_Fp32, X86::MUL_FrST0},
{X86::MUL_Fp64, X86::MUL_FrST0},
{X86::MUL_Fp80, X86::MUL_FrST0},
{X86::SUB_Fp32, X86::SUBR_FrST0},
{X86::SUB_Fp64, X86::SUBR_FrST0},
{X86::SUB_Fp80, X86::SUBR_FrST0},
}
Definition at line 1335 of file X86FloatingPoint.cpp.
◆ OpcodeTable
◆ PopTable
Initial value:
= {
{X86::ADD_FrST0, X86::ADD_FPrST0},
{X86::COMP_FST0r, X86::FCOMPP}, {X86::COM_FIr, X86::COM_FIPr},
{X86::COM_FST0r, X86::COMP_FST0r},
{X86::DIVR_FrST0, X86::DIVR_FPrST0}, {X86::DIV_FrST0, X86::DIV_FPrST0},
{X86::IST_F16m, X86::IST_FP16m}, {X86::IST_F32m, X86::IST_FP32m},
{X86::MUL_FrST0, X86::MUL_FPrST0},
{X86::ST_F32m, X86::ST_FP32m}, {X86::ST_F64m, X86::ST_FP64m},
{X86::ST_Frr, X86::ST_FPrr},
{X86::SUBR_FrST0, X86::SUBR_FPrST0}, {X86::SUB_FrST0, X86::SUB_FPrST0},
{X86::UCOM_FIr, X86::UCOM_FIPr},
{X86::UCOM_FPr, X86::UCOM_FPPr}, {X86::UCOM_Fr, X86::UCOM_FPr},
}
Definition at line 843 of file X86FloatingPoint.cpp.
◆ ReverseST0Table
Initial value:
= {
{X86::ADD_Fp32, X86::ADD_FST0r},
{X86::ADD_Fp64, X86::ADD_FST0r},
{X86::ADD_Fp80, X86::ADD_FST0r},
{X86::DIV_Fp32, X86::DIVR_FST0r},
{X86::DIV_Fp64, X86::DIVR_FST0r},
{X86::DIV_Fp80, X86::DIVR_FST0r},
{X86::MUL_Fp32, X86::MUL_FST0r},
{X86::MUL_Fp64, X86::MUL_FST0r},
{X86::MUL_Fp80, X86::MUL_FST0r},
{X86::SUB_Fp32, X86::SUBR_FST0r},
{X86::SUB_Fp64, X86::SUBR_FST0r},
{X86::SUB_Fp80, X86::SUBR_FST0r},
}
Definition at line 1319 of file X86FloatingPoint.cpp.
◆ ReverseSTiTable
Initial value:
= {
{X86::ADD_Fp32, X86::ADD_FrST0}, {X86::ADD_Fp64, X86::ADD_FrST0},
{X86::ADD_Fp80, X86::ADD_FrST0}, {X86::DIV_Fp32, X86::DIV_FrST0},
{X86::DIV_Fp64, X86::DIV_FrST0}, {X86::DIV_Fp80, X86::DIV_FrST0},
{X86::MUL_Fp32, X86::MUL_FrST0}, {X86::MUL_Fp64, X86::MUL_FrST0},
{X86::MUL_Fp80, X86::MUL_FrST0}, {X86::SUB_Fp32, X86::SUB_FrST0},
{X86::SUB_Fp64, X86::SUB_FrST0}, {X86::SUB_Fp80, X86::SUB_FrST0},
}
Definition at line 1351 of file X86FloatingPoint.cpp.