Tidy up #includes, deleting a bunch of unnecessary #includes.
[oota-llvm.git] / lib / Target / ARM / ARM.h
1 //===-- ARM.h - Top-level interface for ARM representation---- --*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the entry points for global functions defined in the LLVM
11 // ARM back-end.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef TARGET_ARM_H
16 #define TARGET_ARM_H
17
18 #include <cassert>
19
20 namespace llvm {
21
22 class ARMTargetMachine;
23 class FunctionPass;
24 class MachineCodeEmitter;
25 class raw_ostream;
26
27 // Enums corresponding to ARM condition codes
28 namespace ARMCC {
29   // The CondCodes constants map directly to the 4-bit encoding of the 
30   // condition field for predicated instructions. 
31   enum CondCodes {
32     EQ,
33     NE,
34     HS,
35     LO,
36     MI,
37     PL,
38     VS,
39     VC,
40     HI,
41     LS,
42     GE,
43     LT,
44     GT,
45     LE,
46     AL
47   };
48   
49   inline static CondCodes getOppositeCondition(CondCodes CC){
50     switch (CC) {
51     default: assert(0 && "Unknown condition code");
52     case EQ: return NE;
53     case NE: return EQ;
54     case HS: return LO;
55     case LO: return HS;
56     case MI: return PL;
57     case PL: return MI;
58     case VS: return VC;
59     case VC: return VS;
60     case HI: return LS;
61     case LS: return HI;
62     case GE: return LT;
63     case LT: return GE;
64     case GT: return LE;
65     case LE: return GT;
66     }
67   }
68 }
69
70 inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
71   switch (CC) {
72   default: assert(0 && "Unknown condition code");
73   case ARMCC::EQ:  return "eq";
74   case ARMCC::NE:  return "ne";
75   case ARMCC::HS:  return "hs";
76   case ARMCC::LO:  return "lo";
77   case ARMCC::MI:  return "mi";
78   case ARMCC::PL:  return "pl";
79   case ARMCC::VS:  return "vs";
80   case ARMCC::VC:  return "vc";
81   case ARMCC::HI:  return "hi";
82   case ARMCC::LS:  return "ls";
83   case ARMCC::GE:  return "ge";
84   case ARMCC::LT:  return "lt";
85   case ARMCC::GT:  return "gt";
86   case ARMCC::LE:  return "le";
87   case ARMCC::AL:  return "al";
88   }
89 }
90
91 FunctionPass *createARMISelDag(ARMTargetMachine &TM);
92 FunctionPass *createARMCodePrinterPass(raw_ostream &O, ARMTargetMachine &TM);
93 FunctionPass *createARMCodeEmitterPass(ARMTargetMachine &TM,
94                                        MachineCodeEmitter &MCE);
95 FunctionPass *createARMLoadStoreOptimizationPass();
96 FunctionPass *createARMConstantIslandPass();
97
98 } // end namespace llvm;
99
100 // Defines symbolic names for ARM registers.  This defines a mapping from
101 // register name to register number.
102 //
103 #include "ARMGenRegisterNames.inc"
104
105 // Defines symbolic names for the ARM instructions.
106 //
107 #include "ARMGenInstrNames.inc"
108
109
110 #endif