LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

X86FloatingPoint.cpp File Reference

#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 <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

FunctionPassllvm::createX86FloatingPointStackifierPass ()
static bool TableIsSorted (const TableEntry *Table, unsigned NumEntries)
static int Lookup (const TableEntry *Table, unsigned N, unsigned Opcode)
static unsigned getFPReg (const MachineOperand &MO)

Variables

static const TableEntry PopTable []
static const TableEntry ForwardST0Table []
static const TableEntry ReverseST0Table []
static const TableEntry ForwardSTiTable []
static const TableEntry ReverseSTiTable []


Define Documentation

#define ARRAY_SIZE TABLE   )     (sizeof(TABLE)/sizeof(TABLE[0]))
 

Definition at line 284 of file X86FloatingPoint.cpp.

#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 290 of file X86FloatingPoint.cpp.

#define DEBUG_TYPE   "fp"
 

Definition at line 31 of file X86FloatingPoint.cpp.


Function Documentation

static unsigned getFPReg const MachineOperand MO  )  [static]
 

Definition at line 377 of file X86FloatingPoint.cpp.

References llvm::MachineOperand::getReg(), and llvm::MachineOperand::isRegister().

static int Lookup const TableEntry *  Table,
unsigned  N,
unsigned  Opcode
[static]
 

Definition at line 277 of file X86FloatingPoint.cpp.

static bool TableIsSorted const TableEntry *  Table,
unsigned  NumEntries
[static]
 

Definition at line 271 of file X86FloatingPoint.cpp.


Variable Documentation

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 478 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 494 of file X86FloatingPoint.cpp.

Statistic NumFP("x86-codegen","Number of floating point instructions") [static]
 

Statistic NumFXCH("x86-codegen","Number of fxch instructions inserted") [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 306 of file X86FloatingPoint.cpp.

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 486 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 502 of file X86FloatingPoint.cpp.