2007-01-12 23:49:32 +01:00
|
|
|
//===-- CodeGen/RuntimeLibcall.h - Runtime Library Calls --------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:59:42 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-01-12 23:49:32 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the enum representing the list of runtime library calls
|
2008-07-17 04:36:29 +02:00
|
|
|
// the backend may emit during code generation, and also some helper functions.
|
2007-01-12 23:49:32 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
|
|
|
|
#define LLVM_CODEGEN_RUNTIMELIBCALLS_H
|
|
|
|
|
2008-07-17 04:36:29 +02:00
|
|
|
#include "llvm/CodeGen/ValueTypes.h"
|
|
|
|
|
2007-01-12 23:49:32 +01:00
|
|
|
namespace llvm {
|
|
|
|
namespace RTLIB {
|
|
|
|
/// RTLIB::Libcall enum - This enum defines all of the runtime library calls
|
2007-10-05 22:04:43 +02:00
|
|
|
/// the backend can emit. The various long double types cannot be merged,
|
|
|
|
/// because 80-bit library functions use "xf" and 128-bit use "tf".
|
2011-06-17 22:41:29 +02:00
|
|
|
///
|
2007-10-19 02:59:18 +02:00
|
|
|
/// When adding PPCF128 functions here, note that their names generally need
|
|
|
|
/// to be overridden for Darwin with the xxx$LDBL128 form. See
|
|
|
|
/// PPCISelLowering.cpp.
|
2007-01-12 23:49:32 +01:00
|
|
|
///
|
|
|
|
enum Libcall {
|
|
|
|
// Integer
|
2009-01-18 19:25:27 +01:00
|
|
|
SHL_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
SHL_I32,
|
|
|
|
SHL_I64,
|
2008-07-11 18:52:29 +02:00
|
|
|
SHL_I128,
|
2009-01-18 19:25:27 +01:00
|
|
|
SRL_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
SRL_I32,
|
|
|
|
SRL_I64,
|
2008-07-11 18:52:29 +02:00
|
|
|
SRL_I128,
|
2009-01-18 19:25:27 +01:00
|
|
|
SRA_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
SRA_I32,
|
|
|
|
SRA_I64,
|
2008-07-11 18:52:29 +02:00
|
|
|
SRA_I128,
|
2009-11-07 18:14:39 +01:00
|
|
|
MUL_I8,
|
2009-01-18 19:25:27 +01:00
|
|
|
MUL_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
MUL_I32,
|
|
|
|
MUL_I64,
|
2008-07-10 17:35:05 +02:00
|
|
|
MUL_I128,
|
2011-06-17 22:41:29 +02:00
|
|
|
MULO_I32,
|
|
|
|
MULO_I64,
|
|
|
|
MULO_I128,
|
2009-11-07 18:14:39 +01:00
|
|
|
SDIV_I8,
|
2009-05-03 15:18:16 +02:00
|
|
|
SDIV_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
SDIV_I32,
|
|
|
|
SDIV_I64,
|
2008-07-10 17:35:05 +02:00
|
|
|
SDIV_I128,
|
2009-11-07 18:14:39 +01:00
|
|
|
UDIV_I8,
|
2009-05-03 15:18:16 +02:00
|
|
|
UDIV_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
UDIV_I32,
|
|
|
|
UDIV_I64,
|
2008-07-10 17:35:05 +02:00
|
|
|
UDIV_I128,
|
2009-11-07 18:14:39 +01:00
|
|
|
SREM_I8,
|
2009-05-03 15:18:16 +02:00
|
|
|
SREM_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
SREM_I32,
|
|
|
|
SREM_I64,
|
2008-07-10 17:35:05 +02:00
|
|
|
SREM_I128,
|
2009-11-07 18:14:39 +01:00
|
|
|
UREM_I8,
|
2009-05-03 15:18:16 +02:00
|
|
|
UREM_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
UREM_I32,
|
|
|
|
UREM_I64,
|
2008-07-10 17:35:05 +02:00
|
|
|
UREM_I128,
|
2011-04-01 02:42:02 +02:00
|
|
|
SDIVREM_I8,
|
|
|
|
SDIVREM_I16,
|
|
|
|
SDIVREM_I32,
|
|
|
|
SDIVREM_I64,
|
|
|
|
SDIVREM_I128,
|
|
|
|
UDIVREM_I8,
|
|
|
|
UDIVREM_I16,
|
|
|
|
UDIVREM_I32,
|
|
|
|
UDIVREM_I64,
|
|
|
|
UDIVREM_I128,
|
2007-01-12 23:49:32 +01:00
|
|
|
NEG_I32,
|
|
|
|
NEG_I64,
|
|
|
|
|
|
|
|
// FLOATING POINT
|
|
|
|
ADD_F32,
|
|
|
|
ADD_F64,
|
2008-01-10 11:28:30 +01:00
|
|
|
ADD_F80,
|
2007-10-05 22:04:43 +02:00
|
|
|
ADD_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
SUB_F32,
|
|
|
|
SUB_F64,
|
2008-01-10 11:28:30 +01:00
|
|
|
SUB_F80,
|
2007-10-05 22:04:43 +02:00
|
|
|
SUB_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
MUL_F32,
|
|
|
|
MUL_F64,
|
2008-01-10 11:28:30 +01:00
|
|
|
MUL_F80,
|
2007-10-05 22:04:43 +02:00
|
|
|
MUL_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
DIV_F32,
|
|
|
|
DIV_F64,
|
2008-01-10 11:28:30 +01:00
|
|
|
DIV_F80,
|
2007-10-05 22:04:43 +02:00
|
|
|
DIV_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
REM_F32,
|
|
|
|
REM_F64,
|
2008-01-10 11:28:30 +01:00
|
|
|
REM_F80,
|
2007-10-05 22:04:43 +02:00
|
|
|
REM_PPCF128,
|
2011-07-08 23:39:21 +02:00
|
|
|
FMA_F32,
|
|
|
|
FMA_F64,
|
|
|
|
FMA_F80,
|
|
|
|
FMA_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
POWI_F32,
|
|
|
|
POWI_F64,
|
2007-10-05 22:04:43 +02:00
|
|
|
POWI_F80,
|
|
|
|
POWI_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
SQRT_F32,
|
|
|
|
SQRT_F64,
|
2007-10-05 22:04:43 +02:00
|
|
|
SQRT_F80,
|
|
|
|
SQRT_PPCF128,
|
2008-09-04 02:47:13 +02:00
|
|
|
LOG_F32,
|
|
|
|
LOG_F64,
|
|
|
|
LOG_F80,
|
|
|
|
LOG_PPCF128,
|
|
|
|
LOG2_F32,
|
|
|
|
LOG2_F64,
|
|
|
|
LOG2_F80,
|
|
|
|
LOG2_PPCF128,
|
|
|
|
LOG10_F32,
|
|
|
|
LOG10_F64,
|
|
|
|
LOG10_F80,
|
|
|
|
LOG10_PPCF128,
|
|
|
|
EXP_F32,
|
|
|
|
EXP_F64,
|
|
|
|
EXP_F80,
|
|
|
|
EXP_PPCF128,
|
|
|
|
EXP2_F32,
|
|
|
|
EXP2_F64,
|
|
|
|
EXP2_F80,
|
|
|
|
EXP2_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
SIN_F32,
|
|
|
|
SIN_F64,
|
2008-01-10 11:28:30 +01:00
|
|
|
SIN_F80,
|
|
|
|
SIN_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
COS_F32,
|
|
|
|
COS_F64,
|
2008-01-10 11:28:30 +01:00
|
|
|
COS_F80,
|
|
|
|
COS_PPCF128,
|
2007-10-12 01:09:10 +02:00
|
|
|
POW_F32,
|
|
|
|
POW_F64,
|
|
|
|
POW_F80,
|
|
|
|
POW_PPCF128,
|
2008-08-21 20:38:14 +02:00
|
|
|
CEIL_F32,
|
|
|
|
CEIL_F64,
|
|
|
|
CEIL_F80,
|
|
|
|
CEIL_PPCF128,
|
|
|
|
TRUNC_F32,
|
|
|
|
TRUNC_F64,
|
|
|
|
TRUNC_F80,
|
|
|
|
TRUNC_PPCF128,
|
|
|
|
RINT_F32,
|
|
|
|
RINT_F64,
|
|
|
|
RINT_F80,
|
|
|
|
RINT_PPCF128,
|
|
|
|
NEARBYINT_F32,
|
|
|
|
NEARBYINT_F64,
|
|
|
|
NEARBYINT_F80,
|
|
|
|
NEARBYINT_PPCF128,
|
|
|
|
FLOOR_F32,
|
|
|
|
FLOOR_F64,
|
|
|
|
FLOOR_F80,
|
|
|
|
FLOOR_PPCF128,
|
2010-03-14 22:08:40 +01:00
|
|
|
COPYSIGN_F32,
|
|
|
|
COPYSIGN_F64,
|
|
|
|
COPYSIGN_F80,
|
|
|
|
COPYSIGN_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
|
|
|
|
// CONVERSION
|
|
|
|
FPEXT_F32_F64,
|
2010-03-14 19:42:24 +01:00
|
|
|
FPEXT_F16_F32,
|
|
|
|
FPROUND_F32_F16,
|
2007-01-12 23:49:32 +01:00
|
|
|
FPROUND_F64_F32,
|
2008-08-07 21:01:24 +02:00
|
|
|
FPROUND_F80_F32,
|
|
|
|
FPROUND_PPCF128_F32,
|
|
|
|
FPROUND_F80_F64,
|
|
|
|
FPROUND_PPCF128_F64,
|
2009-06-16 11:03:58 +02:00
|
|
|
FPTOSINT_F32_I8,
|
|
|
|
FPTOSINT_F32_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
FPTOSINT_F32_I32,
|
|
|
|
FPTOSINT_F32_I64,
|
2008-03-11 00:03:31 +01:00
|
|
|
FPTOSINT_F32_I128,
|
2010-03-26 22:32:14 +01:00
|
|
|
FPTOSINT_F64_I8,
|
|
|
|
FPTOSINT_F64_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
FPTOSINT_F64_I32,
|
|
|
|
FPTOSINT_F64_I64,
|
2008-03-11 00:03:31 +01:00
|
|
|
FPTOSINT_F64_I128,
|
2008-07-10 17:33:02 +02:00
|
|
|
FPTOSINT_F80_I32,
|
2007-10-05 22:04:43 +02:00
|
|
|
FPTOSINT_F80_I64,
|
2008-03-11 00:03:31 +01:00
|
|
|
FPTOSINT_F80_I128,
|
2008-06-25 22:24:48 +02:00
|
|
|
FPTOSINT_PPCF128_I32,
|
2007-10-05 22:04:43 +02:00
|
|
|
FPTOSINT_PPCF128_I64,
|
2008-03-11 00:03:31 +01:00
|
|
|
FPTOSINT_PPCF128_I128,
|
2009-06-16 11:03:58 +02:00
|
|
|
FPTOUINT_F32_I8,
|
|
|
|
FPTOUINT_F32_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
FPTOUINT_F32_I32,
|
|
|
|
FPTOUINT_F32_I64,
|
2008-03-11 00:03:31 +01:00
|
|
|
FPTOUINT_F32_I128,
|
2010-03-26 22:32:14 +01:00
|
|
|
FPTOUINT_F64_I8,
|
|
|
|
FPTOUINT_F64_I16,
|
2007-01-12 23:49:32 +01:00
|
|
|
FPTOUINT_F64_I32,
|
|
|
|
FPTOUINT_F64_I64,
|
2008-03-11 00:03:31 +01:00
|
|
|
FPTOUINT_F64_I128,
|
2007-10-05 22:04:43 +02:00
|
|
|
FPTOUINT_F80_I32,
|
|
|
|
FPTOUINT_F80_I64,
|
2008-03-11 00:03:31 +01:00
|
|
|
FPTOUINT_F80_I128,
|
2008-06-25 22:24:48 +02:00
|
|
|
FPTOUINT_PPCF128_I32,
|
2007-10-05 22:04:43 +02:00
|
|
|
FPTOUINT_PPCF128_I64,
|
2008-03-11 00:03:31 +01:00
|
|
|
FPTOUINT_PPCF128_I128,
|
2007-01-12 23:49:32 +01:00
|
|
|
SINTTOFP_I32_F32,
|
|
|
|
SINTTOFP_I32_F64,
|
2008-07-11 18:57:02 +02:00
|
|
|
SINTTOFP_I32_F80,
|
|
|
|
SINTTOFP_I32_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
SINTTOFP_I64_F32,
|
|
|
|
SINTTOFP_I64_F64,
|
2007-10-05 22:04:43 +02:00
|
|
|
SINTTOFP_I64_F80,
|
|
|
|
SINTTOFP_I64_PPCF128,
|
2008-03-05 02:08:17 +01:00
|
|
|
SINTTOFP_I128_F32,
|
|
|
|
SINTTOFP_I128_F64,
|
|
|
|
SINTTOFP_I128_F80,
|
|
|
|
SINTTOFP_I128_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
UINTTOFP_I32_F32,
|
|
|
|
UINTTOFP_I32_F64,
|
2008-07-11 19:00:14 +02:00
|
|
|
UINTTOFP_I32_F80,
|
|
|
|
UINTTOFP_I32_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
UINTTOFP_I64_F32,
|
|
|
|
UINTTOFP_I64_F64,
|
2008-07-11 19:00:14 +02:00
|
|
|
UINTTOFP_I64_F80,
|
|
|
|
UINTTOFP_I64_PPCF128,
|
|
|
|
UINTTOFP_I128_F32,
|
|
|
|
UINTTOFP_I128_F64,
|
|
|
|
UINTTOFP_I128_F80,
|
|
|
|
UINTTOFP_I128_PPCF128,
|
2007-01-12 23:49:32 +01:00
|
|
|
|
|
|
|
// COMPARISON
|
|
|
|
OEQ_F32,
|
|
|
|
OEQ_F64,
|
|
|
|
UNE_F32,
|
|
|
|
UNE_F64,
|
|
|
|
OGE_F32,
|
|
|
|
OGE_F64,
|
|
|
|
OLT_F32,
|
|
|
|
OLT_F64,
|
|
|
|
OLE_F32,
|
|
|
|
OLE_F64,
|
|
|
|
OGT_F32,
|
|
|
|
OGT_F64,
|
|
|
|
UO_F32,
|
|
|
|
UO_F64,
|
2007-01-31 10:26:31 +01:00
|
|
|
O_F32,
|
|
|
|
O_F64,
|
2007-01-12 23:49:32 +01:00
|
|
|
|
2009-07-30 11:12:56 +02:00
|
|
|
// MEMORY
|
|
|
|
MEMCPY,
|
|
|
|
MEMSET,
|
|
|
|
MEMMOVE,
|
|
|
|
|
2009-05-22 22:36:31 +02:00
|
|
|
// EXCEPTION HANDLING
|
|
|
|
UNWIND_RESUME,
|
|
|
|
|
2010-06-18 23:43:38 +02:00
|
|
|
// Family ATOMICs
|
|
|
|
SYNC_VAL_COMPARE_AND_SWAP_1,
|
|
|
|
SYNC_VAL_COMPARE_AND_SWAP_2,
|
|
|
|
SYNC_VAL_COMPARE_AND_SWAP_4,
|
|
|
|
SYNC_VAL_COMPARE_AND_SWAP_8,
|
2010-06-19 01:03:10 +02:00
|
|
|
SYNC_LOCK_TEST_AND_SET_1,
|
|
|
|
SYNC_LOCK_TEST_AND_SET_2,
|
|
|
|
SYNC_LOCK_TEST_AND_SET_4,
|
|
|
|
SYNC_LOCK_TEST_AND_SET_8,
|
2010-06-18 23:43:38 +02:00
|
|
|
SYNC_FETCH_AND_ADD_1,
|
|
|
|
SYNC_FETCH_AND_ADD_2,
|
|
|
|
SYNC_FETCH_AND_ADD_4,
|
|
|
|
SYNC_FETCH_AND_ADD_8,
|
|
|
|
SYNC_FETCH_AND_SUB_1,
|
|
|
|
SYNC_FETCH_AND_SUB_2,
|
|
|
|
SYNC_FETCH_AND_SUB_4,
|
|
|
|
SYNC_FETCH_AND_SUB_8,
|
|
|
|
SYNC_FETCH_AND_AND_1,
|
|
|
|
SYNC_FETCH_AND_AND_2,
|
|
|
|
SYNC_FETCH_AND_AND_4,
|
|
|
|
SYNC_FETCH_AND_AND_8,
|
|
|
|
SYNC_FETCH_AND_OR_1,
|
|
|
|
SYNC_FETCH_AND_OR_2,
|
|
|
|
SYNC_FETCH_AND_OR_4,
|
|
|
|
SYNC_FETCH_AND_OR_8,
|
|
|
|
SYNC_FETCH_AND_XOR_1,
|
|
|
|
SYNC_FETCH_AND_XOR_2,
|
|
|
|
SYNC_FETCH_AND_XOR_4,
|
|
|
|
SYNC_FETCH_AND_XOR_8,
|
|
|
|
SYNC_FETCH_AND_NAND_1,
|
|
|
|
SYNC_FETCH_AND_NAND_2,
|
|
|
|
SYNC_FETCH_AND_NAND_4,
|
|
|
|
SYNC_FETCH_AND_NAND_8,
|
|
|
|
|
2007-01-12 23:49:32 +01:00
|
|
|
UNKNOWN_LIBCALL
|
|
|
|
};
|
2008-07-17 04:36:29 +02:00
|
|
|
|
|
|
|
/// getFPEXT - Return the FPEXT_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-11 00:56:29 +02:00
|
|
|
Libcall getFPEXT(EVT OpVT, EVT RetVT);
|
2008-07-17 04:36:29 +02:00
|
|
|
|
|
|
|
/// getFPROUND - Return the FPROUND_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-11 00:56:29 +02:00
|
|
|
Libcall getFPROUND(EVT OpVT, EVT RetVT);
|
2008-07-17 04:36:29 +02:00
|
|
|
|
|
|
|
/// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-11 00:56:29 +02:00
|
|
|
Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
|
2008-07-17 04:36:29 +02:00
|
|
|
|
|
|
|
/// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-11 00:56:29 +02:00
|
|
|
Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
|
2008-07-17 04:36:29 +02:00
|
|
|
|
|
|
|
/// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-11 00:56:29 +02:00
|
|
|
Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
|
2008-07-17 04:36:29 +02:00
|
|
|
|
|
|
|
/// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-11 00:56:29 +02:00
|
|
|
Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
|
2007-01-12 23:49:32 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|