// $Id$
//***************************************************************************
// File:
// SparcInstrSelection.cpp
//
// Purpose:
//
// History:
// 7/02/01 - Vikram Adve - Created
//***************************************************************************
#include "llvm/Type.h"
#include "llvm/DerivedTypes.h"
#include "llvm/SymbolTable.h"
#include "llvm/Value.h"
#include "llvm/Instruction.h"
#include "llvm/InstrTypes.h"
#include "llvm/iTerminators.h"
#include "llvm/iMemory.h"
#include "llvm/iOther.h"
#include "llvm/BasicBlock.h"
#include "llvm/Method.h"
#include "llvm/ConstPoolVals.h"
#include "llvm/CodeGen/Sparc.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/InstrForest.h"
#include "llvm/CodeGen/InstrSelection.h"
//******************** Internal Data Declarations ************************/
// to be used later
struct BranchPattern {
bool flipCondition; // should the sense of the test be reversed
BasicBlock* targetBB; // which basic block to branch to
MachineInstr* extraBranch; // if neither branch is fall-through, then this
// BA must be inserted after the cond'l one
};
//************************* Forward Declarations ***************************/
static MachineOpCode ChooseBprInstruction (const InstructionNode* instrNod);
static MachineOpCode ChooseBccInstruction (const InstructionNode* instrNode,
bool& isFPBranch);
static MachineOpCode ChooseBpccInstruction (const InstructionNode* instrNode,
const BinaryOperator* setCCInst);
static MachineOpCode ChooseBfpccInstruction (const InstructionNode* instrNode,
const BinaryOperator* setCCInst);
static