LLVM API Documentation

ARM.h

Go to the documentation of this file.
00001 //===-- ARM.h - Top-level interface for ARM representation---- --*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains the entry points for global functions defined in the LLVM
00011 // ARM back-end.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef TARGET_ARM_H
00016 #define TARGET_ARM_H
00017 
00018 #include "llvm/Support/ErrorHandling.h"
00019 #include "llvm/Target/TargetMachine.h"
00020 #include <cassert>
00021 
00022 namespace llvm {
00023 
00024 class ARMBaseTargetMachine;
00025 class FunctionPass;
00026 class MachineCodeEmitter;
00027 class JITCodeEmitter;
00028 class ObjectCodeEmitter;
00029 class formatted_raw_ostream;
00030 
00031 // Enums corresponding to ARM condition codes
00032 namespace ARMCC {
00033   // The CondCodes constants map directly to the 4-bit encoding of the
00034   // condition field for predicated instructions.
00035   enum CondCodes {
00036     EQ,
00037     NE,
00038     HS,
00039     LO,
00040     MI,
00041     PL,
00042     VS,
00043     VC,
00044     HI,
00045     LS,
00046     GE,
00047     LT,
00048     GT,
00049     LE,
00050     AL
00051   };
00052 
00053   inline static CondCodes getOppositeCondition(CondCodes CC){
00054     switch (CC) {
00055     default: llvm_unreachable("Unknown condition code");
00056     case EQ: return NE;
00057     case NE: return EQ;
00058     case HS: return LO;
00059     case LO: return HS;
00060     case MI: return PL;
00061     case PL: return MI;
00062     case VS: return VC;
00063     case VC: return VS;
00064     case HI: return LS;
00065     case LS: return HI;
00066     case GE: return LT;
00067     case LT: return GE;
00068     case GT: return LE;
00069     case LE: return GT;
00070     }
00071   }
00072 }
00073 
00074 inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
00075   switch (CC) {
00076   default: llvm_unreachable("Unknown condition code");
00077   case ARMCC::EQ:  return "eq";
00078   case ARMCC::NE:  return "ne";
00079   case ARMCC::HS:  return "hs";
00080   case ARMCC::LO:  return "lo";
00081   case ARMCC::MI:  return "mi";
00082   case ARMCC::PL:  return "pl";
00083   case ARMCC::VS:  return "vs";
00084   case ARMCC::VC:  return "vc";
00085   case ARMCC::HI:  return "hi";
00086   case ARMCC::LS:  return "ls";
00087   case ARMCC::GE:  return "ge";
00088   case ARMCC::LT:  return "lt";
00089   case ARMCC::GT:  return "gt";
00090   case ARMCC::LE:  return "le";
00091   case ARMCC::AL:  return "al";
00092   }
00093 }
00094 
00095 FunctionPass *createARMISelDag(ARMBaseTargetMachine &TM);
00096 
00097 FunctionPass *createARMCodeEmitterPass(ARMBaseTargetMachine &TM,
00098                                        MachineCodeEmitter &MCE);
00099 FunctionPass *createARMJITCodeEmitterPass(ARMBaseTargetMachine &TM,
00100                                           JITCodeEmitter &JCE);
00101 FunctionPass *createARMObjectCodeEmitterPass(ARMBaseTargetMachine &TM,
00102                                              ObjectCodeEmitter &OCE);
00103 
00104 FunctionPass *createARMLoadStoreOptimizationPass(bool PreAlloc = false);
00105 FunctionPass *createARMConstantIslandPass();
00106 FunctionPass *createNEONPreAllocPass();
00107 FunctionPass *createThumb2ITBlockPass();
00108 FunctionPass *createThumb2SizeReductionPass();
00109 
00110 extern Target TheARMTarget, TheThumbTarget;
00111 
00112 } // end namespace llvm;
00113 
00114 // Defines symbolic names for ARM registers.  This defines a mapping from
00115 // register name to register number.
00116 //
00117 #include "ARMGenRegisterNames.inc"
00118 
00119 // Defines symbolic names for the ARM instructions.
00120 //
00121 #include "ARMGenInstrNames.inc"
00122 
00123 
00124 #endif