29enum RuntimeLibcallSignature {
62 i32_func_i32_i32_iPTR,
64 i64_func_i64_i64_iPTR,
72 i64_i64_func_i64_i64_i64_i64,
73 i64_i64_func_i64_i64_i64_i64_iPTR,
74 i64_i64_i64_i64_func_i64_i64_i64_i64,
75 i64_i64_func_i64_i64_i32,
76 i64_i64_func_i64_i64_i64_i64_i64_i64,
78 iPTR_func_iPTR_i32_iPTR,
79 iPTR_func_iPTR_iPTR_iPTR,
82 func_i64_i64_iPTR_iPTR,
84 i32_func_i64_i64_i64_i64,
91struct RuntimeLibcallSignatureTable {
92 std::vector<RuntimeLibcallSignature> Table;
95 RuntimeLibcallSignatureTable() : Table(RTLIB::UNKNOWN_LIBCALL,
unsupported) {
97 Table[RTLIB::SHL_I16] = i16_func_i16_i16;
98 Table[RTLIB::SHL_I32] = i32_func_i32_i32;
99 Table[RTLIB::SHL_I64] = i64_func_i64_i64;
100 Table[RTLIB::SHL_I128] = i64_i64_func_i64_i64_i32;
101 Table[RTLIB::SRL_I16] = i16_func_i16_i16;
102 Table[RTLIB::SRL_I32] = i32_func_i32_i32;
103 Table[RTLIB::SRL_I64] = i64_func_i64_i64;
104 Table[RTLIB::SRL_I128] = i64_i64_func_i64_i64_i32;
105 Table[RTLIB::SRA_I16] = i16_func_i16_i16;
106 Table[RTLIB::SRA_I32] = i32_func_i32_i32;
107 Table[RTLIB::SRA_I64] = i64_func_i64_i64;
108 Table[RTLIB::SRA_I128] = i64_i64_func_i64_i64_i32;
109 Table[RTLIB::MUL_I8] = i8_func_i8_i8;
110 Table[RTLIB::MUL_I16] = i16_func_i16_i16;
111 Table[RTLIB::MUL_I32] = i32_func_i32_i32;
112 Table[RTLIB::MUL_I64] = i64_func_i64_i64;
113 Table[RTLIB::MUL_I128] = i64_i64_func_i64_i64_i64_i64;
114 Table[RTLIB::MULO_I32] = i32_func_i32_i32_iPTR;
115 Table[RTLIB::MULO_I64] = i64_func_i64_i64_iPTR;
116 Table[RTLIB::MULO_I128] = i64_i64_func_i64_i64_i64_i64_iPTR;
117 Table[RTLIB::SDIV_I8] = i8_func_i8_i8;
118 Table[RTLIB::SDIV_I16] = i16_func_i16_i16;
119 Table[RTLIB::SDIV_I32] = i32_func_i32_i32;
120 Table[RTLIB::SDIV_I64] = i64_func_i64_i64;
121 Table[RTLIB::SDIV_I128] = i64_i64_func_i64_i64_i64_i64;
122 Table[RTLIB::UDIV_I8] = i8_func_i8_i8;
123 Table[RTLIB::UDIV_I16] = i16_func_i16_i16;
124 Table[RTLIB::UDIV_I32] = i32_func_i32_i32;
125 Table[RTLIB::UDIV_I64] = i64_func_i64_i64;
126 Table[RTLIB::UDIV_I128] = i64_i64_func_i64_i64_i64_i64;
127 Table[RTLIB::SREM_I8] = i8_func_i8_i8;
128 Table[RTLIB::SREM_I16] = i16_func_i16_i16;
129 Table[RTLIB::SREM_I32] = i32_func_i32_i32;
130 Table[RTLIB::SREM_I64] = i64_func_i64_i64;
131 Table[RTLIB::SREM_I128] = i64_i64_func_i64_i64_i64_i64;
132 Table[RTLIB::UREM_I8] = i8_func_i8_i8;
133 Table[RTLIB::UREM_I16] = i16_func_i16_i16;
134 Table[RTLIB::UREM_I32] = i32_func_i32_i32;
135 Table[RTLIB::UREM_I64] = i64_func_i64_i64;
136 Table[RTLIB::UREM_I128] = i64_i64_func_i64_i64_i64_i64;
137 Table[RTLIB::SDIVREM_I8] = i8_func_i8_i8;
138 Table[RTLIB::SDIVREM_I16] = i16_i16_func_i16_i16;
139 Table[RTLIB::SDIVREM_I32] = i32_i32_func_i32_i32;
140 Table[RTLIB::SDIVREM_I64] = i64_func_i64_i64;
141 Table[RTLIB::SDIVREM_I128] = i64_i64_i64_i64_func_i64_i64_i64_i64;
142 Table[RTLIB::UDIVREM_I8] = i8_func_i8_i8;
143 Table[RTLIB::UDIVREM_I16] = i16_i16_func_i16_i16;
144 Table[RTLIB::UDIVREM_I32] = i32_i32_func_i32_i32;
145 Table[RTLIB::UDIVREM_I64] = i64_i64_func_i64_i64;
146 Table[RTLIB::UDIVREM_I128] = i64_i64_i64_i64_func_i64_i64_i64_i64;
147 Table[RTLIB::NEG_I32] = i32_func_i32;
148 Table[RTLIB::NEG_I64] = i64_func_i64;
152 Table[RTLIB::ADD_F32] = f32_func_f32_f32;
153 Table[RTLIB::ADD_F64] = f64_func_f64_f64;
154 Table[RTLIB::ADD_F128] = i64_i64_func_i64_i64_i64_i64;
155 Table[RTLIB::SUB_F32] = f32_func_f32_f32;
156 Table[RTLIB::SUB_F64] = f64_func_f64_f64;
157 Table[RTLIB::SUB_F128] = i64_i64_func_i64_i64_i64_i64;
158 Table[RTLIB::MUL_F32] = f32_func_f32_f32;
159 Table[RTLIB::MUL_F64] = f64_func_f64_f64;
160 Table[RTLIB::MUL_F128] = i64_i64_func_i64_i64_i64_i64;
161 Table[RTLIB::DIV_F32] = f32_func_f32_f32;
162 Table[RTLIB::DIV_F64] = f64_func_f64_f64;
163 Table[RTLIB::DIV_F128] = i64_i64_func_i64_i64_i64_i64;
164 Table[RTLIB::REM_F32] = f32_func_f32_f32;
165 Table[RTLIB::REM_F64] = f64_func_f64_f64;
166 Table[RTLIB::REM_F128] = i64_i64_func_i64_i64_i64_i64;
167 Table[RTLIB::FMA_F32] = f32_func_f32_f32_f32;
168 Table[RTLIB::FMA_F64] = f64_func_f64_f64_f64;
169 Table[RTLIB::FMA_F128] = i64_i64_func_i64_i64_i64_i64_i64_i64;
170 Table[RTLIB::POWI_F32] = f32_func_f32_i32;
171 Table[RTLIB::POWI_F64] = f64_func_f64_i32;
172 Table[RTLIB::POWI_F128] = i64_i64_func_i64_i64_i32;
173 Table[RTLIB::SQRT_F32] = f32_func_f32;
174 Table[RTLIB::SQRT_F64] = f64_func_f64;
175 Table[RTLIB::SQRT_F128] = i64_i64_func_i64_i64;
176 Table[RTLIB::CBRT_F32] = f32_func_f32;
177 Table[RTLIB::CBRT_F64] = f64_func_f64;
178 Table[RTLIB::CBRT_F128] = i64_i64_func_i64_i64;
179 Table[RTLIB::LOG_F32] = f32_func_f32;
180 Table[RTLIB::LOG_F64] = f64_func_f64;
181 Table[RTLIB::LOG_F128] = i64_i64_func_i64_i64;
182 Table[RTLIB::LOG2_F32] = f32_func_f32;
183 Table[RTLIB::LOG2_F64] = f64_func_f64;
184 Table[RTLIB::LOG2_F128] = i64_i64_func_i64_i64;
185 Table[RTLIB::LOG10_F32] = f32_func_f32;
186 Table[RTLIB::LOG10_F64] = f64_func_f64;
187 Table[RTLIB::LOG10_F128] = i64_i64_func_i64_i64;
188 Table[RTLIB::EXP_F32] = f32_func_f32;
189 Table[RTLIB::EXP_F64] = f64_func_f64;
190 Table[RTLIB::EXP_F128] = i64_i64_func_i64_i64;
191 Table[RTLIB::EXP2_F32] = f32_func_f32;
192 Table[RTLIB::EXP2_F64] = f64_func_f64;
193 Table[RTLIB::EXP2_F128] = i64_i64_func_i64_i64;
194 Table[RTLIB::EXP10_F32] = f32_func_f32;
195 Table[RTLIB::EXP10_F64] = f64_func_f64;
196 Table[RTLIB::EXP10_F128] = i64_i64_func_i64_i64;
197 Table[RTLIB::SIN_F32] = f32_func_f32;
198 Table[RTLIB::SIN_F64] = f64_func_f64;
199 Table[RTLIB::SIN_F128] = i64_i64_func_i64_i64;
200 Table[RTLIB::COS_F32] = f32_func_f32;
201 Table[RTLIB::COS_F64] = f64_func_f64;
202 Table[RTLIB::COS_F128] = i64_i64_func_i64_i64;
203 Table[RTLIB::TAN_F32] = f32_func_f32;
204 Table[RTLIB::TAN_F64] = f64_func_f64;
205 Table[RTLIB::TAN_F128] = i64_i64_func_i64_i64;
206 Table[RTLIB::ASIN_F32] = f32_func_f32;
207 Table[RTLIB::ASIN_F64] = f64_func_f64;
208 Table[RTLIB::ASIN_F128] = i64_i64_func_i64_i64;
209 Table[RTLIB::ACOS_F32] = f32_func_f32;
210 Table[RTLIB::ACOS_F64] = f64_func_f64;
211 Table[RTLIB::ACOS_F128] = i64_i64_func_i64_i64;
212 Table[RTLIB::ATAN_F32] = f32_func_f32;
213 Table[RTLIB::ATAN_F64] = f64_func_f64;
214 Table[RTLIB::ATAN_F128] = i64_i64_func_i64_i64;
215 Table[RTLIB::ATAN2_F32] = f32_func_f32_f32;
216 Table[RTLIB::ATAN2_F64] = f64_func_f64_f64;
217 Table[RTLIB::ATAN2_F128] = i64_i64_func_i64_i64_i64_i64;
218 Table[RTLIB::SINH_F32] = f32_func_f32;
219 Table[RTLIB::SINH_F64] = f64_func_f64;
220 Table[RTLIB::SINH_F128] = i64_i64_func_i64_i64;
221 Table[RTLIB::COSH_F32] = f32_func_f32;
222 Table[RTLIB::COSH_F64] = f64_func_f64;
223 Table[RTLIB::COSH_F128] = i64_i64_func_i64_i64;
224 Table[RTLIB::TANH_F32] = f32_func_f32;
225 Table[RTLIB::TANH_F64] = f64_func_f64;
226 Table[RTLIB::TANH_F128] = i64_i64_func_i64_i64;
227 Table[RTLIB::SINCOS_F32] = func_f32_iPTR_iPTR;
228 Table[RTLIB::SINCOS_F64] = func_f64_iPTR_iPTR;
229 Table[RTLIB::SINCOS_F128] = func_i64_i64_iPTR_iPTR;
230 Table[RTLIB::POW_F32] = f32_func_f32_f32;
231 Table[RTLIB::POW_F64] = f64_func_f64_f64;
232 Table[RTLIB::POW_F128] = i64_i64_func_i64_i64_i64_i64;
233 Table[RTLIB::CEIL_F32] = f32_func_f32;
234 Table[RTLIB::CEIL_F64] = f64_func_f64;
235 Table[RTLIB::CEIL_F128] = i64_i64_func_i64_i64;
236 Table[RTLIB::TRUNC_F32] = f32_func_f32;
237 Table[RTLIB::TRUNC_F64] = f64_func_f64;
238 Table[RTLIB::TRUNC_F128] = i64_i64_func_i64_i64;
239 Table[RTLIB::RINT_F32] = f32_func_f32;
240 Table[RTLIB::RINT_F64] = f64_func_f64;
241 Table[RTLIB::RINT_F128] = i64_i64_func_i64_i64;
242 Table[RTLIB::NEARBYINT_F32] = f32_func_f32;
243 Table[RTLIB::NEARBYINT_F64] = f64_func_f64;
244 Table[RTLIB::NEARBYINT_F128] = i64_i64_func_i64_i64;
245 Table[RTLIB::ROUND_F32] = f32_func_f32;
246 Table[RTLIB::ROUND_F64] = f64_func_f64;
247 Table[RTLIB::ROUND_F128] = i64_i64_func_i64_i64;
248 Table[RTLIB::ROUNDEVEN_F32] = f32_func_f32;
249 Table[RTLIB::ROUNDEVEN_F64] = f64_func_f64;
250 Table[RTLIB::ROUNDEVEN_F128] = i64_i64_func_i64_i64;
251 Table[RTLIB::LROUND_F32] = iPTR_func_f32;
252 Table[RTLIB::LROUND_F64] = iPTR_func_f64;
253 Table[RTLIB::LROUND_F128] = iPTR_func_i64_i64;
254 Table[RTLIB::LLROUND_F32] = i64_func_f32;
255 Table[RTLIB::LLROUND_F64] = i64_func_f64;
256 Table[RTLIB::LLROUND_F128] = i64_func_i64_i64;
257 Table[RTLIB::LRINT_F32] = iPTR_func_f32;
258 Table[RTLIB::LRINT_F64] = iPTR_func_f64;
259 Table[RTLIB::LRINT_F128] = iPTR_func_i64_i64;
260 Table[RTLIB::LLRINT_F32] = i64_func_f32;
261 Table[RTLIB::LLRINT_F64] = i64_func_f64;
262 Table[RTLIB::LLRINT_F128] = i64_func_i64_i64;
263 Table[RTLIB::FLOOR_F32] = f32_func_f32;
264 Table[RTLIB::FLOOR_F64] = f64_func_f64;
265 Table[RTLIB::FLOOR_F128] = i64_i64_func_i64_i64;
266 Table[RTLIB::COPYSIGN_F32] = f32_func_f32_f32;
267 Table[RTLIB::COPYSIGN_F64] = f64_func_f64_f64;
268 Table[RTLIB::COPYSIGN_F128] = i64_i64_func_i64_i64_i64_i64;
269 Table[RTLIB::FMIN_F32] = f32_func_f32_f32;
270 Table[RTLIB::FMIN_F64] = f64_func_f64_f64;
271 Table[RTLIB::FMIN_F128] = i64_i64_func_i64_i64_i64_i64;
272 Table[RTLIB::FMAX_F32] = f32_func_f32_f32;
273 Table[RTLIB::FMAX_F64] = f64_func_f64_f64;
274 Table[RTLIB::FMAX_F128] = i64_i64_func_i64_i64_i64_i64;
275 Table[RTLIB::LDEXP_F32] = f32_func_f32_i32;
276 Table[RTLIB::LDEXP_F64] = f64_func_f64_i32;
277 Table[RTLIB::LDEXP_F128] = i64_i64_func_i64_i64_i32;
278 Table[RTLIB::FREXP_F32] = f32_func_f32_i32;
279 Table[RTLIB::FREXP_F64] = f64_func_f64_i32;
280 Table[RTLIB::FREXP_F128] = i64_i64_func_i64_i64_i32;
284 Table[RTLIB::FPEXT_F64_F128] = i64_i64_func_f64;
285 Table[RTLIB::FPEXT_F32_F128] = i64_i64_func_f32;
286 Table[RTLIB::FPEXT_F32_F64] = f64_func_f32;
287 Table[RTLIB::FPEXT_F16_F32] = f32_func_i16;
288 Table[RTLIB::FPROUND_F32_F16] = i16_func_f32;
289 Table[RTLIB::FPROUND_F64_F16] = i16_func_f64;
290 Table[RTLIB::FPROUND_F64_F32] = f32_func_f64;
291 Table[RTLIB::FPROUND_F128_F16] = i16_func_i64_i64;
292 Table[RTLIB::FPROUND_F128_F32] = f32_func_i64_i64;
293 Table[RTLIB::FPROUND_F128_F64] = f64_func_i64_i64;
294 Table[RTLIB::FPTOSINT_F32_I32] = i32_func_f32;
295 Table[RTLIB::FPTOSINT_F32_I64] = i64_func_f32;
296 Table[RTLIB::FPTOSINT_F32_I128] = i64_i64_func_f32;
297 Table[RTLIB::FPTOSINT_F64_I32] = i32_func_f64;
298 Table[RTLIB::FPTOSINT_F64_I64] = i64_func_f64;
299 Table[RTLIB::FPTOSINT_F64_I128] = i64_i64_func_f64;
300 Table[RTLIB::FPTOSINT_F128_I32] = i32_func_i64_i64;
301 Table[RTLIB::FPTOSINT_F128_I64] = i64_func_i64_i64;
302 Table[RTLIB::FPTOSINT_F128_I128] = i64_i64_func_i64_i64;
303 Table[RTLIB::FPTOUINT_F32_I32] = i32_func_f32;
304 Table[RTLIB::FPTOUINT_F32_I64] = i64_func_f32;
305 Table[RTLIB::FPTOUINT_F32_I128] = i64_i64_func_f32;
306 Table[RTLIB::FPTOUINT_F64_I32] = i32_func_f64;
307 Table[RTLIB::FPTOUINT_F64_I64] = i64_func_f64;
308 Table[RTLIB::FPTOUINT_F64_I128] = i64_i64_func_f64;
309 Table[RTLIB::FPTOUINT_F128_I32] = i32_func_i64_i64;
310 Table[RTLIB::FPTOUINT_F128_I64] = i64_func_i64_i64;
311 Table[RTLIB::FPTOUINT_F128_I128] = i64_i64_func_i64_i64;
312 Table[RTLIB::SINTTOFP_I32_F32] = f32_func_i32;
313 Table[RTLIB::SINTTOFP_I32_F64] = f64_func_i32;
314 Table[RTLIB::SINTTOFP_I32_F128] = i64_i64_func_i32;
315 Table[RTLIB::SINTTOFP_I64_F32] = f32_func_i64;
316 Table[RTLIB::SINTTOFP_I64_F64] = f64_func_i64;
317 Table[RTLIB::SINTTOFP_I64_F128] = i64_i64_func_i64;
318 Table[RTLIB::SINTTOFP_I128_F32] = f32_func_i64_i64;
319 Table[RTLIB::SINTTOFP_I128_F64] = f64_func_i64_i64;
320 Table[RTLIB::SINTTOFP_I128_F128] = i64_i64_func_i64_i64;
321 Table[RTLIB::UINTTOFP_I32_F32] = f32_func_i32;
322 Table[RTLIB::UINTTOFP_I32_F64] = f64_func_i64;
323 Table[RTLIB::UINTTOFP_I32_F128] = i64_i64_func_i32;
324 Table[RTLIB::UINTTOFP_I64_F32] = f32_func_i64;
325 Table[RTLIB::UINTTOFP_I64_F64] = f64_func_i64;
326 Table[RTLIB::UINTTOFP_I64_F128] = i64_i64_func_i64;
327 Table[RTLIB::UINTTOFP_I128_F32] = f32_func_i64_i64;
328 Table[RTLIB::UINTTOFP_I128_F64] = f64_func_i64_i64;
329 Table[RTLIB::UINTTOFP_I128_F128] = i64_i64_func_i64_i64;
333 Table[RTLIB::OEQ_F32] = i32_func_f32_f32;
334 Table[RTLIB::OEQ_F64] = i32_func_f64_f64;
335 Table[RTLIB::OEQ_F128] = i32_func_i64_i64_i64_i64;
336 Table[RTLIB::UNE_F32] = i32_func_f32_f32;
337 Table[RTLIB::UNE_F64] = i32_func_f64_f64;
338 Table[RTLIB::UNE_F128] = i32_func_i64_i64_i64_i64;
339 Table[RTLIB::OGE_F32] = i32_func_f32_f32;
340 Table[RTLIB::OGE_F64] = i32_func_f64_f64;
341 Table[RTLIB::OGE_F128] = i32_func_i64_i64_i64_i64;
342 Table[RTLIB::OLT_F32] = i32_func_f32_f32;
343 Table[RTLIB::OLT_F64] = i32_func_f64_f64;
344 Table[RTLIB::OLT_F128] = i32_func_i64_i64_i64_i64;
345 Table[RTLIB::OLE_F32] = i32_func_f32_f32;
346 Table[RTLIB::OLE_F64] = i32_func_f64_f64;
347 Table[RTLIB::OLE_F128] = i32_func_i64_i64_i64_i64;
348 Table[RTLIB::OGT_F32] = i32_func_f32_f32;
349 Table[RTLIB::OGT_F64] = i32_func_f64_f64;
350 Table[RTLIB::OGT_F128] = i32_func_i64_i64_i64_i64;
351 Table[RTLIB::UO_F32] = i32_func_f32_f32;
352 Table[RTLIB::UO_F64] = i32_func_f64_f64;
353 Table[RTLIB::UO_F128] = i32_func_i64_i64_i64_i64;
356 Table[RTLIB::MEMCPY] = iPTR_func_iPTR_iPTR_iPTR;
357 Table[RTLIB::MEMSET] = iPTR_func_iPTR_i32_iPTR;
358 Table[RTLIB::MEMMOVE] = iPTR_func_iPTR_iPTR_iPTR;
361 Table[RTLIB::STACKPROTECTOR_CHECK_FAIL] =
func;
364 Table[RTLIB::RETURN_ADDRESS] = iPTR_func_i32;
368 Table[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_1] =
unsupported;
369 Table[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_2] =
unsupported;
370 Table[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_4] =
unsupported;
371 Table[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_8] =
unsupported;
372 Table[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_16] =
unsupported;
373 Table[RTLIB::MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1] =
unsupported;
374 Table[RTLIB::MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2] =
unsupported;
375 Table[RTLIB::MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4] =
unsupported;
376 Table[RTLIB::MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8] =
unsupported;
377 Table[RTLIB::MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16] =
unsupported;
379 Table[RTLIB::MEMSET_ELEMENT_UNORDERED_ATOMIC_1] =
unsupported;
380 Table[RTLIB::MEMSET_ELEMENT_UNORDERED_ATOMIC_2] =
unsupported;
381 Table[RTLIB::MEMSET_ELEMENT_UNORDERED_ATOMIC_4] =
unsupported;
382 Table[RTLIB::MEMSET_ELEMENT_UNORDERED_ATOMIC_8] =
unsupported;
383 Table[RTLIB::MEMSET_ELEMENT_UNORDERED_ATOMIC_16] =
unsupported;
387 Table[RTLIB::SYNC_VAL_COMPARE_AND_SWAP_1] =
unsupported;
388 Table[RTLIB::SYNC_VAL_COMPARE_AND_SWAP_2] =
unsupported;
389 Table[RTLIB::SYNC_VAL_COMPARE_AND_SWAP_4] =
unsupported;
390 Table[RTLIB::SYNC_VAL_COMPARE_AND_SWAP_8] =
unsupported;
391 Table[RTLIB::SYNC_VAL_COMPARE_AND_SWAP_16] =
unsupported;
392 Table[RTLIB::SYNC_LOCK_TEST_AND_SET_1] =
unsupported;
393 Table[RTLIB::SYNC_LOCK_TEST_AND_SET_2] =
unsupported;
394 Table[RTLIB::SYNC_LOCK_TEST_AND_SET_4] =
unsupported;
395 Table[RTLIB::SYNC_LOCK_TEST_AND_SET_8] =
unsupported;
396 Table[RTLIB::SYNC_LOCK_TEST_AND_SET_16] =
unsupported;
426 Table[RTLIB::SYNC_FETCH_AND_NAND_16] =
unsupported;
436 Table[RTLIB::SYNC_FETCH_AND_UMAX_16] =
unsupported;
446 Table[RTLIB::SYNC_FETCH_AND_UMIN_16] =
unsupported;
471 Table[RTLIB::ATOMIC_COMPARE_EXCHANGE] =
unsupported;
472 Table[RTLIB::ATOMIC_COMPARE_EXCHANGE_1] =
unsupported;
473 Table[RTLIB::ATOMIC_COMPARE_EXCHANGE_2] =
unsupported;
474 Table[RTLIB::ATOMIC_COMPARE_EXCHANGE_4] =
unsupported;
475 Table[RTLIB::ATOMIC_COMPARE_EXCHANGE_8] =
unsupported;
476 Table[RTLIB::ATOMIC_COMPARE_EXCHANGE_16] =
unsupported;
516RuntimeLibcallSignatureTable &getRuntimeLibcallSignatures() {
517 static RuntimeLibcallSignatureTable RuntimeLibcallSignatures;
518 return RuntimeLibcallSignatures;
523struct StaticLibcallNameMap {
525 StaticLibcallNameMap() {
526 static const std::pair<const char *, RTLIB::Libcall> NameLibcalls[] = {
527#define HANDLE_LIBCALL(code, name) {(const char *)name, RTLIB::code},
528#include "llvm/IR/RuntimeLibcalls.def"
531 for (
const auto &NameLibcall : NameLibcalls) {
532 if (NameLibcall.first !=
nullptr &&
533 getRuntimeLibcallSignatures().Table[NameLibcall.second] !=
535 assert(!
Map.contains(NameLibcall.first) &&
536 "duplicate libcall names in name map");
537 Map[NameLibcall.first] = NameLibcall.second;
542 Map[
"__extendhfsf2"] = RTLIB::FPEXT_F16_F32;
543 Map[
"__truncsfhf2"] = RTLIB::FPROUND_F32_F16;
545 Map[
"emscripten_return_address"] = RTLIB::RETURN_ADDRESS;
559 Subtarget.
hasAddr64() ? wasm::ValType::I64 : wasm::ValType::I32;
561 auto &Table = getRuntimeLibcallSignatures().Table;
625 case f32_func_f32_f32:
630 case f32_func_f32_i32:
635 case f32_func_i64_i64:
640 case f64_func_f64_f64:
645 case f64_func_f64_i32:
650 case f64_func_i64_i64:
663 case i16_func_i64_i64:
673 case func_f32_iPTR_iPTR:
678 case func_f64_iPTR_iPTR:
683 case i16_func_i16_i16:
688 case i32_func_f32_f32:
693 case i32_func_f64_f64:
698 case i32_func_i32_i32:
703 case i32_func_i32_i32_iPTR:
709 case i64_func_i64_i64:
714 case i64_func_i64_i64_iPTR:
720 case i64_i64_func_f32:
729 case i64_i64_func_f64:
738 case i16_i16_func_i16_i16:
748 case i32_i32_func_i32_i32:
758 case i64_i64_func_i64_i64:
768 case i64_i64_func_i64_i64_i64_i64:
780 case i64_i64_func_i64_i64_i64_i64_iPTR:
793 case i64_i64_i64_i64_func_i64_i64_i64_i64:
807 case i64_i64_func_i64_i64_i32:
822 case iPTR_func_iPTR_i32_iPTR:
828 case iPTR_func_iPTR_iPTR_iPTR:
834 case f32_func_f32_f32_f32:
840 case f64_func_f64_f64_f64:
846 case func_i64_i64_iPTR_iPTR:
852 case i32_func_i64_i64:
857 case i32_func_i64_i64_i64_i64:
872 case iPTR_func_i64_i64:
877 case i64_i64_func_i64_i64_i64_i64_i64_i64:
891 case i64_i64_func_i32:
900 case i64_i64_func_i64:
920 static StaticLibcallNameMap LibcallNameMap;
921 auto &Map = LibcallNameMap.Map;
922 auto Val = Map.find(
Name);
924 if (Val == Map.end()) {
926 std::string(
"unexpected runtime library name: ") + std::string(
Name);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file provides signature information for runtime libcalls.
This file declares the WebAssembly-specific subclass of TargetSubtarget.
This file contains the declaration of the WebAssembly-specific utility functions.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit.
bool canLowerMultivalueReturn(const WebAssemblySubtarget *Subtarget)
Returns true if multivalue returns of a function can be lowered directly, i.e., not indirectly via a ...
void getLibcallSignature(const WebAssemblySubtarget &Subtarget, RTLIB::Libcall LC, SmallVectorImpl< wasm::ValType > &Rets, SmallVectorImpl< wasm::ValType > &Params)
This is an optimization pass for GlobalISel generic memory operations.