LLVM API Documentation
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 <cassert> 00019 00020 namespace llvm { 00021 00022 class ARMTargetMachine; 00023 class FunctionPass; 00024 class MachineCodeEmitter; 00025 class raw_ostream; 00026 00027 // Enums corresponding to ARM condition codes 00028 namespace ARMCC { 00029 // The CondCodes constants map directly to the 4-bit encoding of the 00030 // condition field for predicated instructions. 00031 enum CondCodes { 00032 EQ, 00033 NE, 00034 HS, 00035 LO, 00036 MI, 00037 PL, 00038 VS, 00039 VC, 00040 HI, 00041 LS, 00042 GE, 00043 LT, 00044 GT, 00045 LE, 00046 AL 00047 }; 00048 00049 inline static CondCodes getOppositeCondition(CondCodes CC){ 00050 switch (CC) { 00051 default: assert(0 && "Unknown condition code"); 00052 case EQ: return NE; 00053 case NE: return EQ; 00054 case HS: return LO; 00055 case LO: return HS; 00056 case MI: return PL; 00057 case PL: return MI; 00058 case VS: return VC; 00059 case VC: return VS; 00060 case HI: return LS; 00061 case LS: return HI; 00062 case GE: return LT; 00063 case LT: return GE; 00064 case GT: return LE; 00065 case LE: return GT; 00066 } 00067 } 00068 } 00069 00070 inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) { 00071 switch (CC) { 00072 default: assert(0 && "Unknown condition code"); 00073 case ARMCC::EQ: return "eq"; 00074 case ARMCC::NE: return "ne"; 00075 case ARMCC::HS: return "hs"; 00076 case ARMCC::LO: return "lo"; 00077 case ARMCC::MI: return "mi"; 00078 case ARMCC::PL: return "pl"; 00079 case ARMCC::VS: return "vs"; 00080 case ARMCC::VC: return "vc"; 00081 case ARMCC::HI: return "hi"; 00082 case ARMCC::LS: return "ls"; 00083 case ARMCC::GE: return "ge"; 00084 case ARMCC::LT: return "lt"; 00085 case ARMCC::GT: return "gt"; 00086 case ARMCC::LE: return "le"; 00087 case ARMCC::AL: return "al"; 00088 } 00089 } 00090 00091 FunctionPass *createARMISelDag(ARMTargetMachine &TM); 00092 FunctionPass *createARMCodePrinterPass(raw_ostream &O, ARMTargetMachine &TM); 00093 FunctionPass *createARMCodeEmitterPass(ARMTargetMachine &TM, 00094 MachineCodeEmitter &MCE); 00095 FunctionPass *createARMLoadStoreOptimizationPass(); 00096 FunctionPass *createARMConstantIslandPass(); 00097 00098 } // end namespace llvm; 00099 00100 // Defines symbolic names for ARM registers. This defines a mapping from 00101 // register name to register number. 00102 // 00103 #include "ARMGenRegisterNames.inc" 00104 00105 // Defines symbolic names for the ARM instructions. 00106 // 00107 #include "ARMGenInstrNames.inc" 00108 00109 00110 #endif