1 //===-- CodeGen/RuntimeLibcalls.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.
246 FPTOSINT_PPCF128_I32,
247 FPTOSINT_PPCF128_I64,
248 FPTOSINT_PPCF128_I128,
261 FPTOUINT_PPCF128_I32,
262 FPTOUINT_PPCF128_I64,
263 FPTOUINT_PPCF128_I128,
268 SINTTOFP_I32_PPCF128,
273 SINTTOFP_I64_PPCF128,
278 SINTTOFP_I128_PPCF128,
283 UINTTOFP_I32_PPCF128,
288 UINTTOFP_I64_PPCF128,
293 UINTTOFP_I128_PPCF128,
326 // EXCEPTION HANDLING
330 SYNC_VAL_COMPARE_AND_SWAP_1,
331 SYNC_VAL_COMPARE_AND_SWAP_2,
332 SYNC_VAL_COMPARE_AND_SWAP_4,
333 SYNC_VAL_COMPARE_AND_SWAP_8,
334 SYNC_VAL_COMPARE_AND_SWAP_16,
335 SYNC_LOCK_TEST_AND_SET_1,
336 SYNC_LOCK_TEST_AND_SET_2,
337 SYNC_LOCK_TEST_AND_SET_4,
338 SYNC_LOCK_TEST_AND_SET_8,
339 SYNC_LOCK_TEST_AND_SET_16,
340 SYNC_FETCH_AND_ADD_1,
341 SYNC_FETCH_AND_ADD_2,
342 SYNC_FETCH_AND_ADD_4,
343 SYNC_FETCH_AND_ADD_8,
344 SYNC_FETCH_AND_ADD_16,
345 SYNC_FETCH_AND_SUB_1,
346 SYNC_FETCH_AND_SUB_2,
347 SYNC_FETCH_AND_SUB_4,
348 SYNC_FETCH_AND_SUB_8,
349 SYNC_FETCH_AND_SUB_16,
350 SYNC_FETCH_AND_AND_1,
351 SYNC_FETCH_AND_AND_2,
352 SYNC_FETCH_AND_AND_4,
353 SYNC_FETCH_AND_AND_8,
354 SYNC_FETCH_AND_AND_16,
359 SYNC_FETCH_AND_OR_16,
360 SYNC_FETCH_AND_XOR_1,
361 SYNC_FETCH_AND_XOR_2,
362 SYNC_FETCH_AND_XOR_4,
363 SYNC_FETCH_AND_XOR_8,
364 SYNC_FETCH_AND_XOR_16,
365 SYNC_FETCH_AND_NAND_1,
366 SYNC_FETCH_AND_NAND_2,
367 SYNC_FETCH_AND_NAND_4,
368 SYNC_FETCH_AND_NAND_8,
369 SYNC_FETCH_AND_NAND_16,
370 SYNC_FETCH_AND_MAX_1,
371 SYNC_FETCH_AND_MAX_2,
372 SYNC_FETCH_AND_MAX_4,
373 SYNC_FETCH_AND_MAX_8,
374 SYNC_FETCH_AND_MAX_16,
375 SYNC_FETCH_AND_UMAX_1,
376 SYNC_FETCH_AND_UMAX_2,
377 SYNC_FETCH_AND_UMAX_4,
378 SYNC_FETCH_AND_UMAX_8,
379 SYNC_FETCH_AND_UMAX_16,
380 SYNC_FETCH_AND_MIN_1,
381 SYNC_FETCH_AND_MIN_2,
382 SYNC_FETCH_AND_MIN_4,
383 SYNC_FETCH_AND_MIN_8,
384 SYNC_FETCH_AND_MIN_16,
385 SYNC_FETCH_AND_UMIN_1,
386 SYNC_FETCH_AND_UMIN_2,
387 SYNC_FETCH_AND_UMIN_4,
388 SYNC_FETCH_AND_UMIN_8,
389 SYNC_FETCH_AND_UMIN_16,
391 // Stack Protector Fail.
392 STACKPROTECTOR_CHECK_FAIL,
397 /// getFPEXT - Return the FPEXT_*_* value for the given types, or
398 /// UNKNOWN_LIBCALL if there is none.
399 Libcall getFPEXT(EVT OpVT, EVT RetVT);
401 /// getFPROUND - Return the FPROUND_*_* value for the given types, or
402 /// UNKNOWN_LIBCALL if there is none.
403 Libcall getFPROUND(EVT OpVT, EVT RetVT);
405 /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
406 /// UNKNOWN_LIBCALL if there is none.
407 Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
409 /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
410 /// UNKNOWN_LIBCALL if there is none.
411 Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
413 /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
414 /// UNKNOWN_LIBCALL if there is none.
415 Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
417 /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
418 /// UNKNOWN_LIBCALL if there is none.
419 Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
421 /// Return the SYNC_FETCH_AND_* value for the given opcode and type, or
422 /// UNKNOWN_LIBCALL if there is none.
423 Libcall getATOMIC(unsigned Opc, MVT VT);