2007-01-12 22:49:32 +00:00
|
|
|
//===-- CodeGen/RuntimeLibcall.h - Runtime Library Calls --------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 19:59:42 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-01-12 22:49:32 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the enum representing the list of runtime library calls
|
2008-07-17 02:36:29 +00:00
|
|
|
// the backend may emit during code generation, and also some helper functions.
|
2007-01-12 22:49:32 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
|
|
|
|
#define LLVM_CODEGEN_RUNTIMELIBCALLS_H
|
|
|
|
|
2008-07-17 02:36:29 +00:00
|
|
|
#include "llvm/CodeGen/ValueTypes.h"
|
|
|
|
|
2007-01-12 22:49:32 +00:00
|
|
|
namespace llvm {
|
|
|
|
namespace RTLIB {
|
|
|
|
/// RTLIB::Libcall enum - This enum defines all of the runtime library calls
|
2007-10-05 20:04:43 +00: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 20:41:29 +00:00
|
|
|
///
|
2007-10-19 00:59:18 +00: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 22:49:32 +00:00
|
|
|
///
|
|
|
|
enum Libcall {
|
|
|
|
// Integer
|
2009-01-18 18:25:27 +00:00
|
|
|
SHL_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
SHL_I32,
|
|
|
|
SHL_I64,
|
2008-07-11 16:52:29 +00:00
|
|
|
SHL_I128,
|
2009-01-18 18:25:27 +00:00
|
|
|
SRL_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
SRL_I32,
|
|
|
|
SRL_I64,
|
2008-07-11 16:52:29 +00:00
|
|
|
SRL_I128,
|
2009-01-18 18:25:27 +00:00
|
|
|
SRA_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
SRA_I32,
|
|
|
|
SRA_I64,
|
2008-07-11 16:52:29 +00:00
|
|
|
SRA_I128,
|
2009-11-07 17:14:39 +00:00
|
|
|
MUL_I8,
|
2009-01-18 18:25:27 +00:00
|
|
|
MUL_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
MUL_I32,
|
|
|
|
MUL_I64,
|
2008-07-10 15:35:05 +00:00
|
|
|
MUL_I128,
|
2011-06-17 20:41:29 +00:00
|
|
|
MULO_I32,
|
|
|
|
MULO_I64,
|
|
|
|
MULO_I128,
|
2009-11-07 17:14:39 +00:00
|
|
|
SDIV_I8,
|
2009-05-03 13:18:16 +00:00
|
|
|
SDIV_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
SDIV_I32,
|
|
|
|
SDIV_I64,
|
2008-07-10 15:35:05 +00:00
|
|
|
SDIV_I128,
|
2009-11-07 17:14:39 +00:00
|
|
|
UDIV_I8,
|
2009-05-03 13:18:16 +00:00
|
|
|
UDIV_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
UDIV_I32,
|
|
|
|
UDIV_I64,
|
2008-07-10 15:35:05 +00:00
|
|
|
UDIV_I128,
|
2009-11-07 17:14:39 +00:00
|
|
|
SREM_I8,
|
2009-05-03 13:18:16 +00:00
|
|
|
SREM_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
SREM_I32,
|
|
|
|
SREM_I64,
|
2008-07-10 15:35:05 +00:00
|
|
|
SREM_I128,
|
2009-11-07 17:14:39 +00:00
|
|
|
UREM_I8,
|
2009-05-03 13:18:16 +00:00
|
|
|
UREM_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
UREM_I32,
|
|
|
|
UREM_I64,
|
2008-07-10 15:35:05 +00:00
|
|
|
UREM_I128,
|
2011-04-01 00:42:02 +00:00
|
|
|
SDIVREM_I8,
|
|
|
|
SDIVREM_I16,
|
|
|
|
SDIVREM_I32,
|
|
|
|
SDIVREM_I64,
|
|
|
|
SDIVREM_I128,
|
|
|
|
UDIVREM_I8,
|
|
|
|
UDIVREM_I16,
|
|
|
|
UDIVREM_I32,
|
|
|
|
UDIVREM_I64,
|
|
|
|
UDIVREM_I128,
|
2007-01-12 22:49:32 +00:00
|
|
|
NEG_I32,
|
|
|
|
NEG_I64,
|
|
|
|
|
|
|
|
// FLOATING POINT
|
|
|
|
ADD_F32,
|
|
|
|
ADD_F64,
|
2008-01-10 10:28:30 +00:00
|
|
|
ADD_F80,
|
2007-10-05 20:04:43 +00:00
|
|
|
ADD_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
SUB_F32,
|
|
|
|
SUB_F64,
|
2008-01-10 10:28:30 +00:00
|
|
|
SUB_F80,
|
2007-10-05 20:04:43 +00:00
|
|
|
SUB_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
MUL_F32,
|
|
|
|
MUL_F64,
|
2008-01-10 10:28:30 +00:00
|
|
|
MUL_F80,
|
2007-10-05 20:04:43 +00:00
|
|
|
MUL_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
DIV_F32,
|
|
|
|
DIV_F64,
|
2008-01-10 10:28:30 +00:00
|
|
|
DIV_F80,
|
2007-10-05 20:04:43 +00:00
|
|
|
DIV_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
REM_F32,
|
|
|
|
REM_F64,
|
2008-01-10 10:28:30 +00:00
|
|
|
REM_F80,
|
2007-10-05 20:04:43 +00:00
|
|
|
REM_PPCF128,
|
2011-07-08 21:39:21 +00:00
|
|
|
FMA_F32,
|
|
|
|
FMA_F64,
|
|
|
|
FMA_F80,
|
|
|
|
FMA_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
POWI_F32,
|
|
|
|
POWI_F64,
|
2007-10-05 20:04:43 +00:00
|
|
|
POWI_F80,
|
|
|
|
POWI_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
SQRT_F32,
|
|
|
|
SQRT_F64,
|
2007-10-05 20:04:43 +00:00
|
|
|
SQRT_F80,
|
|
|
|
SQRT_PPCF128,
|
2008-09-04 00:47:13 +00: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 22:49:32 +00:00
|
|
|
SIN_F32,
|
|
|
|
SIN_F64,
|
2008-01-10 10:28:30 +00:00
|
|
|
SIN_F80,
|
|
|
|
SIN_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
COS_F32,
|
|
|
|
COS_F64,
|
2008-01-10 10:28:30 +00:00
|
|
|
COS_F80,
|
|
|
|
COS_PPCF128,
|
2007-10-11 23:09:10 +00:00
|
|
|
POW_F32,
|
|
|
|
POW_F64,
|
|
|
|
POW_F80,
|
|
|
|
POW_PPCF128,
|
2008-08-21 18:38:14 +00: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 21:08:40 +00:00
|
|
|
COPYSIGN_F32,
|
|
|
|
COPYSIGN_F64,
|
|
|
|
COPYSIGN_F80,
|
|
|
|
COPYSIGN_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
|
|
|
|
// CONVERSION
|
|
|
|
FPEXT_F32_F64,
|
2010-03-14 18:42:24 +00:00
|
|
|
FPEXT_F16_F32,
|
|
|
|
FPROUND_F32_F16,
|
2007-01-12 22:49:32 +00:00
|
|
|
FPROUND_F64_F32,
|
2008-08-07 19:01:24 +00:00
|
|
|
FPROUND_F80_F32,
|
|
|
|
FPROUND_PPCF128_F32,
|
|
|
|
FPROUND_F80_F64,
|
|
|
|
FPROUND_PPCF128_F64,
|
2009-06-16 09:03:58 +00:00
|
|
|
FPTOSINT_F32_I8,
|
|
|
|
FPTOSINT_F32_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
FPTOSINT_F32_I32,
|
|
|
|
FPTOSINT_F32_I64,
|
2008-03-10 23:03:31 +00:00
|
|
|
FPTOSINT_F32_I128,
|
2010-03-26 21:32:14 +00:00
|
|
|
FPTOSINT_F64_I8,
|
|
|
|
FPTOSINT_F64_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
FPTOSINT_F64_I32,
|
|
|
|
FPTOSINT_F64_I64,
|
2008-03-10 23:03:31 +00:00
|
|
|
FPTOSINT_F64_I128,
|
2008-07-10 15:33:02 +00:00
|
|
|
FPTOSINT_F80_I32,
|
2007-10-05 20:04:43 +00:00
|
|
|
FPTOSINT_F80_I64,
|
2008-03-10 23:03:31 +00:00
|
|
|
FPTOSINT_F80_I128,
|
2008-06-25 20:24:48 +00:00
|
|
|
FPTOSINT_PPCF128_I32,
|
2007-10-05 20:04:43 +00:00
|
|
|
FPTOSINT_PPCF128_I64,
|
2008-03-10 23:03:31 +00:00
|
|
|
FPTOSINT_PPCF128_I128,
|
2009-06-16 09:03:58 +00:00
|
|
|
FPTOUINT_F32_I8,
|
|
|
|
FPTOUINT_F32_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
FPTOUINT_F32_I32,
|
|
|
|
FPTOUINT_F32_I64,
|
2008-03-10 23:03:31 +00:00
|
|
|
FPTOUINT_F32_I128,
|
2010-03-26 21:32:14 +00:00
|
|
|
FPTOUINT_F64_I8,
|
|
|
|
FPTOUINT_F64_I16,
|
2007-01-12 22:49:32 +00:00
|
|
|
FPTOUINT_F64_I32,
|
|
|
|
FPTOUINT_F64_I64,
|
2008-03-10 23:03:31 +00:00
|
|
|
FPTOUINT_F64_I128,
|
2007-10-05 20:04:43 +00:00
|
|
|
FPTOUINT_F80_I32,
|
|
|
|
FPTOUINT_F80_I64,
|
2008-03-10 23:03:31 +00:00
|
|
|
FPTOUINT_F80_I128,
|
2008-06-25 20:24:48 +00:00
|
|
|
FPTOUINT_PPCF128_I32,
|
2007-10-05 20:04:43 +00:00
|
|
|
FPTOUINT_PPCF128_I64,
|
2008-03-10 23:03:31 +00:00
|
|
|
FPTOUINT_PPCF128_I128,
|
2007-01-12 22:49:32 +00:00
|
|
|
SINTTOFP_I32_F32,
|
|
|
|
SINTTOFP_I32_F64,
|
2008-07-11 16:57:02 +00:00
|
|
|
SINTTOFP_I32_F80,
|
|
|
|
SINTTOFP_I32_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
SINTTOFP_I64_F32,
|
|
|
|
SINTTOFP_I64_F64,
|
2007-10-05 20:04:43 +00:00
|
|
|
SINTTOFP_I64_F80,
|
|
|
|
SINTTOFP_I64_PPCF128,
|
2008-03-05 01:08:17 +00:00
|
|
|
SINTTOFP_I128_F32,
|
|
|
|
SINTTOFP_I128_F64,
|
|
|
|
SINTTOFP_I128_F80,
|
|
|
|
SINTTOFP_I128_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
UINTTOFP_I32_F32,
|
|
|
|
UINTTOFP_I32_F64,
|
2008-07-11 17:00:14 +00:00
|
|
|
UINTTOFP_I32_F80,
|
|
|
|
UINTTOFP_I32_PPCF128,
|
2007-01-12 22:49:32 +00:00
|
|
|
UINTTOFP_I64_F32,
|
|
|
|
UINTTOFP_I64_F64,
|
2008-07-11 17:00:14 +00:00
|
|
|
UINTTOFP_I64_F80,
|
|
|
|
UINTTOFP_I64_PPCF128,
|
|
|
|
UINTTOFP_I128_F32,
|
|
|
|
UINTTOFP_I128_F64,
|
|
|
|
UINTTOFP_I128_F80,
|
|
|
|
UINTTOFP_I128_PPCF128,
|
2007-01-12 22:49:32 +00: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 09:26:31 +00:00
|
|
|
O_F32,
|
|
|
|
O_F64,
|
2007-01-12 22:49:32 +00:00
|
|
|
|
2009-07-30 09:12:56 +00:00
|
|
|
// MEMORY
|
|
|
|
MEMCPY,
|
|
|
|
MEMSET,
|
|
|
|
MEMMOVE,
|
|
|
|
|
2009-05-22 20:36:31 +00:00
|
|
|
// EXCEPTION HANDLING
|
|
|
|
UNWIND_RESUME,
|
|
|
|
|
2010-06-18 21:43:38 +00: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-18 23:03:10 +00: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 21:43:38 +00: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 22:49:32 +00:00
|
|
|
UNKNOWN_LIBCALL
|
|
|
|
};
|
2008-07-17 02:36:29 +00:00
|
|
|
|
|
|
|
/// getFPEXT - Return the FPEXT_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-10 22:56:29 +00:00
|
|
|
Libcall getFPEXT(EVT OpVT, EVT RetVT);
|
2008-07-17 02:36:29 +00:00
|
|
|
|
|
|
|
/// getFPROUND - Return the FPROUND_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-10 22:56:29 +00:00
|
|
|
Libcall getFPROUND(EVT OpVT, EVT RetVT);
|
2008-07-17 02:36:29 +00:00
|
|
|
|
|
|
|
/// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-10 22:56:29 +00:00
|
|
|
Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
|
2008-07-17 02:36:29 +00:00
|
|
|
|
|
|
|
/// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-10 22:56:29 +00:00
|
|
|
Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
|
2008-07-17 02:36:29 +00:00
|
|
|
|
|
|
|
/// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-10 22:56:29 +00:00
|
|
|
Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
|
2008-07-17 02:36:29 +00:00
|
|
|
|
|
|
|
/// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
|
|
|
|
/// UNKNOWN_LIBCALL if there is none.
|
2009-08-10 22:56:29 +00:00
|
|
|
Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
|
2007-01-12 22:49:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|