221 const llvm::Type*
const targetType,
222 const std::string& twine =
"")
225#define BIND_ARITHMETIC_CAST_OP(Function, Twine) \
226 std::bind(&Function, \
227 std::placeholders::_1, \
228 std::placeholders::_2, \
229 std::placeholders::_3, \
232#if LLVM_VERSION_MAJOR >= 19
234#define BIND_ARITHMETIC_CAST_OP_TRUNC(Function, Twine) \
235 std::bind(&Function, \
236 std::placeholders::_1, \
237 std::placeholders::_2, \
238 std::placeholders::_3, \
243#define BIND_ARITHMETIC_CAST_OP_TRUNC(Function, Twine) \
244 std::bind(&Function, \
245 std::placeholders::_1, \
246 std::placeholders::_2, \
247 std::placeholders::_3, \
251#if LLVM_VERSION_MAJOR >= 19
253#define BIND_ARITHMETIC_CAST_OP_UIFP(Function, Twine) \
254 std::bind(&Function, \
255 std::placeholders::_1, \
256 std::placeholders::_2, \
257 std::placeholders::_3, \
261#define BIND_ARITHMETIC_CAST_OP_UIFP(Function, Twine) \
262 std::bind(&Function, \
263 std::placeholders::_1, \
264 std::placeholders::_2, \
265 std::placeholders::_3, \
269#if LLVM_VERSION_MAJOR >= 18
271#define BIND_ARITHMETIC_CAST_OP_ZEXT(Function, Twine) \
272 std::bind(&Function, \
273 std::placeholders::_1, \
274 std::placeholders::_2, \
275 std::placeholders::_3, \
279#define BIND_ARITHMETIC_CAST_OP_ZEXT(Function, Twine) \
280 std::bind(&Function, \
281 std::placeholders::_1, \
282 std::placeholders::_2, \
283 std::placeholders::_3, \
287#if LLVM_VERSION_MAJOR >= 20
288#define BIND_ARITHMETIC_CAST_OP_FP(Function, Twine) \
289 std::bind(&Function, \
290 std::placeholders::_1, \
291 std::placeholders::_2, \
292 std::placeholders::_3, \
296#define BIND_ARITHMETIC_CAST_OP_FP(Function, Twine) \
297 std::bind(&Function, \
298 std::placeholders::_1, \
299 std::placeholders::_2, \
300 std::placeholders::_3, \
304 if (targetType->isDoubleTy()) {
313 else if (targetType->isFloatTy()) {
322 else if (targetType->isHalfTy()) {
331 else if (targetType->isIntegerTy(64)) {
340 else if (targetType->isIntegerTy(32)) {
349 else if (targetType->isIntegerTy(16)) {
358 else if (targetType->isIntegerTy(8)) {
367 else if (targetType->isIntegerTy(1)) {
377#undef BIND_ARITHMETIC_CAST_OP