llvm.org GIT mirror llvm / 068da27
Validation fixes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42230 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 13 years ago
1 changed file(s) with 12 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
106106
Add support to the C backend in lib/Target/CBackend/
107107
108108
Depending on the intrinsic, there are a few ways to implement this. For
109 most intrinsics, it makes sense to add code to lower your intrinsic in
110 LowerIntrinsicCall in lib/CodeGen/IntrinsicLowering.cpp.
111 Second, if it makes sense to lower the intrinsic to an expanded sequence of C
112 code in all cases, just emit the expansion in visitCallInst in
113 Writer.cpp. If the intrinsic has some way to express it with GCC
114 (or any other compiler) extensions, it can be conditionally supported based on
115 the compiler compiling the CBE output (see llvm.prefetch for an
116 example).
117 Third, if the intrinsic really has no way to be lowered, just have the code
118 generator emit code that prints an error message and calls abort if executed.
119
120
121
109 most intrinsics, it makes sense to add code to lower your intrinsic in
110 LowerIntrinsicCall in lib/CodeGen/IntrinsicLowering.cpp.
111 Second, if it makes sense to lower the intrinsic to an expanded sequence of
112 C code in all cases, just emit the expansion in visitCallInst in
113 Writer.cpp. If the intrinsic has some way to express it with GCC
114 (or any other compiler) extensions, it can be conditionally supported based
115 on the compiler compiling the CBE output (see llvm.prefetch for an
116 example). Third, if the intrinsic really has no way to be lowered, just
117 have the code generator emit code that prints an error message and calls
118 abort if executed.
119
122120
Add support to the .td file for the target(s) of your choice in
123121 lib/Target/*/*.td.
124122
126124 the intrinsic, though it may obviously require adding the instructions you
127125 want to generate as well. There are lots of examples in the PowerPC and X86
128126 backend to follow.
127
129128
130129
131130