LLVM API Documentation
00001 //===-- Sparc.h - Top-level interface for Sparc 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 // Sparc back-end. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef TARGET_SPARC_H 00016 #define TARGET_SPARC_H 00017 00018 #include <cassert> 00019 00020 namespace llvm { 00021 class FunctionPass; 00022 class TargetMachine; 00023 class SparcTargetMachine; 00024 class raw_ostream; 00025 00026 FunctionPass *createSparcISelDag(SparcTargetMachine &TM); 00027 FunctionPass *createSparcCodePrinterPass(raw_ostream &OS, TargetMachine &TM); 00028 FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM); 00029 FunctionPass *createSparcFPMoverPass(TargetMachine &TM); 00030 } // end namespace llvm; 00031 00032 // Defines symbolic names for Sparc registers. This defines a mapping from 00033 // register name to register number. 00034 // 00035 #include "SparcGenRegisterNames.inc" 00036 00037 // Defines symbolic names for the Sparc instructions. 00038 // 00039 #include "SparcGenInstrNames.inc" 00040 00041 00042 namespace llvm { 00043 // Enums corresponding to Sparc condition codes, both icc's and fcc's. These 00044 // values must be kept in sync with the ones in the .td file. 00045 namespace SPCC { 00046 enum CondCodes { 00047 //ICC_A = 8 , // Always 00048 //ICC_N = 0 , // Never 00049 ICC_NE = 9 , // Not Equal 00050 ICC_E = 1 , // Equal 00051 ICC_G = 10 , // Greater 00052 ICC_LE = 2 , // Less or Equal 00053 ICC_GE = 11 , // Greater or Equal 00054 ICC_L = 3 , // Less 00055 ICC_GU = 12 , // Greater Unsigned 00056 ICC_LEU = 4 , // Less or Equal Unsigned 00057 ICC_CC = 13 , // Carry Clear/Great or Equal Unsigned 00058 ICC_CS = 5 , // Carry Set/Less Unsigned 00059 ICC_POS = 14 , // Positive 00060 ICC_NEG = 6 , // Negative 00061 ICC_VC = 15 , // Overflow Clear 00062 ICC_VS = 7 , // Overflow Set 00063 00064 //FCC_A = 8+16, // Always 00065 //FCC_N = 0+16, // Never 00066 FCC_U = 7+16, // Unordered 00067 FCC_G = 6+16, // Greater 00068 FCC_UG = 5+16, // Unordered or Greater 00069 FCC_L = 4+16, // Less 00070 FCC_UL = 3+16, // Unordered or Less 00071 FCC_LG = 2+16, // Less or Greater 00072 FCC_NE = 1+16, // Not Equal 00073 FCC_E = 9+16, // Equal 00074 FCC_UE = 10+16, // Unordered or Equal 00075 FCC_GE = 11+16, // Greater or Equal 00076 FCC_UGE = 12+16, // Unordered or Greater or Equal 00077 FCC_LE = 13+16, // Less or Equal 00078 FCC_ULE = 14+16, // Unordered or Less or Equal 00079 FCC_O = 15+16 // Ordered 00080 }; 00081 } 00082 00083 inline static const char *SPARCCondCodeToString(SPCC::CondCodes CC) { 00084 switch (CC) { 00085 default: assert(0 && "Unknown condition code"); 00086 case SPCC::ICC_NE: return "ne"; 00087 case SPCC::ICC_E: return "e"; 00088 case SPCC::ICC_G: return "g"; 00089 case SPCC::ICC_LE: return "le"; 00090 case SPCC::ICC_GE: return "ge"; 00091 case SPCC::ICC_L: return "l"; 00092 case SPCC::ICC_GU: return "gu"; 00093 case SPCC::ICC_LEU: return "leu"; 00094 case SPCC::ICC_CC: return "cc"; 00095 case SPCC::ICC_CS: return "cs"; 00096 case SPCC::ICC_POS: return "pos"; 00097 case SPCC::ICC_NEG: return "neg"; 00098 case SPCC::ICC_VC: return "vc"; 00099 case SPCC::ICC_VS: return "vs"; 00100 case SPCC::FCC_U: return "u"; 00101 case SPCC::FCC_G: return "g"; 00102 case SPCC::FCC_UG: return "ug"; 00103 case SPCC::FCC_L: return "l"; 00104 case SPCC::FCC_UL: return "ul"; 00105 case SPCC::FCC_LG: return "lg"; 00106 case SPCC::FCC_NE: return "ne"; 00107 case SPCC::FCC_E: return "e"; 00108 case SPCC::FCC_UE: return "ue"; 00109 case SPCC::FCC_GE: return "ge"; 00110 case SPCC::FCC_UGE: return "uge"; 00111 case SPCC::FCC_LE: return "le"; 00112 case SPCC::FCC_ULE: return "ule"; 00113 case SPCC::FCC_O: return "o"; 00114 } 00115 } 00116 } // end namespace llvm 00117 #endif
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.