blob: 86e24cab76f664345d6a135254a97bbd5f962d29 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===-- CodeGen/RuntimeLibcalls.h - Runtime Library Calls -------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
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
17#include "llvm/CodeGen/ValueTypes.h"
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020018#include "llvm/Support/AtomicOrdering.h"
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010019
20namespace llvm {
21namespace 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,
Andrew Scullcdfcccc2018-10-05 20:58:37 +010032 #include "llvm/IR/RuntimeLibcalls.def"
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010033#undef HANDLE_LIBCALL
34 };
35
36 /// getFPEXT - Return the FPEXT_*_* value for the given types, or
37 /// UNKNOWN_LIBCALL if there is none.
38 Libcall getFPEXT(EVT OpVT, EVT RetVT);
39
40 /// getFPROUND - Return the FPROUND_*_* value for the given types, or
41 /// UNKNOWN_LIBCALL if there is none.
42 Libcall getFPROUND(EVT OpVT, EVT RetVT);
43
44 /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
45 /// UNKNOWN_LIBCALL if there is none.
46 Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
47
48 /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
49 /// UNKNOWN_LIBCALL if there is none.
50 Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
51
52 /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
53 /// UNKNOWN_LIBCALL if there is none.
54 Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
55
56 /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
57 /// UNKNOWN_LIBCALL if there is none.
58 Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
59
60 /// Return the SYNC_FETCH_AND_* value for the given opcode and type, or
61 /// UNKNOWN_LIBCALL if there is none.
62 Libcall getSYNC(unsigned Opc, MVT VT);
63
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020064 /// Return the outline atomics value for the given opcode, atomic ordering
65 /// and type, or UNKNOWN_LIBCALL if there is none.
66 Libcall getOUTLINE_ATOMIC(unsigned Opc, AtomicOrdering Order, MVT VT);
67
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010068 /// getMEMCPY_ELEMENT_UNORDERED_ATOMIC - Return
69 /// MEMCPY_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
70 /// UNKNOW_LIBCALL if there is none.
71 Libcall getMEMCPY_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
72
73 /// getMEMMOVE_ELEMENT_UNORDERED_ATOMIC - Return
74 /// MEMMOVE_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
75 /// UNKNOW_LIBCALL if there is none.
76 Libcall getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
77
78 /// getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return
79 /// MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
80 /// UNKNOW_LIBCALL if there is none.
81 Libcall getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
82
83}
84}
85
86#endif