2002-08-09 20:08:06 +00:00
|
|
|
//===-- SparcInternals.h ----------------------------------------*- C++ -*-===//
|
2001-11-08 04:55:13 +00:00
|
|
|
//
|
2003-10-21 15:17:13 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2002-08-09 20:08:06 +00:00
|
|
|
// This file defines stuff that is to be private to the Sparc backend, but is
|
|
|
|
// shared among different portions of the backend.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2001-09-14 03:56:45 +00:00
|
|
|
|
|
|
|
#ifndef SPARC_INTERNALS_H
|
|
|
|
#define SPARC_INTERNALS_H
|
|
|
|
|
2003-05-24 00:09:50 +00:00
|
|
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
2001-09-18 22:52:44 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2002-12-29 03:13:05 +00:00
|
|
|
#include "llvm/Target/TargetSchedInfo.h"
|
2002-12-28 21:00:25 +00:00
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
2002-12-29 02:50:33 +00:00
|
|
|
#include "llvm/Target/TargetCacheInfo.h"
|
2002-12-29 03:13:05 +00:00
|
|
|
#include "llvm/Target/TargetRegInfo.h"
|
2001-09-14 03:56:45 +00:00
|
|
|
#include "llvm/Type.h"
|
2003-05-24 00:09:50 +00:00
|
|
|
#include "SparcRegClassInfo.h"
|
2003-06-30 21:59:07 +00:00
|
|
|
#include "Config/sys/types.h"
|
2001-09-14 03:56:45 +00:00
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
namespace llvm {
|
|
|
|
|
2002-02-03 23:42:19 +00:00
|
|
|
class LiveRange;
|
2003-12-17 22:04:00 +00:00
|
|
|
class SparcTargetMachine;
|
2002-04-09 05:16:36 +00:00
|
|
|
class Pass;
|
2002-02-03 23:42:19 +00:00
|
|
|
|
2001-09-14 03:56:45 +00:00
|
|
|
enum SparcInstrSchedClass {
|
|
|
|
SPARC_NONE, /* Instructions with no scheduling restrictions */
|
|
|
|
SPARC_IEUN, /* Integer class that can use IEU0 or IEU1 */
|
|
|
|
SPARC_IEU0, /* Integer class IEU0 */
|
|
|
|
SPARC_IEU1, /* Integer class IEU1 */
|
|
|
|
SPARC_FPM, /* FP Multiply or Divide instructions */
|
|
|
|
SPARC_FPA, /* All other FP instructions */
|
|
|
|
SPARC_CTI, /* Control-transfer instructions */
|
|
|
|
SPARC_LD, /* Load instructions */
|
|
|
|
SPARC_ST, /* Store instructions */
|
|
|
|
SPARC_SINGLE, /* Instructions that must issue by themselves */
|
|
|
|
|
|
|
|
SPARC_INV, /* This should stay at the end for the next value */
|
|
|
|
SPARC_NUM_SCHED_CLASSES = SPARC_INV
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// enum SparcMachineOpCode.
|
2003-01-14 22:00:31 +00:00
|
|
|
// const TargetInstrDescriptor SparcMachineInstrDesc[]
|
2001-09-14 03:56:45 +00:00
|
|
|
//
|
|
|
|
// Purpose:
|
|
|
|
// Description of UltraSparc machine instructions.
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2003-05-20 20:32:24 +00:00
|
|
|
namespace V9 {
|
|
|
|
enum SparcMachineOpCode {
|
2001-09-19 15:56:23 +00:00
|
|
|
#define I(ENUM, OPCODESTRING, NUMOPERANDS, RESULTPOS, MAXIMM, IMMSE, \
|
|
|
|
NUMDELAYSLOTS, LATENCY, SCHEDCLASS, INSTFLAGS) \
|
|
|
|
ENUM,
|
|
|
|
#include "SparcInstr.def"
|
2001-09-14 03:56:45 +00:00
|
|
|
|
2003-05-20 20:32:24 +00:00
|
|
|
// End-of-array marker
|
|
|
|
INVALID_OPCODE,
|
|
|
|
NUM_REAL_OPCODES = PHI, // number of valid opcodes
|
|
|
|
NUM_TOTAL_OPCODES = INVALID_OPCODE
|
|
|
|
};
|
|
|
|
}
|
2001-09-14 03:56:45 +00:00
|
|
|
|
2001-09-19 15:56:23 +00:00
|
|
|
// Array of machine instruction descriptions...
|
2003-01-14 22:00:31 +00:00
|
|
|
extern const TargetInstrDescriptor SparcMachineInstrDesc[];
|
2001-09-14 03:56:45 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
2003-12-17 22:04:00 +00:00
|
|
|
// class SparcSchedInfo
|
2001-09-14 03:56:45 +00:00
|
|
|
//
|
|
|
|
// Purpose:
|
|
|
|
// Interface to instruction scheduling information for UltraSPARC.
|
|
|
|
// The parameter values above are based on UltraSPARC IIi.
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2003-12-17 22:04:00 +00:00
|
|
|
class SparcSchedInfo: public TargetSchedInfo {
|
2001-09-14 03:56:45 +00:00
|
|
|
public:
|
2003-12-17 22:04:00 +00:00
|
|
|
SparcSchedInfo(const TargetMachine &tgt);
|
2001-09-14 03:56:45 +00:00
|
|
|
protected:
|
2002-02-04 05:59:25 +00:00
|
|
|
virtual void initializeResources();
|
2001-09-14 03:56:45 +00:00
|
|
|
};
|
|
|
|
|
2001-10-22 13:31:53 +00:00
|
|
|
//---------------------------------------------------------------------------
|
2003-12-17 22:04:00 +00:00
|
|
|
// class SparcCacheInfo
|
2001-11-09 02:15:52 +00:00
|
|
|
//
|
|
|
|
// Purpose:
|
|
|
|
// Interface to cache parameters for the UltraSPARC.
|
|
|
|
// Just use defaults for now.
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2003-12-17 22:04:00 +00:00
|
|
|
struct SparcCacheInfo: public TargetCacheInfo {
|
|
|
|
SparcCacheInfo(const TargetMachine &T) : TargetCacheInfo(T) {}
|
2001-11-09 02:15:52 +00:00
|
|
|
};
|
|
|
|
|
2001-10-22 13:31:53 +00:00
|
|
|
|
2003-08-13 02:38:16 +00:00
|
|
|
/// createStackSlotsPass - External interface to stack-slots pass that enters 2
|
|
|
|
/// empty slots at the top of each function stack
|
2003-11-13 00:17:20 +00:00
|
|
|
///
|
2003-08-13 02:38:16 +00:00
|
|
|
Pass *createStackSlotsPass(const TargetMachine &TM);
|
|
|
|
|
2003-11-13 00:17:20 +00:00
|
|
|
/// Specializes LLVM code for a target machine.
|
|
|
|
///
|
2003-11-07 17:43:43 +00:00
|
|
|
FunctionPass *createPreSelectionPass(const TargetMachine &TM);
|
2003-09-01 20:33:07 +00:00
|
|
|
|
2003-11-13 00:17:20 +00:00
|
|
|
/// Peephole optimization pass operating on machine code
|
|
|
|
///
|
2003-11-07 17:43:43 +00:00
|
|
|
FunctionPass *createPeepholeOptsPass(const TargetMachine &TM);
|
2003-09-01 20:33:07 +00:00
|
|
|
|
2003-11-13 00:17:20 +00:00
|
|
|
/// Writes out assembly code for the module, one function at a time
|
|
|
|
///
|
|
|
|
FunctionPass *createAsmPrinterPass(std::ostream &Out, const TargetMachine &TM);
|
|
|
|
|
|
|
|
/// getPrologEpilogInsertionPass - Inserts prolog/epilog code.
|
|
|
|
///
|
|
|
|
FunctionPass* createPrologEpilogInsertionPass();
|
|
|
|
|
|
|
|
/// getBytecodeAsmPrinterPass - Emits final LLVM bytecode to assembly file.
|
|
|
|
///
|
|
|
|
Pass* createBytecodeAsmPrinterPass(std::ostream &Out);
|
2003-08-13 02:38:16 +00:00
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2001-09-14 03:56:45 +00:00
|
|
|
#endif
|