LLVM API Documentation
#include "X86.h"
#include "X86InstrInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include <algorithm>
#include <iostream>
#include <set>
Include dependency graph for X86FloatingPoint.cpp:
Go to the source code of this file.
Defines | |
#define | DEBUG_TYPE "fp" |
#define | ARRAY_SIZE(TABLE) (sizeof(TABLE)/sizeof(TABLE[0])) |
#define | ASSERT_SORTED(TABLE) |
Functions | |
FunctionPass * | llvm::createX86FloatingPointStackifierPass () |
static bool | TableIsSorted (const TableEntry *Table, unsigned NumEntries) |
static int | Lookup (const TableEntry *Table, unsigned N, unsigned Opcode) |
static unsigned | getConcreteOpcode (unsigned Opcode) |
static unsigned | getFPReg (const MachineOperand &MO) |
Variables | |
Statistic | NumFXCH ("x86-codegen","Number of fxch instructions inserted") |
Statistic | NumFP ("x86-codegen","Number of floating point instructions") |
LiveVariables * | LV |
MachineBasicBlock * | MBB |
unsigned | Stack [8] |
unsigned | RegMap [8] |
unsigned | StackTop |
unsigned | from |
unsigned | to |
static const TableEntry | OpcodeTable [] |
static const TableEntry | PopTable [] |
static const TableEntry | ForwardST0Table [] |
static const TableEntry | ReverseST0Table [] |
static const TableEntry | ForwardSTiTable [] |
static const TableEntry | ReverseSTiTable [] |
#define ARRAY_SIZE | ( | TABLE | ) | (sizeof(TABLE)/sizeof(TABLE[0])) |
#define ASSERT_SORTED | ( | TABLE | ) |
Value:
{ static bool TABLE##Checked = false; \ if (!TABLE##Checked) \ assert(TableIsSorted(TABLE, ARRAY_SIZE(TABLE)) && \ "All lookup tables must be sorted for efficient access!"); \ }
Definition at line 312 of file X86FloatingPoint.cpp.
Referenced by getConcreteOpcode().
#define DEBUG_TYPE "fp" |
Definition at line 31 of file X86FloatingPoint.cpp.
static unsigned getConcreteOpcode | ( | unsigned | Opcode | ) | [static] |
Definition at line 386 of file X86FloatingPoint.cpp.
References ARRAY_SIZE, ASSERT_SORTED, Lookup(), and OpcodeTable.
static unsigned getFPReg | ( | const MachineOperand & | MO | ) | [static] |
Definition at line 471 of file X86FloatingPoint.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::isRegister(), and Reg.
static int Lookup | ( | const TableEntry * | Table, | |
unsigned | N, | |||
unsigned | Opcode | |||
) | [static] |
Definition at line 299 of file X86FloatingPoint.cpp.
Referenced by getConcreteOpcode(), llvm::ConstantStruct::replaceUsesOfWithOnConstant(), and llvm::ConstantArray::replaceUsesOfWithOnConstant().
static bool TableIsSorted | ( | const TableEntry * | Table, | |
unsigned | NumEntries | |||
) | [static] |
Definition at line 293 of file X86FloatingPoint.cpp.
const TableEntry ForwardST0Table[] [static] |
Initial value:
{ { X86::FpADD , X86::FADDST0r }, { X86::FpDIV , X86::FDIVST0r }, { X86::FpMUL , X86::FMULST0r }, { X86::FpSUB , X86::FSUBST0r }, }
Definition at line 581 of file X86FloatingPoint.cpp.
const TableEntry ForwardSTiTable[] [static] |
Initial value:
{ { X86::FpADD , X86::FADDrST0 }, { X86::FpDIV , X86::FDIVRrST0 }, { X86::FpMUL , X86::FMULrST0 }, { X86::FpSUB , X86::FSUBRrST0 }, }
Definition at line 597 of file X86FloatingPoint.cpp.
unsigned from |
Definition at line 281 of file X86FloatingPoint.cpp.
Definition at line 63 of file X86FloatingPoint.cpp.
Definition at line 64 of file X86FloatingPoint.cpp.
Referenced by llvm::LiveIntervals::addIntervalsForSpills(), llvm::MachineInstr::addMachineBasicBlockOperand(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineFunction::addToMBBNumbering(), llvm::AppendInstructions(), llvm::ChooseInstructionsForDelaySlots(), llvm::LiveRangeInfo::coalesceLRs(), llvm::LiveRangeInfo::constructLiveRanges(), llvm::X86RegisterInfo::copyRegToReg(), llvm::SparcRegisterInfo::copyRegToReg(), llvm::PPCRegisterInfo::copyRegToReg(), llvm::IA64RegisterInfo::copyRegToReg(), llvm::AlphaRegisterInfo::copyRegToReg(), llvm::ilist_traits< MachineBasicBlock >::destroySentinel(), llvm::X86RegisterInfo::eliminateCallFramePseudoInstr(), llvm::SparcRegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPCRegisterInfo::eliminateCallFramePseudoInstr(), llvm::IA64RegisterInfo::eliminateCallFramePseudoInstr(), llvm::AlphaRegisterInfo::eliminateCallFramePseudoInstr(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::IA64RegisterInfo::eliminateFrameIndex(), llvm::AlphaRegisterInfo::eliminateFrameIndex(), llvm::X86RegisterInfo::emitEpilogue(), llvm::SparcRegisterInfo::emitEpilogue(), llvm::PPCRegisterInfo::emitEpilogue(), llvm::IA64RegisterInfo::emitEpilogue(), llvm::AlphaRegisterInfo::emitEpilogue(), llvm::X86RegisterInfo::emitPrologue(), llvm::SparcRegisterInfo::emitPrologue(), llvm::PPCRegisterInfo::emitPrologue(), llvm::IA64RegisterInfo::emitPrologue(), llvm::AlphaRegisterInfo::emitPrologue(), llvm::X86RegisterInfo::foldMemoryOperand(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), llvm::BasicBlockSDNode::getBasicBlock(), llvm::SelectionDAG::getBasicBlock(), llvm::SchedGraphNode::getMachineBasicBlock(), llvm::LiveVariables::HandleVirtRegUse(), llvm::InsertAfter(), llvm::InsertBefore(), llvm::X86InstrInfo::insertGoto(), llvm::PPCInstrInfo::insertNoop(), llvm::X86RegisterInfo::loadRegFromStackSlot(), llvm::SparcRegisterInfo::loadRegFromStackSlot(), llvm::PPCRegisterInfo::loadRegFromStackSlot(), llvm::IA64RegisterInfo::loadRegFromStackSlot(), llvm::AlphaRegisterInfo::loadRegFromStackSlot(), llvm::MachineInstr::MachineInstr(), llvm::LiveVariables::MarkVirtRegAliveInBlock(), llvm::MSchedGraphSB::MSchedGraphSB(), llvm::operator<<(), llvm::PrependInstructions(), llvm::RecordSchedule(), llvm::ReplaceNopsWithUsefulInstr(), llvm::X86InstrInfo::reverseBranchCondition(), llvm::PeepholeOpts::runOnBasicBlock(), llvm::LiveVariables::runOnMachineFunction(), llvm::X86RegisterInfo::storeRegToStackSlot(), llvm::SparcRegisterInfo::storeRegToStackSlot(), llvm::PPCRegisterInfo::storeRegToStackSlot(), llvm::IA64RegisterInfo::storeRegToStackSlot(), and llvm::AlphaRegisterInfo::storeRegToStackSlot().
const TableEntry OpcodeTable[] [static] |
const TableEntry PopTable[] [static] |
Initial value:
{ { X86::FADDrST0 , X86::FADDPrST0 }, { X86::FDIVRrST0, X86::FDIVRPrST0 }, { X86::FDIVrST0 , X86::FDIVPrST0 }, { X86::FIST16m , X86::FISTP16m }, { X86::FIST32m , X86::FISTP32m }, { X86::FMULrST0 , X86::FMULPrST0 }, { X86::FST32m , X86::FSTP32m }, { X86::FST64m , X86::FSTP64m }, { X86::FSTrr , X86::FSTPrr }, { X86::FSUBRrST0, X86::FSUBRPrST0 }, { X86::FSUBrST0 , X86::FSUBPrST0 }, { X86::FUCOMIr , X86::FUCOMIPr }, { X86::FUCOMPr , X86::FUCOMPPr }, { X86::FUCOMr , X86::FUCOMPr }, }
Definition at line 400 of file X86FloatingPoint.cpp.
unsigned RegMap[8] |
Definition at line 66 of file X86FloatingPoint.cpp.
Referenced by CreateVirtualRegisters(), and llvm::PPCTargetLowering::LowerArguments().
const TableEntry ReverseST0Table[] [static] |
Initial value:
{ { X86::FpADD , X86::FADDST0r }, { X86::FpDIV , X86::FDIVRST0r }, { X86::FpMUL , X86::FMULST0r }, { X86::FpSUB , X86::FSUBRST0r }, }
Definition at line 589 of file X86FloatingPoint.cpp.
const TableEntry ReverseSTiTable[] [static] |
Initial value:
{ { X86::FpADD , X86::FADDrST0 }, { X86::FpDIV , X86::FDIVrST0 }, { X86::FpMUL , X86::FMULrST0 }, { X86::FpSUB , X86::FSUBrST0 }, }
Definition at line 605 of file X86FloatingPoint.cpp.
unsigned Stack[8] |
Definition at line 65 of file X86FloatingPoint.cpp.
unsigned StackTop |
Definition at line 67 of file X86FloatingPoint.cpp.
unsigned to |
Definition at line 282 of file X86FloatingPoint.cpp.