1 //===-- CodeGen/RuntimeLibcall.h - Runtime Library Calls --------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
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.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
16 #define LLVM_CODEGEN_RUNTIMELIBCALLS_H
18 #include "llvm/CodeGen/ValueTypes.h"
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".
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.
226 FPTOSINT_PPCF128_I32,
227 FPTOSINT_PPCF128_I64,
228 FPTOSINT_PPCF128_I128,
245 FPTOUINT_PPCF128_I32,
246 FPTOUINT_PPCF128_I64,
247 FPTOUINT_PPCF128_I128,
252 SINTTOFP_I32_PPCF128,
257 SINTTOFP_I64_PPCF128,
262 SINTTOFP_I128_PPCF128,
267 UINTTOFP_I32_PPCF128,
272 UINTTOFP_I64_PPCF128,
277 UINTTOFP_I128_PPCF128,
310 // EXCEPTION HANDLING
314 SYNC_VAL_COMPARE_AND_SWAP_1,
315 SYNC_VAL_COMPARE_AND_SWAP_2,
316 SYNC_VAL_COMPARE_AND_SWAP_4,
317 SYNC_VAL_COMPARE_AND_SWAP_8,
318 SYNC_LOCK_TEST_AND_SET_1,
319 SYNC_LOCK_TEST_AND_SET_2,
320 SYNC_LOCK_TEST_AND_SET_4,
321 SYNC_LOCK_TEST_AND_SET_8,
322 SYNC_FETCH_AND_ADD_1,
323 SYNC_FETCH_AND_ADD_2,
324 SYNC_FETCH_AND_ADD_4,
325 SYNC_FETCH_AND_ADD_8,
326 SYNC_FETCH_AND_SUB_1,
327 SYNC_FETCH_AND_SUB_2,
328 SYNC_FETCH_AND_SUB_4,
329 SYNC_FETCH_AND_SUB_8,
330 SYNC_FETCH_AND_AND_1,
331 SYNC_FETCH_AND_AND_2,
332 SYNC_FETCH_AND_AND_4,
333 SYNC_FETCH_AND_AND_8,
338 SYNC_FETCH_AND_XOR_1,
339 SYNC_FETCH_AND_XOR_2,
340 SYNC_FETCH_AND_XOR_4,
341 SYNC_FETCH_AND_XOR_8,
342 SYNC_FETCH_AND_NAND_1,
343 SYNC_FETCH_AND_NAND_2,
344 SYNC_FETCH_AND_NAND_4,
345 SYNC_FETCH_AND_NAND_8,
350 /// getFPEXT - Return the FPEXT_*_* value for the given types, or
351 /// UNKNOWN_LIBCALL if there is none.
352 Libcall getFPEXT(EVT OpVT, EVT RetVT);
354 /// getFPROUND - Return the FPROUND_*_* value for the given types, or
355 /// UNKNOWN_LIBCALL if there is none.
356 Libcall getFPROUND(EVT OpVT, EVT RetVT);
358 /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
359 /// UNKNOWN_LIBCALL if there is none.
360 Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
362 /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
363 /// UNKNOWN_LIBCALL if there is none.
364 Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
366 /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
367 /// UNKNOWN_LIBCALL if there is none.
368 Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
370 /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
371 /// UNKNOWN_LIBCALL if there is none.
372 Libcall getUINTTOFP(EVT OpVT, EVT RetVT);