blob: c8ea2829c467d4f0412340bfce9d23053b583ff5 [file] [log] [blame]
Chris Lattner1911fd42006-09-04 04:14:57 +00001//===-- PPC.h - Top-level interface for PowerPC Target ----------*- C++ -*-===//
Misha Brukmanb5f662f2005-04-21 23:30:14 +00002//
Misha Brukman5dfe3a92004-06-21 16:55:25 +00003// The LLVM Compiler Infrastructure
4//
5// This file was developed by the LLVM research group and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
Misha Brukmanb5f662f2005-04-21 23:30:14 +00007//
Misha Brukman5dfe3a92004-06-21 16:55:25 +00008//===----------------------------------------------------------------------===//
9//
10// This file contains the entry points for global functions defined in the LLVM
11// PowerPC back-end.
12//
13//===----------------------------------------------------------------------===//
14
Chris Lattner1911fd42006-09-04 04:14:57 +000015#ifndef LLVM_TARGET_POWERPC_H
16#define LLVM_TARGET_POWERPC_H
Misha Brukman5dfe3a92004-06-21 16:55:25 +000017
Nate Begeman7a4fe9b2004-08-11 07:40:04 +000018#include <iosfwd>
19
Chris Lattneraf53a872006-11-04 05:27:39 +000020
21// GCC #defines PPC on Linux but we use it as our namespace name
22#undef PPC
23
Misha Brukman5dfe3a92004-06-21 16:55:25 +000024namespace llvm {
Chris Lattneraf53a872006-11-04 05:27:39 +000025 class PPCTargetMachine;
26 class FunctionPassManager;
27 class FunctionPass;
28 class MachineCodeEmitter;
29
30 namespace PPC {
31 /// Predicate - These are "(BO << 5) | BI" for various predicates.
32 enum Predicate {
33 PRED_ALWAYS = (20 << 5) | 0,
34 PRED_LT = (12 << 5) | 0,
35 PRED_LE = ( 4 << 5) | 1,
36 PRED_EQ = (12 << 5) | 2,
37 PRED_GE = ( 4 << 5) | 0,
38 PRED_GT = (12 << 5) | 1,
39 PRED_NE = ( 4 << 5) | 2,
40 PRED_UN = (12 << 5) | 3,
41 PRED_NU = ( 4 << 5) | 3
42 };
43 }
44
Misha Brukman999d9cf2004-07-27 18:33:06 +000045FunctionPass *createPPCBranchSelectionPass();
Evan Chengc4c62572006-03-13 23:20:37 +000046FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
Chris Lattner4da1c822006-09-20 17:12:19 +000047FunctionPass *createPPCAsmPrinterPass(std::ostream &OS,
48 PPCTargetMachine &TM);
Nate Begemaneb883af2006-08-23 21:08:52 +000049FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM,
50 MachineCodeEmitter &MCE);
Chris Lattner1911fd42006-09-04 04:14:57 +000051void addPPCMachOObjectWriterPass(FunctionPassManager &FPM, std::ostream &o,
Nate Begemaneb883af2006-08-23 21:08:52 +000052 PPCTargetMachine &tm);
Misha Brukman5dfe3a92004-06-21 16:55:25 +000053} // end namespace llvm;
54
Misha Brukman5dfe3a92004-06-21 16:55:25 +000055// Defines symbolic names for PowerPC registers. This defines a mapping from
56// register name to register number.
57//
Chris Lattner4c7b43b2005-10-14 23:37:35 +000058#include "PPCGenRegisterNames.inc"
Misha Brukman5dfe3a92004-06-21 16:55:25 +000059
60// Defines symbolic names for the PowerPC instructions.
61//
Chris Lattner4c7b43b2005-10-14 23:37:35 +000062#include "PPCGenInstrNames.inc"
Misha Brukman5dfe3a92004-06-21 16:55:25 +000063
64#endif