1894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===-- PPC.h - Top-level interface for PowerPC Target ----------*- C++ -*-===// 2894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// 3894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// The LLVM Compiler Infrastructure 4894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// 5894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// This file is distributed under the University of Illinois Open Source 6894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// License. See LICENSE.TXT for details. 7894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// 8894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===// 9894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// 10894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// This file contains the entry points for global functions defined in the LLVM 11894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// PowerPC back-end. 12894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// 13894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman//===----------------------------------------------------------------------===// 14894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman 15894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#ifndef LLVM_TARGET_POWERPC_H 16894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#define LLVM_TARGET_POWERPC_H 17894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman 1819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman#include "MCTargetDesc/PPCBaseInfo.h" 1919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman#include "MCTargetDesc/PPCMCTargetDesc.h" 2019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman#include <string> 2119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman 22894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman// GCC #defines PPC on Linux but we use it as our namespace name 23894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#undef PPC 24894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman 25894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Baumannamespace llvm { 26894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman class PPCTargetMachine; 27894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman class FunctionPass; 28894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman class formatted_raw_ostream; 2919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman class JITCodeEmitter; 3019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman class Target; 3119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman class MachineInstr; 3219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman class AsmPrinter; 3319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman class MCInst; 3419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman class TargetMachine; 35894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman 3619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman FunctionPass *createPPCBranchSelectionPass(); 3719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman FunctionPass *createPPCISelDag(PPCTargetMachine &TM); 3819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM, 3919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman JITCodeEmitter &MCE); 4019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, 4119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman AsmPrinter &AP, bool isDarwin); 4219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman 4319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman namespace PPCII { 4419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman 4519bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// Target Operand Flag enum. 4619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman enum TOF { 4719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman //===------------------------------------------------------------------===// 4819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman // PPC Specific MachineOperand flags. 4919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman MO_NO_FLAG, 5019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman 5119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// MO_DARWIN_STUB - On a symbol operand "FOO", this indicates that the 5219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// reference is actually to the "FOO$stub" symbol. This is used for calls 5319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// and jumps to external functions on Tiger and earlier. 5419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman MO_DARWIN_STUB = 1, 5519bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman 5619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// MO_LO16, MO_HA16 - lo16(symbol) and ha16(symbol) 5719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman MO_LO16 = 4, MO_HA16 = 8, 58894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman 5919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to 6019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// the function's picbase, e.g. lo16(symbol-picbase). 6119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman MO_PIC_FLAG = 16, 62894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman 6319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to 6419bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase). 6519bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman MO_NLP_FLAG = 32, 6619bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman 6719bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a 6819bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// symbol with hidden visibility. This causes a different kind of 6919bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman /// non-lazy-pointer to be generated. 7019bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman MO_NLP_HIDDEN_FLAG = 64 7119bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman }; 7219bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman } // end namespace PPCII 7319bac1e08be200c31efd26f0f5fd144c9b3eefd3John Bauman 74894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman} // end namespace llvm; 75894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman 76894018228b0e0bdbd7aa7e8f47d4a9458789ca82John Bauman#endif 77