LLVM 22.0.0git
RuntimeLibcallUtil.h
Go to the documentation of this file.
1//===-- CodeGen/RuntimeLibcallUtil.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 some helper functions for runtime library calls.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
14#define LLVM_CODEGEN_RUNTIMELIBCALLS_H
15
21
22namespace llvm {
23namespace RTLIB {
24
25/// \return The SHL_* value for the given types, or UNKNOWN_LIBCALL if there is
26/// none.
27LLVM_ABI Libcall getSHL(EVT VT);
28
29/// \return The SRL_* value for the given types, or UNKNOWN_LIBCALL if there is
30/// none.
31LLVM_ABI Libcall getSRL(EVT VT);
32
33/// \return The SRA_* value for the given types, or UNKNOWN_LIBCALL if there is
34/// none.
35LLVM_ABI Libcall getSRA(EVT VT);
36
37/// \return The MUL_* value for the given types, or UNKNOWN_LIBCALL if there is
38/// none.
39LLVM_ABI Libcall getMUL(EVT VT);
40
41/// \return The MULO_* value for the given types, or UNKNOWN_LIBCALL if there is
42/// none.
43LLVM_ABI Libcall getMULO(EVT VT);
44
45/// \return The SDIV_* value for the given types, or UNKNOWN_LIBCALL if there is
46/// none.
47LLVM_ABI Libcall getSDIV(EVT VT);
48
49/// \return The UDIV_* value for the given types, or UNKNOWN_LIBCALL if there is
50/// none.
51LLVM_ABI Libcall getUDIV(EVT VT);
52
53/// \return The SREM_* value for the given types, or UNKNOWN_LIBCALL if there is
54/// none.
55LLVM_ABI Libcall getSREM(EVT VT);
56
57/// \return The UREM_* value for the given types, or UNKNOWN_LIBCALL if there is
58/// none.
59LLVM_ABI Libcall getUREM(EVT VT);
60
61/// \return The CTPOP_* value for the given types, or UNKNOWN_LIBCALL if there
62/// is none.
63LLVM_ABI Libcall getCTPOP(EVT VT);
64
65/// GetFPLibCall - Helper to return the right libcall for the given floating
66/// point type, or UNKNOWN_LIBCALL if there is none.
67LLVM_ABI Libcall getFPLibCall(EVT VT, Libcall Call_F32, Libcall Call_F64,
68 Libcall Call_F80, Libcall Call_F128,
69 Libcall Call_PPCF128);
70
71/// getFPEXT - Return the FPEXT_*_* value for the given types, or
72/// UNKNOWN_LIBCALL if there is none.
73LLVM_ABI Libcall getFPEXT(EVT OpVT, EVT RetVT);
74
75/// getFPROUND - Return the FPROUND_*_* value for the given types, or
76/// UNKNOWN_LIBCALL if there is none.
77LLVM_ABI Libcall getFPROUND(EVT OpVT, EVT RetVT);
78
79/// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
80/// UNKNOWN_LIBCALL if there is none.
81LLVM_ABI Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
82
83/// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
84/// UNKNOWN_LIBCALL if there is none.
85LLVM_ABI Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
86
87/// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
88/// UNKNOWN_LIBCALL if there is none.
89LLVM_ABI Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
90
91/// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
92/// UNKNOWN_LIBCALL if there is none.
93LLVM_ABI Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
94
95/// getPOWI - Return the POWI_* value for the given types, or
96/// UNKNOWN_LIBCALL if there is none.
97LLVM_ABI Libcall getPOWI(EVT RetVT);
98
99/// getPOW - Return the POW_* value for the given types, or
100/// UNKNOWN_LIBCALL if there is none.
101LLVM_ABI Libcall getPOW(EVT RetVT);
102
103/// getLDEXP - Return the LDEXP_* value for the given types, or
104/// UNKNOWN_LIBCALL if there is none.
105LLVM_ABI Libcall getLDEXP(EVT RetVT);
106
107/// getFREXP - Return the FREXP_* value for the given types, or
108/// UNKNOWN_LIBCALL if there is none.
109LLVM_ABI Libcall getFREXP(EVT RetVT);
110
111/// Return the SIN_* value for the given types, or UNKNOWN_LIBCALL if there is
112/// none.
113LLVM_ABI Libcall getSIN(EVT RetVT);
114
115/// Return the COS_* value for the given types, or UNKNOWN_LIBCALL if there is
116/// none.
117LLVM_ABI Libcall getCOS(EVT RetVT);
118
119/// getSINCOS - Return the SINCOS_* value for the given types, or
120/// UNKNOWN_LIBCALL if there is none.
121LLVM_ABI Libcall getSINCOS(EVT RetVT);
122
123/// getSINCOSPI - Return the SINCOSPI_* value for the given types, or
124/// UNKNOWN_LIBCALL if there is none.
125LLVM_ABI Libcall getSINCOSPI(EVT RetVT);
126
127/// Return the SINCOS_STRET_ value for the given types, or UNKNOWN_LIBCALL if
128/// there is none.
129LLVM_ABI Libcall getSINCOS_STRET(EVT RetVT);
130
131/// getMODF - Return the MODF_* value for the given types, or
132/// UNKNOWN_LIBCALL if there is none.
133LLVM_ABI Libcall getMODF(EVT VT);
134
135/// \return the LROUND_* value for the given types, or UNKNOWN_LIBCALL if there
136/// is none.
137LLVM_ABI Libcall getLROUND(EVT VT);
138
139/// \return the LLROUND_* value for the given types, or UNKNOWN_LIBCALL if there
140/// is none.
141LLVM_ABI Libcall getLLROUND(EVT VT);
142
143/// \return the LRINT_* value for the given types, or UNKNOWN_LIBCALL if there
144/// is none.
145LLVM_ABI Libcall getLRINT(EVT RetVT);
146
147/// \return the LLRINT_* value for the given types, or UNKNOWN_LIBCALL if there
148/// is none.
149LLVM_ABI Libcall getLLRINT(EVT RetVT);
150
151/// Return the SYNC_FETCH_AND_* value for the given opcode and type, or
152/// UNKNOWN_LIBCALL if there is none.
153LLVM_ABI Libcall getSYNC(unsigned Opc, MVT VT);
154
155/// Return the outline atomics value for the given atomic ordering, access
156/// size and set of libcalls for a given atomic, or UNKNOWN_LIBCALL if there
157/// is none.
158LLVM_ABI Libcall getOutlineAtomicHelper(const Libcall (&LC)[5][4],
159 AtomicOrdering Order, uint64_t MemSize);
160
161/// Return the outline atomics value for the given opcode, atomic ordering
162/// and type, or UNKNOWN_LIBCALL if there is none.
163LLVM_ABI Libcall getOUTLINE_ATOMIC(unsigned Opc, AtomicOrdering Order, MVT VT);
164
165/// getMEMCPY_ELEMENT_UNORDERED_ATOMIC - Return
166/// MEMCPY_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
167/// UNKNOW_LIBCALL if there is none.
169
170/// getMEMMOVE_ELEMENT_UNORDERED_ATOMIC - Return
171/// MEMMOVE_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
172/// UNKNOW_LIBCALL if there is none.
174
175/// getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return
176/// MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
177/// UNKNOW_LIBCALL if there is none.
179
180} // namespace RTLIB
181} // namespace llvm
182
183#endif
Atomic ordering constants.
#define LLVM_ABI
Definition Compiler.h:213
Machine Value Type.
LLVM_ABI Libcall getPOWI(EVT RetVT)
getPOWI - Return the POWI_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getSINTTOFP(EVT OpVT, EVT RetVT)
getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getUREM(EVT VT)
LLVM_ABI Libcall getSHL(EVT VT)
LLVM_ABI 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.
LLVM_ABI Libcall getLDEXP(EVT RetVT)
getLDEXP - Return the LDEXP_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getUINTTOFP(EVT OpVT, EVT RetVT)
getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getFREXP(EVT RetVT)
getFREXP - Return the FREXP_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getSINCOSPI(EVT RetVT)
getSINCOSPI - Return the SINCOSPI_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getSDIV(EVT VT)
LLVM_ABI Libcall getSRL(EVT VT)
LLVM_ABI Libcall getMEMCPY_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize)
getMEMCPY_ELEMENT_UNORDERED_ATOMIC - Return MEMCPY_ELEMENT_UNORDERED_ATOMIC_* value for the given ele...
LLVM_ABI Libcall getSRA(EVT VT)
LLVM_ABI Libcall getUDIV(EVT VT)
LLVM_ABI 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,...
LLVM_ABI Libcall getFPTOUINT(EVT OpVT, EVT RetVT)
getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getLLROUND(EVT VT)
LLVM_ABI Libcall getCOS(EVT RetVT)
Return the COS_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getLROUND(EVT VT)
LLVM_ABI Libcall getMODF(EVT VT)
getMODF - Return the MODF_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getFPTOSINT(EVT OpVT, EVT RetVT)
getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getLRINT(EVT RetVT)
LLVM_ABI 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...
LLVM_ABI Libcall getLLRINT(EVT RetVT)
LLVM_ABI Libcall getFPEXT(EVT OpVT, EVT RetVT)
getFPEXT - Return the FPEXT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getFPROUND(EVT OpVT, EVT RetVT)
getFPROUND - Return the FPROUND_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getSREM(EVT VT)
LLVM_ABI Libcall getSIN(EVT RetVT)
Return the SIN_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize)
getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given ele...
LLVM_ABI Libcall getSINCOS_STRET(EVT RetVT)
Return the SINCOS_STRET_ value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getPOW(EVT RetVT)
getPOW - Return the POW_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getOutlineAtomicHelper(const Libcall(&LC)[5][4], AtomicOrdering Order, uint64_t MemSize)
Return the outline atomics value for the given atomic ordering, access size and set of libcalls for a...
LLVM_ABI Libcall getMUL(EVT VT)
LLVM_ABI Libcall getCTPOP(EVT VT)
LLVM_ABI Libcall getSINCOS(EVT RetVT)
getSINCOS - Return the SINCOS_* value for the given types, or UNKNOWN_LIBCALL if there is none.
LLVM_ABI Libcall getMULO(EVT VT)
LLVM_ABI Libcall getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize)
getMEMMOVE_ELEMENT_UNORDERED_ATOMIC - Return MEMMOVE_ELEMENT_UNORDERED_ATOMIC_* value for the given e...
This is an optimization pass for GlobalISel generic memory operations.
AtomicOrdering
Atomic ordering for LLVM's memory model.
Extended Value Type.
Definition ValueTypes.h:35