2009-06-02 13:52:33 -04:00
|
|
|
//===-- PPC.h - Top-level interface for PowerPC Target ----------*- C++ -*-===//
|
|
|
|
|
//
|
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
|
//
|
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
|
|
|
|
// This file contains the entry points for global functions defined in the LLVM
|
|
|
|
|
// PowerPC back-end.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
2015-01-18 11:17:27 -05:00
|
|
|
#ifndef LLVM_LIB_TARGET_POWERPC_PPC_H
|
|
|
|
|
#define LLVM_LIB_TARGET_POWERPC_PPC_H
|
2009-06-02 13:52:33 -04:00
|
|
|
|
2011-07-17 11:36:56 -04:00
|
|
|
#include "MCTargetDesc/PPCMCTargetDesc.h"
|
2011-02-20 07:57:14 -05:00
|
|
|
|
2009-06-02 13:52:33 -04:00
|
|
|
// GCC #defines PPC on Linux but we use it as our namespace name
|
|
|
|
|
#undef PPC
|
|
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
class PPCTargetMachine;
|
2014-11-24 04:08:18 -05:00
|
|
|
class PassRegistry;
|
2009-06-02 13:52:33 -04:00
|
|
|
class FunctionPass;
|
2013-04-08 14:41:23 -04:00
|
|
|
class ImmutablePass;
|
2011-02-20 07:57:14 -05:00
|
|
|
class MachineInstr;
|
|
|
|
|
class AsmPrinter;
|
|
|
|
|
class MCInst;
|
2012-04-14 09:54:10 -04:00
|
|
|
|
2013-12-21 19:04:03 -05:00
|
|
|
FunctionPass *createPPCCTRLoops(PPCTargetMachine &TM);
|
|
|
|
|
#ifndef NDEBUG
|
|
|
|
|
FunctionPass *createPPCCTRLoopsVerify();
|
|
|
|
|
#endif
|
2015-05-27 14:44:32 -04:00
|
|
|
FunctionPass *createPPCLoopPreIncPrepPass(PPCTargetMachine &TM);
|
|
|
|
|
FunctionPass *createPPCTOCRegDepsPass();
|
2013-06-10 16:36:52 -04:00
|
|
|
FunctionPass *createPPCEarlyReturnPass();
|
2014-11-24 04:08:18 -05:00
|
|
|
FunctionPass *createPPCVSXCopyPass();
|
|
|
|
|
FunctionPass *createPPCVSXFMAMutatePass();
|
2015-05-27 14:44:32 -04:00
|
|
|
FunctionPass *createPPCVSXSwapRemovalPass();
|
2015-12-30 06:46:15 -05:00
|
|
|
FunctionPass *createPPCMIPeepholePass();
|
2011-02-20 07:57:14 -05:00
|
|
|
FunctionPass *createPPCBranchSelectionPass();
|
2016-07-23 16:41:05 -04:00
|
|
|
FunctionPass *createPPCQPXLoadSplatPass();
|
2011-02-20 07:57:14 -05:00
|
|
|
FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
|
2015-05-27 14:44:32 -04:00
|
|
|
FunctionPass *createPPCTLSDynamicCallPass();
|
2015-12-30 06:46:15 -05:00
|
|
|
FunctionPass *createPPCBoolRetToIntPass();
|
2011-02-20 07:57:14 -05:00
|
|
|
void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
|
2011-06-12 11:42:51 -04:00
|
|
|
AsmPrinter &AP, bool isDarwin);
|
2013-04-08 14:41:23 -04:00
|
|
|
|
2014-11-24 04:08:18 -05:00
|
|
|
void initializePPCVSXFMAMutatePass(PassRegistry&);
|
2015-12-30 06:46:15 -05:00
|
|
|
void initializePPCBoolRetToIntPass(PassRegistry&);
|
2014-11-24 04:08:18 -05:00
|
|
|
extern char &PPCVSXFMAMutateID;
|
|
|
|
|
|
2011-02-20 07:57:14 -05:00
|
|
|
namespace PPCII {
|
|
|
|
|
|
|
|
|
|
/// Target Operand Flag enum.
|
|
|
|
|
enum TOF {
|
|
|
|
|
//===------------------------------------------------------------------===//
|
|
|
|
|
// PPC Specific MachineOperand flags.
|
|
|
|
|
MO_NO_FLAG,
|
2016-07-23 16:41:05 -04:00
|
|
|
|
|
|
|
|
/// On a symbol operand "FOO", this indicates that the reference is actually
|
|
|
|
|
/// to "FOO@plt". This is used for calls and jumps to external functions on
|
2014-11-24 04:08:18 -05:00
|
|
|
/// for PIC calls on Linux and ELF systems.
|
2016-07-23 16:41:05 -04:00
|
|
|
MO_PLT = 1,
|
|
|
|
|
|
2011-02-20 07:57:14 -05:00
|
|
|
/// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
|
|
|
|
|
/// the function's picbase, e.g. lo16(symbol-picbase).
|
2013-04-08 14:41:23 -04:00
|
|
|
MO_PIC_FLAG = 2,
|
2009-10-14 13:57:32 -04:00
|
|
|
|
2011-02-20 07:57:14 -05:00
|
|
|
/// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to
|
|
|
|
|
/// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase).
|
2013-04-08 14:41:23 -04:00
|
|
|
MO_NLP_FLAG = 4,
|
2016-07-23 16:41:05 -04:00
|
|
|
|
2011-02-20 07:57:14 -05:00
|
|
|
/// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a
|
|
|
|
|
/// symbol with hidden visibility. This causes a different kind of
|
|
|
|
|
/// non-lazy-pointer to be generated.
|
2013-04-08 14:41:23 -04:00
|
|
|
MO_NLP_HIDDEN_FLAG = 8,
|
2012-08-15 15:34:23 -04:00
|
|
|
|
|
|
|
|
/// The next are not flags but distinct values.
|
2013-04-08 14:41:23 -04:00
|
|
|
MO_ACCESS_MASK = 0xf0,
|
2012-08-15 15:34:23 -04:00
|
|
|
|
2013-12-21 19:04:03 -05:00
|
|
|
/// MO_LO, MO_HA - lo16(symbol) and ha16(symbol)
|
|
|
|
|
MO_LO = 1 << 4,
|
|
|
|
|
MO_HA = 2 << 4,
|
2013-04-08 14:41:23 -04:00
|
|
|
|
2013-12-21 19:04:03 -05:00
|
|
|
MO_TPREL_LO = 4 << 4,
|
|
|
|
|
MO_TPREL_HA = 3 << 4,
|
2012-08-15 15:34:23 -04:00
|
|
|
|
2013-04-08 14:41:23 -04:00
|
|
|
/// These values identify relocations on immediates folded
|
|
|
|
|
/// into memory operations.
|
2013-12-21 19:04:03 -05:00
|
|
|
MO_DTPREL_LO = 5 << 4,
|
2016-07-23 16:41:05 -04:00
|
|
|
MO_TLSLD_LO = 6 << 4,
|
|
|
|
|
MO_TOC_LO = 7 << 4,
|
2013-12-21 19:04:03 -05:00
|
|
|
|
|
|
|
|
// Symbol for VK_PPC_TLS fixup attached to an ADD instruction
|
2016-07-23 16:41:05 -04:00
|
|
|
MO_TLS = 8 << 4
|
2011-02-20 07:57:14 -05:00
|
|
|
};
|
|
|
|
|
} // end namespace PPCII
|
|
|
|
|
|
2015-07-05 10:21:36 -04:00
|
|
|
} // end namespace llvm;
|
2009-06-02 13:52:33 -04:00
|
|
|
|
|
|
|
|
#endif
|