Turn calls to copysignl into an FCOPYSIGN node. Handle FCOPYSIGN nodes
[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_I16,
33     SHL_I32,
34     SHL_I64,
35     SHL_I128,
36     SRL_I16,
37     SRL_I32,
38     SRL_I64,
39     SRL_I128,
40     SRA_I16,
41     SRA_I32,
42     SRA_I64,
43     SRA_I128,
44     MUL_I8,
45     MUL_I16,
46     MUL_I32,
47     MUL_I64,
48     MUL_I128,
49     SDIV_I8,
50     SDIV_I16,
51     SDIV_I32,
52     SDIV_I64,
53     SDIV_I128,
54     UDIV_I8,
55     UDIV_I16,
56     UDIV_I32,
57     UDIV_I64,
58     UDIV_I128,
59     SREM_I8,
60     SREM_I16,
61     SREM_I32,
62     SREM_I64,
63     SREM_I128,
64     UREM_I8,
65     UREM_I16,
66     UREM_I32,
67     UREM_I64,
68     UREM_I128,
69     NEG_I32,
70     NEG_I64,
71
72     // FLOATING POINT
73     ADD_F32,
74     ADD_F64,
75     ADD_F80,
76     ADD_PPCF128,
77     SUB_F32,
78     SUB_F64,
79     SUB_F80,
80     SUB_PPCF128,
81     MUL_F32,
82     MUL_F64,
83     MUL_F80,
84     MUL_PPCF128,
85     DIV_F32,
86     DIV_F64,
87     DIV_F80,
88     DIV_PPCF128,
89     REM_F32,
90     REM_F64,
91     REM_F80,
92     REM_PPCF128,
93     POWI_F32,
94     POWI_F64,
95     POWI_F80,
96     POWI_PPCF128,
97     SQRT_F32,
98     SQRT_F64,
99     SQRT_F80,
100     SQRT_PPCF128,
101     LOG_F32,
102     LOG_F64,
103     LOG_F80,
104     LOG_PPCF128,
105     LOG2_F32,
106     LOG2_F64,
107     LOG2_F80,
108     LOG2_PPCF128,
109     LOG10_F32,
110     LOG10_F64,
111     LOG10_F80,
112     LOG10_PPCF128,
113     EXP_F32,
114     EXP_F64,
115     EXP_F80,
116     EXP_PPCF128,
117     EXP2_F32,
118     EXP2_F64,
119     EXP2_F80,
120     EXP2_PPCF128,
121     SIN_F32,
122     SIN_F64,
123     SIN_F80,
124     SIN_PPCF128,
125     COS_F32,
126     COS_F64,
127     COS_F80,
128     COS_PPCF128,
129     POW_F32,
130     POW_F64,
131     POW_F80,
132     POW_PPCF128,
133     CEIL_F32,
134     CEIL_F64,
135     CEIL_F80,
136     CEIL_PPCF128,
137     TRUNC_F32,
138     TRUNC_F64,
139     TRUNC_F80,
140     TRUNC_PPCF128,
141     RINT_F32,
142     RINT_F64,
143     RINT_F80,
144     RINT_PPCF128,
145     NEARBYINT_F32,
146     NEARBYINT_F64,
147     NEARBYINT_F80,
148     NEARBYINT_PPCF128,
149     FLOOR_F32,
150     FLOOR_F64,
151     FLOOR_F80,
152     FLOOR_PPCF128,
153     COPYSIGN_F32,
154     COPYSIGN_F64,
155     COPYSIGN_F80,
156     COPYSIGN_PPCF128,
157
158     // CONVERSION
159     FPEXT_F32_F64,
160     FPEXT_F16_F32,
161     FPROUND_F32_F16,
162     FPROUND_F64_F32,
163     FPROUND_F80_F32,
164     FPROUND_PPCF128_F32,
165     FPROUND_F80_F64,
166     FPROUND_PPCF128_F64,
167     FPTOSINT_F32_I8,
168     FPTOSINT_F32_I16,
169     FPTOSINT_F32_I32,
170     FPTOSINT_F32_I64,
171     FPTOSINT_F32_I128,
172     FPTOSINT_F64_I32,
173     FPTOSINT_F64_I64,
174     FPTOSINT_F64_I128,
175     FPTOSINT_F80_I32,
176     FPTOSINT_F80_I64,
177     FPTOSINT_F80_I128,
178     FPTOSINT_PPCF128_I32,
179     FPTOSINT_PPCF128_I64,
180     FPTOSINT_PPCF128_I128,
181     FPTOUINT_F32_I8,
182     FPTOUINT_F32_I16,
183     FPTOUINT_F32_I32,
184     FPTOUINT_F32_I64,
185     FPTOUINT_F32_I128,
186     FPTOUINT_F64_I32,
187     FPTOUINT_F64_I64,
188     FPTOUINT_F64_I128,
189     FPTOUINT_F80_I32,
190     FPTOUINT_F80_I64,
191     FPTOUINT_F80_I128,
192     FPTOUINT_PPCF128_I32,
193     FPTOUINT_PPCF128_I64,
194     FPTOUINT_PPCF128_I128,
195     SINTTOFP_I32_F32,
196     SINTTOFP_I32_F64,
197     SINTTOFP_I32_F80,
198     SINTTOFP_I32_PPCF128,
199     SINTTOFP_I64_F32,
200     SINTTOFP_I64_F64,
201     SINTTOFP_I64_F80,
202     SINTTOFP_I64_PPCF128,
203     SINTTOFP_I128_F32,
204     SINTTOFP_I128_F64,
205     SINTTOFP_I128_F80,
206     SINTTOFP_I128_PPCF128,
207     UINTTOFP_I32_F32,
208     UINTTOFP_I32_F64,
209     UINTTOFP_I32_F80,
210     UINTTOFP_I32_PPCF128,
211     UINTTOFP_I64_F32,
212     UINTTOFP_I64_F64,
213     UINTTOFP_I64_F80,
214     UINTTOFP_I64_PPCF128,
215     UINTTOFP_I128_F32,
216     UINTTOFP_I128_F64,
217     UINTTOFP_I128_F80,
218     UINTTOFP_I128_PPCF128,
219
220     // COMPARISON
221     OEQ_F32,
222     OEQ_F64,
223     UNE_F32,
224     UNE_F64,
225     OGE_F32,
226     OGE_F64,
227     OLT_F32,
228     OLT_F64,
229     OLE_F32,
230     OLE_F64,
231     OGT_F32,
232     OGT_F64,
233     UO_F32,
234     UO_F64,
235     O_F32,
236     O_F64,
237
238     // MEMORY
239     MEMCPY,
240     MEMSET,
241     MEMMOVE,
242
243     // EXCEPTION HANDLING
244     UNWIND_RESUME,
245
246     UNKNOWN_LIBCALL
247   };
248
249   /// getFPEXT - Return the FPEXT_*_* value for the given types, or
250   /// UNKNOWN_LIBCALL if there is none.
251   Libcall getFPEXT(EVT OpVT, EVT RetVT);
252
253   /// getFPROUND - Return the FPROUND_*_* value for the given types, or
254   /// UNKNOWN_LIBCALL if there is none.
255   Libcall getFPROUND(EVT OpVT, EVT RetVT);
256
257   /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
258   /// UNKNOWN_LIBCALL if there is none.
259   Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
260
261   /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
262   /// UNKNOWN_LIBCALL if there is none.
263   Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
264
265   /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
266   /// UNKNOWN_LIBCALL if there is none.
267   Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
268
269   /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
270   /// UNKNOWN_LIBCALL if there is none.
271   Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
272 }
273 }
274
275 #endif