llvm.org GIT mirror llvm / 4956001
- Move RTLIB::Libcall enum to a separate file. - Code clean up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33148 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 13 years ago
2 changed file(s) with 111 addition(s) and 90 deletion(s). Raw diff Collapse all Expand all
0 //===-- CodeGen/RuntimeLibcall.h - Runtime Library Calls --------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file was developed by the Evan Cheng and is distributed under
5 // the University of Illinois Open Source License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the enum representing the list of runtime library calls
10 // the backend may emit during code generation.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
15 #define LLVM_CODEGEN_RUNTIMELIBCALLS_H
16
17 namespace llvm {
18 namespace RTLIB {
19 /// RTLIB::Libcall enum - This enum defines all of the runtime library calls
20 /// the backend can emit.
21 ///
22 enum Libcall {
23 // Integer
24 SHL_I32,
25 SHL_I64,
26 SRL_I32,
27 SRL_I64,
28 SRA_I32,
29 SRA_I64,
30 MUL_I32,
31 MUL_I64,
32 SDIV_I32,
33 SDIV_I64,
34 UDIV_I32,
35 UDIV_I64,
36 SREM_I32,
37 SREM_I64,
38 UREM_I32,
39 UREM_I64,
40 NEG_I32,
41 NEG_I64,
42
43 // FLOATING POINT
44 ADD_F32,
45 ADD_F64,
46 SUB_F32,
47 SUB_F64,
48 MUL_F32,
49 MUL_F64,
50 DIV_F32,
51 DIV_F64,
52 REM_F32,
53 REM_F64,
54 NEG_F32,
55 NEG_F64,
56 POWI_F32,
57 POWI_F64,
58 SQRT_F32,
59 SQRT_F64,
60 SIN_F32,
61 SIN_F64,
62 COS_F32,
63 COS_F64,
64
65 // CONVERSION
66 FPEXT_F32_F64,
67 FPROUND_F64_F32,
68 FPTOSINT_F32_I32,
69 FPTOSINT_F32_I64,
70 FPTOSINT_F64_I32,
71 FPTOSINT_F64_I64,
72 FPTOUINT_F32_I32,
73 FPTOUINT_F32_I64,
74 FPTOUINT_F64_I32,
75 FPTOUINT_F64_I64,
76 SINTTOFP_I32_F32,
77 SINTTOFP_I32_F64,
78 SINTTOFP_I64_F32,
79 SINTTOFP_I64_F64,
80 UINTTOFP_I32_F32,
81 UINTTOFP_I32_F64,
82 UINTTOFP_I64_F32,
83 UINTTOFP_I64_F64,
84
85 // COMPARISON
86 OEQ_F32,
87 OEQ_F64,
88 UNE_F32,
89 UNE_F64,
90 OGE_F32,
91 OGE_F64,
92 OLT_F32,
93 OLT_F64,
94 OLE_F32,
95 OLE_F64,
96 OGT_F32,
97 OGT_F64,
98 UO_F32,
99 UO_F64,
100
101 UNKNOWN_LIBCALL
102 };
103 }
104 }
105
106 #endif
2323
2424 #include "llvm/DerivedTypes.h"
2525 #include "llvm/CodeGen/SelectionDAGNodes.h"
26 #include "llvm/CodeGen/RuntimeLibcalls.h"
2627 #include
2728
2829 namespace llvm {
3637 class SelectionDAG;
3738 class MachineBasicBlock;
3839 class MachineInstr;
39
40 namespace RTLIB {
41 /// RTLIB::Libcall enum - This enum defines all of the runtime library calls
42 /// the backend can emit.
43 ///
44 enum Libcall {
45 // Integer
46 SHL_I32,
47 SHL_I64,
48 SRL_I32,
49 SRL_I64,
50 SRA_I32,
51 SRA_I64,
52 MUL_I32,
53 MUL_I64,
54 SDIV_I32,
55 SDIV_I64,
56 UDIV_I32,
57 UDIV_I64,
58 SREM_I32,
59 SREM_I64,
60 UREM_I32,
61 UREM_I64,
62 NEG_I32,
63 NEG_I64,
64
65 // FLOATING POINT
66 ADD_F32,
67 ADD_F64,
68 SUB_F32,
69 SUB_F64,
70 MUL_F32,
71 MUL_F64,
72 DIV_F32,
73 DIV_F64,
74 REM_F32,
75 REM_F64,
76 NEG_F32,
77 NEG_F64,
78 POWI_F32,
79 POWI_F64,
80 SQRT_F32,
81 SQRT_F64,
82 SIN_F32,
83 SIN_F64,
84 COS_F32,
85 COS_F64,
86
87 // CONVERSION
88 FPEXT_F32_F64,
89 FPROUND_F64_F32,
90 FPTOSINT_F32_I32,
91 FPTOSINT_F32_I64,
92 FPTOSINT_F64_I32,
93 FPTOSINT_F64_I64,
94 FPTOUINT_F32_I32,
95 FPTOUINT_F32_I64,
96 FPTOUINT_F64_I32,
97 FPTOUINT_F64_I64,
98 SINTTOFP_I32_F32,
99 SINTTOFP_I32_F64,
100 SINTTOFP_I64_F32,
101 SINTTOFP_I64_F64,
102 UINTTOFP_I32_F32,
103 UINTTOFP_I32_F64,
104 UINTTOFP_I64_F32,
105 UINTTOFP_I64_F64,
106
107 // COMPARISON
108 OEQ_F32,
109 OEQ_F64,
110 UNE_F32,
111 UNE_F64,
112 OGE_F32,
113 OGE_F64,
114 OLT_F32,
115 OLT_F64,
116 OLE_F32,
117 OLE_F64,
118 OGT_F32,
119 OGT_F64,
120 UO_F32,
121 UO_F64,
122
123 UNKNOWN_LIBCALL
124 };
125 }
12640
12741 //===----------------------------------------------------------------------===//
12842 /// TargetLowering - This class defines information used to lower LLVM code to
955869
956870 /// setLibcallName - Rename the default libcall routine name for the specified
957871 /// libcall.
958 void setLibcallName(RTLIB::Libcall Call, std::string Name) {
872 void setLibcallName(RTLIB::Libcall Call, const char *Name) {
959873 LibcallRoutineNames[Call] = Name;
960874 }
961875
962876 /// getLibcallName - Get the libcall routine name for the specified libcall.
963877 ///
964878 const char *getLibcallName(RTLIB::Libcall Call) const {
965 return LibcallRoutineNames[Call].c_str();
879 return LibcallRoutineNames[Call];
966880 }
967881
968882 protected:
11001014
11011015 /// LibcallRoutineNames - Stores the name each libcall.
11021016 ///
1103 std::string LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL];
1017 const char *LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL];
11041018
11051019 protected:
11061020 /// When lowering %llvm.memset this field specifies the maximum number of