LLVM  14.0.0git
RuntimeLibcalls.h
Go to the documentation of this file.
1 //===-- CodeGen/RuntimeLibcalls.h - Runtime Library Calls -------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the enum representing the list of runtime library calls
10 // the backend may emit during code generation, and also some helper functions.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
15 #define LLVM_CODEGEN_RUNTIMELIBCALLS_H
16 
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 #define HANDLE_LIBCALL(code, name) code,
32  #include "llvm/IR/RuntimeLibcalls.def"
33 #undef HANDLE_LIBCALL
34  };
35 
36  /// GetFPLibCall - Helper to return the right libcall for the given floating
37  /// point type, or UNKNOWN_LIBCALL if there is none.
38  Libcall getFPLibCall(EVT VT,
39  Libcall Call_F32,
40  Libcall Call_F64,
41  Libcall Call_F80,
42  Libcall Call_F128,
43  Libcall Call_PPCF128);
44 
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 
49  /// getFPROUND - Return the FPROUND_*_* value for the given types, or
50  /// UNKNOWN_LIBCALL if there is none.
51  Libcall getFPROUND(EVT OpVT, EVT RetVT);
52 
53  /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
54  /// UNKNOWN_LIBCALL if there is none.
55  Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
56 
57  /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
58  /// UNKNOWN_LIBCALL if there is none.
59  Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
60 
61  /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
62  /// UNKNOWN_LIBCALL if there is none.
63  Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
64 
65  /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
66  /// UNKNOWN_LIBCALL if there is none.
67  Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
68 
69  /// getPOWI - Return the POWI_* value for the given types, or
70  /// UNKNOWN_LIBCALL if there is none.
71  Libcall getPOWI(EVT RetVT);
72 
73  /// Return the SYNC_FETCH_AND_* value for the given opcode and type, or
74  /// UNKNOWN_LIBCALL if there is none.
75  Libcall getSYNC(unsigned Opc, MVT VT);
76 
77  /// Return the outline atomics value for the given opcode, atomic ordering
78  /// and type, or UNKNOWN_LIBCALL if there is none.
79  Libcall getOUTLINE_ATOMIC(unsigned Opc, AtomicOrdering Order, MVT VT);
80 
81  /// getMEMCPY_ELEMENT_UNORDERED_ATOMIC - Return
82  /// MEMCPY_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
83  /// UNKNOW_LIBCALL if there is none.
84  Libcall getMEMCPY_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
85 
86  /// getMEMMOVE_ELEMENT_UNORDERED_ATOMIC - Return
87  /// MEMMOVE_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
88  /// UNKNOW_LIBCALL if there is none.
89  Libcall getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
90 
91  /// getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return
92  /// MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
93  /// UNKNOW_LIBCALL if there is none.
94  Libcall getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
95 
96 }
97 }
98 
99 #endif
ValueTypes.h
llvm::RTLIB::getSYNC
Libcall getSYNC(unsigned Opc, MVT VT)
Return the SYNC_FETCH_AND_* value for the given opcode and type, or UNKNOWN_LIBCALL if there is none.
Definition: TargetLoweringBase.cpp:571
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
AtomicOrdering.h
llvm::RTLIB::getMEMSET_ELEMENT_UNORDERED_ATOMIC
Libcall getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize)
getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given ele...
Definition: TargetLoweringBase.cpp:643
llvm::RTLIB::Libcall
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit.
Definition: RuntimeLibcalls.h:30
llvm::RTLIB::getUINTTOFP
Libcall getUINTTOFP(EVT OpVT, EVT RetVT)
getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Definition: TargetLoweringBase.cpp:445
llvm::RTLIB::getFPROUND
Libcall getFPROUND(EVT OpVT, EVT RetVT)
getFPROUND - Return the FPROUND_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Definition: TargetLoweringBase.cpp:263
llvm::RTLIB::getFPLibCall
Libcall getFPLibCall(EVT VT, Libcall Call_F32, Libcall Call_F64, Libcall Call_F80, Libcall Call_F128, Libcall Call_PPCF128)
GetFPLibCall - Helper to return the right libcall for the given floating point type,...
Definition: TargetLoweringBase.cpp:216
llvm::AtomicOrdering
AtomicOrdering
Atomic ordering for LLVM's memory model.
Definition: AtomicOrdering.h:56
llvm::RTLIB::getPOWI
Libcall getPOWI(EVT RetVT)
getPOWI - Return the POWI_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Definition: TargetLoweringBase.cpp:489
llvm::RTLIB::getMEMMOVE_ELEMENT_UNORDERED_ATOMIC
Libcall getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize)
getMEMMOVE_ELEMENT_UNORDERED_ATOMIC - Return MEMMOVE_ELEMENT_UNORDERED_ATOMIC_* value for the given e...
Definition: TargetLoweringBase.cpp:626
llvm::RTLIB::getFPTOSINT
Libcall getFPTOSINT(EVT OpVT, EVT RetVT)
getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Definition: TargetLoweringBase.cpp:301
llvm::RTLIB::getFPEXT
Libcall getFPEXT(EVT OpVT, EVT RetVT)
getFPEXT - Return the FPEXT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Definition: TargetLoweringBase.cpp:233
llvm::RTLIB::getMEMCPY_ELEMENT_UNORDERED_ATOMIC
Libcall getMEMCPY_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize)
getMEMCPY_ELEMENT_UNORDERED_ATOMIC - Return MEMCPY_ELEMENT_UNORDERED_ATOMIC_* value for the given ele...
Definition: TargetLoweringBase.cpp:609
llvm::RTLIB::getFPTOUINT
Libcall getFPTOUINT(EVT OpVT, EVT RetVT)
getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Definition: TargetLoweringBase.cpp:350
llvm::RTLIB::getOUTLINE_ATOMIC
Libcall getOUTLINE_ATOMIC(unsigned Opc, AtomicOrdering Order, MVT VT)
Return the outline atomics value for the given opcode, atomic ordering and type, or UNKNOWN_LIBCALL i...
Definition: TargetLoweringBase.cpp:494
llvm::RTLIB::getSINTTOFP
Libcall getSINTTOFP(EVT OpVT, EVT RetVT)
getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
Definition: TargetLoweringBase.cpp:399