RuntimeLibcalls.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- CodeGen/RuntimeLibcalls.h - Runtime Library Calls -------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file defines the enum representing the list of runtime library calls
  15. // the backend may emit during code generation, and also some helper functions.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
  19. #define LLVM_CODEGEN_RUNTIMELIBCALLS_H
  20. #include "llvm/CodeGen/ValueTypes.h"
  21. #include "llvm/Support/AtomicOrdering.h"
  22. namespace llvm {
  23. namespace RTLIB {
  24. /// RTLIB::Libcall enum - This enum defines all of the runtime library calls
  25. /// the backend can emit. The various long double types cannot be merged,
  26. /// because 80-bit library functions use "xf" and 128-bit use "tf".
  27. ///
  28. /// When adding PPCF128 functions here, note that their names generally need
  29. /// to be overridden for Darwin with the xxx$LDBL128 form. See
  30. /// PPCISelLowering.cpp.
  31. ///
  32. enum Libcall {
  33. #define HANDLE_LIBCALL(code, name) code,
  34. #include "llvm/IR/RuntimeLibcalls.def"
  35. #undef HANDLE_LIBCALL
  36. };
  37. /// GetFPLibCall - Helper to return the right libcall for the given floating
  38. /// point type, or UNKNOWN_LIBCALL if there is none.
  39. Libcall getFPLibCall(EVT VT,
  40. Libcall Call_F32,
  41. Libcall Call_F64,
  42. Libcall Call_F80,
  43. Libcall Call_F128,
  44. Libcall Call_PPCF128);
  45. /// getFPEXT - Return the FPEXT_*_* value for the given types, or
  46. /// UNKNOWN_LIBCALL if there is none.
  47. Libcall getFPEXT(EVT OpVT, EVT RetVT);
  48. /// getFPROUND - Return the FPROUND_*_* value for the given types, or
  49. /// UNKNOWN_LIBCALL if there is none.
  50. Libcall getFPROUND(EVT OpVT, EVT RetVT);
  51. /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
  52. /// UNKNOWN_LIBCALL if there is none.
  53. Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
  54. /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
  55. /// UNKNOWN_LIBCALL if there is none.
  56. Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
  57. /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
  58. /// UNKNOWN_LIBCALL if there is none.
  59. Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
  60. /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
  61. /// UNKNOWN_LIBCALL if there is none.
  62. Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
  63. /// getPOWI - Return the POWI_* value for the given types, or
  64. /// UNKNOWN_LIBCALL if there is none.
  65. Libcall getPOWI(EVT RetVT);
  66. /// Return the SYNC_FETCH_AND_* value for the given opcode and type, or
  67. /// UNKNOWN_LIBCALL if there is none.
  68. Libcall getSYNC(unsigned Opc, MVT VT);
  69. /// Return the outline atomics value for the given opcode, atomic ordering
  70. /// and type, or UNKNOWN_LIBCALL if there is none.
  71. Libcall getOUTLINE_ATOMIC(unsigned Opc, AtomicOrdering Order, MVT VT);
  72. /// getMEMCPY_ELEMENT_UNORDERED_ATOMIC - Return
  73. /// MEMCPY_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
  74. /// UNKNOW_LIBCALL if there is none.
  75. Libcall getMEMCPY_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
  76. /// getMEMMOVE_ELEMENT_UNORDERED_ATOMIC - Return
  77. /// MEMMOVE_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
  78. /// UNKNOW_LIBCALL if there is none.
  79. Libcall getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
  80. /// getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return
  81. /// MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
  82. /// UNKNOW_LIBCALL if there is none.
  83. Libcall getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
  84. }
  85. }
  86. #endif
  87. #ifdef __GNUC__
  88. #pragma GCC diagnostic pop
  89. #endif