LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sparc.h
Go to the documentation of this file.
1 //===-- Sparc.h - Top-level interface for Sparc 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 // Sparc back-end.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef TARGET_SPARC_H
16 #define TARGET_SPARC_H
17 
21 
22 namespace llvm {
23  class FunctionPass;
24  class SparcTargetMachine;
25  class formatted_raw_ostream;
26 
27  FunctionPass *createSparcISelDag(SparcTargetMachine &TM);
28  FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM);
29  FunctionPass *createSparcJITCodeEmitterPass(SparcTargetMachine &TM,
30  JITCodeEmitter &JCE);
31 
32 } // end namespace llvm;
33 
34 namespace llvm {
35  // Enums corresponding to Sparc condition codes, both icc's and fcc's. These
36  // values must be kept in sync with the ones in the .td file.
37  namespace SPCC {
38  enum CondCodes {
39  //ICC_A = 8 , // Always
40  //ICC_N = 0 , // Never
41  ICC_NE = 9 , // Not Equal
42  ICC_E = 1 , // Equal
43  ICC_G = 10 , // Greater
44  ICC_LE = 2 , // Less or Equal
45  ICC_GE = 11 , // Greater or Equal
46  ICC_L = 3 , // Less
47  ICC_GU = 12 , // Greater Unsigned
48  ICC_LEU = 4 , // Less or Equal Unsigned
49  ICC_CC = 13 , // Carry Clear/Great or Equal Unsigned
50  ICC_CS = 5 , // Carry Set/Less Unsigned
51  ICC_POS = 14 , // Positive
52  ICC_NEG = 6 , // Negative
53  ICC_VC = 15 , // Overflow Clear
54  ICC_VS = 7 , // Overflow Set
55 
56  //FCC_A = 8+16, // Always
57  //FCC_N = 0+16, // Never
58  FCC_U = 7+16, // Unordered
59  FCC_G = 6+16, // Greater
60  FCC_UG = 5+16, // Unordered or Greater
61  FCC_L = 4+16, // Less
62  FCC_UL = 3+16, // Unordered or Less
63  FCC_LG = 2+16, // Less or Greater
64  FCC_NE = 1+16, // Not Equal
65  FCC_E = 9+16, // Equal
66  FCC_UE = 10+16, // Unordered or Equal
67  FCC_GE = 11+16, // Greater or Equal
68  FCC_UGE = 12+16, // Unordered or Greater or Equal
69  FCC_LE = 13+16, // Less or Equal
70  FCC_ULE = 14+16, // Unordered or Less or Equal
71  FCC_O = 15+16 // Ordered
72  };
73  }
74 
75  inline static const char *SPARCCondCodeToString(SPCC::CondCodes CC) {
76  switch (CC) {
77  case SPCC::ICC_NE: return "ne";
78  case SPCC::ICC_E: return "e";
79  case SPCC::ICC_G: return "g";
80  case SPCC::ICC_LE: return "le";
81  case SPCC::ICC_GE: return "ge";
82  case SPCC::ICC_L: return "l";
83  case SPCC::ICC_GU: return "gu";
84  case SPCC::ICC_LEU: return "leu";
85  case SPCC::ICC_CC: return "cc";
86  case SPCC::ICC_CS: return "cs";
87  case SPCC::ICC_POS: return "pos";
88  case SPCC::ICC_NEG: return "neg";
89  case SPCC::ICC_VC: return "vc";
90  case SPCC::ICC_VS: return "vs";
91  case SPCC::FCC_U: return "u";
92  case SPCC::FCC_G: return "g";
93  case SPCC::FCC_UG: return "ug";
94  case SPCC::FCC_L: return "l";
95  case SPCC::FCC_UL: return "ul";
96  case SPCC::FCC_LG: return "lg";
97  case SPCC::FCC_NE: return "ne";
98  case SPCC::FCC_E: return "e";
99  case SPCC::FCC_UE: return "ue";
100  case SPCC::FCC_GE: return "ge";
101  case SPCC::FCC_UGE: return "uge";
102  case SPCC::FCC_LE: return "le";
103  case SPCC::FCC_ULE: return "ule";
104  case SPCC::FCC_O: return "o";
105  }
106  llvm_unreachable("Invalid cond code");
107  }
108 } // end namespace llvm
109 #endif
FunctionPass * createSparcDelaySlotFillerPass(TargetMachine &TM)
FunctionPass * createSparcJITCodeEmitterPass(SparcTargetMachine &TM, JITCodeEmitter &JCE)
static const char * SPARCCondCodeToString(SPCC::CondCodes CC)
Definition: Sparc.h:75
#define llvm_unreachable(msg)
FunctionPass * createSparcISelDag(SparcTargetMachine &TM)
CondCodes
Definition: Sparc.h:38