LLVM API Documentation

Sparc.h

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