LLVM 24.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/// The floating-point selectors get<OP>(EVT) return the <OP>_* libcall for the
96/// given type, or UNKNOWN_LIBCALL. Generated from the RuntimeLibcallFamily
97/// table in RuntimeLibcalls.td.
98#define GET_RUNTIME_LIBCALL_FP_SELECTOR_DECLS
99#include "llvm/IR/RuntimeLibcalls.inc"
100
101/// Return the SYNC_FETCH_AND_* value for the given opcode and type, or
102/// UNKNOWN_LIBCALL if there is none.
103LLVM_ABI Libcall getSYNC(unsigned Opc, MVT VT);
104
105/// Return the outline atomics value for the given atomic ordering, access
106/// size and set of libcalls for a given atomic, or UNKNOWN_LIBCALL if there
107/// is none.
108LLVM_ABI Libcall getOutlineAtomicHelper(const Libcall (&LC)[5][4],
109 AtomicOrdering Order, uint64_t MemSize);
110
111/// Return the outline atomics value for the given opcode, atomic ordering
112/// and type, or UNKNOWN_LIBCALL if there is none.
113LLVM_ABI Libcall getOUTLINE_ATOMIC(unsigned Opc, AtomicOrdering Order, MVT VT);
114
115/// getMEMCPY_ELEMENT_UNORDERED_ATOMIC - Return
116/// MEMCPY_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
117/// UNKNOW_LIBCALL if there is none.
119
120/// getMEMMOVE_ELEMENT_UNORDERED_ATOMIC - Return
121/// MEMMOVE_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
122/// UNKNOW_LIBCALL if there is none.
124
125/// getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return
126/// MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
127/// UNKNOW_LIBCALL if there is none.
129
130} // namespace RTLIB
131} // namespace llvm
132
133#endif
Atomic ordering constants.
#define LLVM_ABI
Definition Compiler.h:215
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 getUINTTOFP(EVT OpVT, EVT RetVT)
getUINTTOFP - Return the UINTTOFP_*_* 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 getFPTOSINT(EVT OpVT, EVT RetVT)
getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none.
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 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 getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize)
getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given ele...
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 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.
Extended Value Type.
Definition ValueTypes.h:35