Assert that the DAG root value is a chain value.
[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     SIN_F32,
89     SIN_F64,
90     SIN_F80,
91     SIN_PPCF128,
92     COS_F32,
93     COS_F64,
94     COS_F80,
95     COS_PPCF128,
96     POW_F32,
97     POW_F64,
98     POW_F80,
99     POW_PPCF128,
100
101     // CONVERSION
102     FPEXT_F32_F64,
103     FPROUND_F64_F32,
104     FPTOSINT_F32_I32,
105     FPTOSINT_F32_I64,
106     FPTOSINT_F32_I128,
107     FPTOSINT_F64_I32,
108     FPTOSINT_F64_I64,
109     FPTOSINT_F64_I128,
110     FPTOSINT_F80_I32,
111     FPTOSINT_F80_I64,
112     FPTOSINT_F80_I128,
113     FPTOSINT_PPCF128_I32,
114     FPTOSINT_PPCF128_I64,
115     FPTOSINT_PPCF128_I128,
116     FPTOUINT_F32_I32,
117     FPTOUINT_F32_I64,
118     FPTOUINT_F32_I128,
119     FPTOUINT_F64_I32,
120     FPTOUINT_F64_I64,
121     FPTOUINT_F64_I128,
122     FPTOUINT_F80_I32,
123     FPTOUINT_F80_I64,
124     FPTOUINT_F80_I128,
125     FPTOUINT_PPCF128_I32,
126     FPTOUINT_PPCF128_I64,
127     FPTOUINT_PPCF128_I128,
128     SINTTOFP_I32_F32,
129     SINTTOFP_I32_F64,
130     SINTTOFP_I32_F80,
131     SINTTOFP_I32_PPCF128,
132     SINTTOFP_I64_F32,
133     SINTTOFP_I64_F64,
134     SINTTOFP_I64_F80,
135     SINTTOFP_I64_PPCF128,
136     SINTTOFP_I128_F32,
137     SINTTOFP_I128_F64,
138     SINTTOFP_I128_F80,
139     SINTTOFP_I128_PPCF128,
140     UINTTOFP_I32_F32,
141     UINTTOFP_I32_F64,
142     UINTTOFP_I32_F80,
143     UINTTOFP_I32_PPCF128,
144     UINTTOFP_I64_F32,
145     UINTTOFP_I64_F64,
146     UINTTOFP_I64_F80,
147     UINTTOFP_I64_PPCF128,
148     UINTTOFP_I128_F32,
149     UINTTOFP_I128_F64,
150     UINTTOFP_I128_F80,
151     UINTTOFP_I128_PPCF128,
152
153     // COMPARISON
154     OEQ_F32,
155     OEQ_F64,
156     UNE_F32,
157     UNE_F64,
158     OGE_F32,
159     OGE_F64,
160     OLT_F32,
161     OLT_F64,
162     OLE_F32,
163     OLE_F64,
164     OGT_F32,
165     OGT_F64,
166     UO_F32,
167     UO_F64,
168     O_F32,
169     O_F64,
170
171     UNKNOWN_LIBCALL
172   };
173
174   /// getFPEXT - Return the FPEXT_*_* value for the given types, or
175   /// UNKNOWN_LIBCALL if there is none.
176   Libcall getFPEXT(MVT OpVT, MVT RetVT);
177
178   /// getFPROUND - Return the FPROUND_*_* value for the given types, or
179   /// UNKNOWN_LIBCALL if there is none.
180   Libcall getFPROUND(MVT OpVT, MVT RetVT);
181
182   /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
183   /// UNKNOWN_LIBCALL if there is none.
184   Libcall getFPTOSINT(MVT OpVT, MVT RetVT);
185
186   /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
187   /// UNKNOWN_LIBCALL if there is none.
188   Libcall getFPTOUINT(MVT OpVT, MVT RetVT);
189
190   /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
191   /// UNKNOWN_LIBCALL if there is none.
192   Libcall getSINTTOFP(MVT OpVT, MVT RetVT);
193
194   /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
195   /// UNKNOWN_LIBCALL if there is none.
196   Libcall getUINTTOFP(MVT OpVT, MVT RetVT);
197 }
198 }
199
200 #endif