Fix RegScavenger::forward() to work on basic blocks containing exactly
[oota-llvm.git] / include / llvm / CodeGen / RuntimeLibcalls.h
1 //===-- CodeGen/RuntimeLibcall.h - Runtime Library Calls --------*- 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 defines the enum representing the list of runtime library calls
11 // the backend may emit during code generation, and also some helper functions.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
16 #define LLVM_CODEGEN_RUNTIMELIBCALLS_H
17
18 #include "llvm/CodeGen/ValueTypes.h"
19
20 namespace llvm {
21 namespace RTLIB {
22   /// RTLIB::Libcall enum - This enum defines all of the runtime library calls
23   /// the backend can emit.  The various long double types cannot be merged,
24   /// because 80-bit library functions use "xf" and 128-bit use "tf".
25   /// 
26   /// When adding PPCF128 functions here, note that their names generally need
27   /// to be overridden for Darwin with the xxx$LDBL128 form.  See
28   /// PPCISelLowering.cpp.
29   ///
30   enum Libcall {
31     // Integer
32     SHL_I32,
33     SHL_I64,
34     SHL_I128,
35     SRL_I32,
36     SRL_I64,
37     SRL_I128,
38     SRA_I32,
39     SRA_I64,
40     SRA_I128,
41     MUL_I32,
42     MUL_I64,
43     MUL_I128,
44     SDIV_I32,
45     SDIV_I64,
46     SDIV_I128,
47     UDIV_I32,
48     UDIV_I64,
49     UDIV_I128,
50     SREM_I32,
51     SREM_I64,
52     SREM_I128,
53     UREM_I32,
54     UREM_I64,
55     UREM_I128,
56     NEG_I32,
57     NEG_I64,
58
59     // FLOATING POINT
60     ADD_F32,
61     ADD_F64,
62     ADD_F80,
63     ADD_PPCF128,
64     SUB_F32,
65     SUB_F64,
66     SUB_F80,
67     SUB_PPCF128,
68     MUL_F32,
69     MUL_F64,
70     MUL_F80,
71     MUL_PPCF128,
72     DIV_F32,
73     DIV_F64,
74     DIV_F80,
75     DIV_PPCF128,
76     REM_F32,
77     REM_F64,
78     REM_F80,
79     REM_PPCF128,
80     POWI_F32,
81     POWI_F64,
82     POWI_F80,
83     POWI_PPCF128,
84     SQRT_F32,
85     SQRT_F64,
86     SQRT_F80,
87     SQRT_PPCF128,
88     LOG_F32,
89     LOG_F64,
90     LOG_F80,
91     LOG_PPCF128,
92     LOG2_F32,
93     LOG2_F64,
94     LOG2_F80,
95     LOG2_PPCF128,
96     LOG10_F32,
97     LOG10_F64,
98     LOG10_F80,
99     LOG10_PPCF128,
100     EXP_F32,
101     EXP_F64,
102     EXP_F80,
103     EXP_PPCF128,
104     EXP2_F32,
105     EXP2_F64,
106     EXP2_F80,
107     EXP2_PPCF128,
108     SIN_F32,
109     SIN_F64,
110     SIN_F80,
111     SIN_PPCF128,
112     COS_F32,
113     COS_F64,
114     COS_F80,
115     COS_PPCF128,
116     POW_F32,
117     POW_F64,
118     POW_F80,
119     POW_PPCF128,
120     CEIL_F32,
121     CEIL_F64,
122     CEIL_F80,
123     CEIL_PPCF128,
124     TRUNC_F32,
125     TRUNC_F64,
126     TRUNC_F80,
127     TRUNC_PPCF128,
128     RINT_F32,
129     RINT_F64,
130     RINT_F80,
131     RINT_PPCF128,
132     NEARBYINT_F32,
133     NEARBYINT_F64,
134     NEARBYINT_F80,
135     NEARBYINT_PPCF128,
136     FLOOR_F32,
137     FLOOR_F64,
138     FLOOR_F80,
139     FLOOR_PPCF128,
140
141     // CONVERSION
142     FPEXT_F32_F64,
143     FPROUND_F64_F32,
144     FPROUND_F80_F32,
145     FPROUND_PPCF128_F32,
146     FPROUND_F80_F64,
147     FPROUND_PPCF128_F64,
148     FPTOSINT_F32_I32,
149     FPTOSINT_F32_I64,
150     FPTOSINT_F32_I128,
151     FPTOSINT_F64_I32,
152     FPTOSINT_F64_I64,
153     FPTOSINT_F64_I128,
154     FPTOSINT_F80_I32,
155     FPTOSINT_F80_I64,
156     FPTOSINT_F80_I128,
157     FPTOSINT_PPCF128_I32,
158     FPTOSINT_PPCF128_I64,
159     FPTOSINT_PPCF128_I128,
160     FPTOUINT_F32_I32,
161     FPTOUINT_F32_I64,
162     FPTOUINT_F32_I128,
163     FPTOUINT_F64_I32,
164     FPTOUINT_F64_I64,
165     FPTOUINT_F64_I128,
166     FPTOUINT_F80_I32,
167     FPTOUINT_F80_I64,
168     FPTOUINT_F80_I128,
169     FPTOUINT_PPCF128_I32,
170     FPTOUINT_PPCF128_I64,
171     FPTOUINT_PPCF128_I128,
172     SINTTOFP_I32_F32,
173     SINTTOFP_I32_F64,
174     SINTTOFP_I32_F80,
175     SINTTOFP_I32_PPCF128,
176     SINTTOFP_I64_F32,
177     SINTTOFP_I64_F64,
178     SINTTOFP_I64_F80,
179     SINTTOFP_I64_PPCF128,
180     SINTTOFP_I128_F32,
181     SINTTOFP_I128_F64,
182     SINTTOFP_I128_F80,
183     SINTTOFP_I128_PPCF128,
184     UINTTOFP_I32_F32,
185     UINTTOFP_I32_F64,
186     UINTTOFP_I32_F80,
187     UINTTOFP_I32_PPCF128,
188     UINTTOFP_I64_F32,
189     UINTTOFP_I64_F64,
190     UINTTOFP_I64_F80,
191     UINTTOFP_I64_PPCF128,
192     UINTTOFP_I128_F32,
193     UINTTOFP_I128_F64,
194     UINTTOFP_I128_F80,
195     UINTTOFP_I128_PPCF128,
196
197     // COMPARISON
198     OEQ_F32,
199     OEQ_F64,
200     UNE_F32,
201     UNE_F64,
202     OGE_F32,
203     OGE_F64,
204     OLT_F32,
205     OLT_F64,
206     OLE_F32,
207     OLE_F64,
208     OGT_F32,
209     OGT_F64,
210     UO_F32,
211     UO_F64,
212     O_F32,
213     O_F64,
214
215     UNKNOWN_LIBCALL
216   };
217
218   /// getFPEXT - Return the FPEXT_*_* value for the given types, or
219   /// UNKNOWN_LIBCALL if there is none.
220   Libcall getFPEXT(MVT OpVT, MVT RetVT);
221
222   /// getFPROUND - Return the FPROUND_*_* value for the given types, or
223   /// UNKNOWN_LIBCALL if there is none.
224   Libcall getFPROUND(MVT OpVT, MVT RetVT);
225
226   /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
227   /// UNKNOWN_LIBCALL if there is none.
228   Libcall getFPTOSINT(MVT OpVT, MVT RetVT);
229
230   /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
231   /// UNKNOWN_LIBCALL if there is none.
232   Libcall getFPTOUINT(MVT OpVT, MVT RetVT);
233
234   /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
235   /// UNKNOWN_LIBCALL if there is none.
236   Libcall getSINTTOFP(MVT OpVT, MVT RetVT);
237
238   /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
239   /// UNKNOWN_LIBCALL if there is none.
240   Libcall getUINTTOFP(MVT OpVT, MVT RetVT);
241 }
242 }
243
244 #endif