|
15 | 15 | #define LLVM_CODEGEN_RUNTIMELIBCALLS_H
|
16 | 16 |
|
17 | 17 | #include "llvm/CodeGen/ValueTypes.h"
|
| 18 | +#include "llvm/IR/RuntimeLibcalls.h" |
18 | 19 | #include "llvm/Support/AtomicOrdering.h"
|
19 | 20 |
|
20 | 21 | namespace llvm {
|
21 | 22 | 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 |
| - /// getLDEXP - Return the LDEXP_* value for the given types, or |
74 |
| - /// UNKNOWN_LIBCALL if there is none. |
75 |
| - Libcall getLDEXP(EVT RetVT); |
76 |
| - |
77 |
| - /// getFREXP - Return the FREXP_* value for the given types, or |
78 |
| - /// UNKNOWN_LIBCALL if there is none. |
79 |
| - Libcall getFREXP(EVT RetVT); |
80 |
| - |
81 |
| - /// Return the SYNC_FETCH_AND_* value for the given opcode and type, or |
82 |
| - /// UNKNOWN_LIBCALL if there is none. |
83 |
| - Libcall getSYNC(unsigned Opc, MVT VT); |
84 |
| - |
85 |
| - /// Return the outline atomics value for the given atomic ordering, access |
86 |
| - /// size and set of libcalls for a given atomic, or UNKNOWN_LIBCALL if there |
87 |
| - /// is none. |
88 |
| - Libcall getOutlineAtomicHelper(const Libcall (&LC)[5][4], |
89 |
| - AtomicOrdering Order, uint64_t MemSize); |
90 |
| - |
91 |
| - /// Return the outline atomics value for the given opcode, atomic ordering |
92 |
| - /// and type, or UNKNOWN_LIBCALL if there is none. |
93 |
| - Libcall getOUTLINE_ATOMIC(unsigned Opc, AtomicOrdering Order, MVT VT); |
94 |
| - |
95 |
| - /// getMEMCPY_ELEMENT_UNORDERED_ATOMIC - Return |
96 |
| - /// MEMCPY_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or |
97 |
| - /// UNKNOW_LIBCALL if there is none. |
98 |
| - Libcall getMEMCPY_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize); |
99 |
| - |
100 |
| - /// getMEMMOVE_ELEMENT_UNORDERED_ATOMIC - Return |
101 |
| - /// MEMMOVE_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or |
102 |
| - /// UNKNOW_LIBCALL if there is none. |
103 |
| - Libcall getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize); |
104 |
| - |
105 |
| - /// getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return |
106 |
| - /// MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or |
107 |
| - /// UNKNOW_LIBCALL if there is none. |
108 |
| - Libcall getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize); |
109 |
| - |
110 |
| -} |
111 |
| -} |
| 23 | + |
| 24 | +/// GetFPLibCall - Helper to return the right libcall for the given floating |
| 25 | +/// point type, or UNKNOWN_LIBCALL if there is none. |
| 26 | +Libcall getFPLibCall(EVT VT, Libcall Call_F32, Libcall Call_F64, |
| 27 | + Libcall Call_F80, Libcall Call_F128, Libcall Call_PPCF128); |
| 28 | + |
| 29 | +/// getFPEXT - Return the FPEXT_*_* value for the given types, or |
| 30 | +/// UNKNOWN_LIBCALL if there is none. |
| 31 | +Libcall getFPEXT(EVT OpVT, EVT RetVT); |
| 32 | + |
| 33 | +/// getFPROUND - Return the FPROUND_*_* value for the given types, or |
| 34 | +/// UNKNOWN_LIBCALL if there is none. |
| 35 | +Libcall getFPROUND(EVT OpVT, EVT RetVT); |
| 36 | + |
| 37 | +/// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or |
| 38 | +/// UNKNOWN_LIBCALL if there is none. |
| 39 | +Libcall getFPTOSINT(EVT OpVT, EVT RetVT); |
| 40 | + |
| 41 | +/// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or |
| 42 | +/// UNKNOWN_LIBCALL if there is none. |
| 43 | +Libcall getFPTOUINT(EVT OpVT, EVT RetVT); |
| 44 | + |
| 45 | +/// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or |
| 46 | +/// UNKNOWN_LIBCALL if there is none. |
| 47 | +Libcall getSINTTOFP(EVT OpVT, EVT RetVT); |
| 48 | + |
| 49 | +/// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or |
| 50 | +/// UNKNOWN_LIBCALL if there is none. |
| 51 | +Libcall getUINTTOFP(EVT OpVT, EVT RetVT); |
| 52 | + |
| 53 | +/// getPOWI - Return the POWI_* value for the given types, or |
| 54 | +/// UNKNOWN_LIBCALL if there is none. |
| 55 | +Libcall getPOWI(EVT RetVT); |
| 56 | + |
| 57 | +/// getLDEXP - Return the LDEXP_* value for the given types, or |
| 58 | +/// UNKNOWN_LIBCALL if there is none. |
| 59 | +Libcall getLDEXP(EVT RetVT); |
| 60 | + |
| 61 | +/// getFREXP - Return the FREXP_* value for the given types, or |
| 62 | +/// UNKNOWN_LIBCALL if there is none. |
| 63 | +Libcall getFREXP(EVT RetVT); |
| 64 | + |
| 65 | +/// Return the SYNC_FETCH_AND_* value for the given opcode and type, or |
| 66 | +/// UNKNOWN_LIBCALL if there is none. |
| 67 | +Libcall getSYNC(unsigned Opc, MVT VT); |
| 68 | + |
| 69 | +/// Return the outline atomics value for the given atomic ordering, access |
| 70 | +/// size and set of libcalls for a given atomic, or UNKNOWN_LIBCALL if there |
| 71 | +/// is none. |
| 72 | +Libcall getOutlineAtomicHelper(const Libcall (&LC)[5][4], AtomicOrdering Order, |
| 73 | + uint64_t MemSize); |
| 74 | + |
| 75 | +/// Return the outline atomics value for the given opcode, atomic ordering |
| 76 | +/// and type, or UNKNOWN_LIBCALL if there is none. |
| 77 | +Libcall getOUTLINE_ATOMIC(unsigned Opc, AtomicOrdering Order, MVT VT); |
| 78 | + |
| 79 | +/// getMEMCPY_ELEMENT_UNORDERED_ATOMIC - Return |
| 80 | +/// MEMCPY_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or |
| 81 | +/// UNKNOW_LIBCALL if there is none. |
| 82 | +Libcall getMEMCPY_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize); |
| 83 | + |
| 84 | +/// getMEMMOVE_ELEMENT_UNORDERED_ATOMIC - Return |
| 85 | +/// MEMMOVE_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or |
| 86 | +/// UNKNOW_LIBCALL if there is none. |
| 87 | +Libcall getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize); |
| 88 | + |
| 89 | +/// getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return |
| 90 | +/// MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or |
| 91 | +/// UNKNOW_LIBCALL if there is none. |
| 92 | +Libcall getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize); |
| 93 | + |
| 94 | +} // namespace RTLIB |
| 95 | +} // namespace llvm |
112 | 96 |
|
113 | 97 | #endif
|
0 commit comments