//===-- llvm/RuntimeLibcallList.td - Describe libcalls --------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// include "llvm/IR/RuntimeLibcallsImpl.td" //-------------------------------------------------------------------- // Utility classes //-------------------------------------------------------------------- class DuplicateLibcallImplWithPrefix : RuntimeLibcallImpl; /// Libcall Predicates def isOSDarwin : RuntimeLibcallPredicate<"TT.isOSDarwin()">; def isOSOpenBSD : RuntimeLibcallPredicate<"TT.isOSOpenBSD()">; def isOSWindows : RuntimeLibcallPredicate<"TT.isOSWindows()">; def isNotOSWindows : RuntimeLibcallPredicate<"!TT.isOSWindows()">; def isNotOSMSVCRT : RuntimeLibcallPredicate<"!TT.isOSMSVCRT()">; def isPS : RuntimeLibcallPredicate<"TT.isPS()">; def isNotOSWindowsOrIsCygwinMinGW : RuntimeLibcallPredicate<"!TT.isOSWindows() || TT.isOSCygMing()">; def isGNUEnvironment : RuntimeLibcallPredicate<"TT.isGNUEnvironment()">; def darwinHasSinCosStret : RuntimeLibcallPredicate<"darwinHasSinCosStret(TT)">; def darwinHasExp10 : RuntimeLibcallPredicate<"darwinHasExp10(TT)">; def hasSinCos : RuntimeLibcallPredicate<"hasSinCos(TT)">; // FIXME: Way to combine predicates def hasSinCos_f32_f64 : RuntimeLibcallPredicate<"hasSinCos_f32_f64(TT)">; //-------------------------------------------------------------------- // Declare all kinds of used libcalls //-------------------------------------------------------------------- // Integer foreach IntTy = ["I16", "I32", "I64", "I128"] in { def SHL_#IntTy : RuntimeLibcall; def SRL_#IntTy : RuntimeLibcall; def SRA_#IntTy : RuntimeLibcall; } foreach IntTy = ["I8", "I16", "I32", "I64", "I128"] in { def MUL_#IntTy : RuntimeLibcall; } foreach IntTy = ["I32", "I64", "I128" ] in { def MULO_#IntTy : RuntimeLibcall; } foreach IntTy = ["I8", "I16", "I32", "I64", "I128"] in { def SDIV_#IntTy : RuntimeLibcall; def UDIV_#IntTy : RuntimeLibcall; def SREM_#IntTy : RuntimeLibcall; def UREM_#IntTy : RuntimeLibcall; def SDIVREM_#IntTy : RuntimeLibcall; def UDIVREM_#IntTy : RuntimeLibcall; } foreach IntTy = ["I32", "I64" ] in { def NEG_#IntTy : RuntimeLibcall; } foreach IntTy = ["I32", "I64", "I128"] in { def CTLZ_#IntTy : RuntimeLibcall; def CTPOP_#IntTy : RuntimeLibcall; } foreach FPTy = ["F32", "F64", "F80", "F128", "PPCF128"] in { def ADD_#FPTy : RuntimeLibcall; def FAST_ADD_#FPTy : RuntimeLibcall; def SUB_#FPTy : RuntimeLibcall; def FAST_SUB_#FPTy : RuntimeLibcall; def MUL_#FPTy : RuntimeLibcall; def FAST_MUL_#FPTy : RuntimeLibcall; def DIV_#FPTy : RuntimeLibcall; def FAST_DIV_#FPTy : RuntimeLibcall; def REM_#FPTy : RuntimeLibcall; def FMA_#FPTy : RuntimeLibcall; def POWI_#FPTy : RuntimeLibcall; def SQRT_#FPTy : RuntimeLibcall; def FAST_SQRT_#FPTy : RuntimeLibcall; def CBRT_#FPTy : RuntimeLibcall; def LOG_#FPTy : RuntimeLibcall; def LOG_FINITE_#FPTy : RuntimeLibcall; def LOG2_#FPTy : RuntimeLibcall; def LOG2_FINITE_#FPTy : RuntimeLibcall; def LOG10_#FPTy : RuntimeLibcall; def LOG10_FINITE_#FPTy : RuntimeLibcall; def EXP_#FPTy : RuntimeLibcall; def EXP_FINITE_#FPTy : RuntimeLibcall; def EXP2_#FPTy : RuntimeLibcall; def EXP2_FINITE_#FPTy : RuntimeLibcall; def EXP10_#FPTy : RuntimeLibcall; def EXP10_FINITE_#FPTy : RuntimeLibcall; def SIN_#FPTy : RuntimeLibcall; def COS_#FPTy : RuntimeLibcall; def TAN_#FPTy : RuntimeLibcall; def SINH_#FPTy : RuntimeLibcall; def COSH_#FPTy : RuntimeLibcall; def TANH_#FPTy : RuntimeLibcall; def ASIN_#FPTy : RuntimeLibcall; def ACOS_#FPTy : RuntimeLibcall; def ATAN_#FPTy : RuntimeLibcall; def ATAN2_#FPTy : RuntimeLibcall; def SINCOS_#FPTy : RuntimeLibcall; } foreach FPTy = [ "F32", "F64" ] in { def SINCOS_STRET_#FPTy : RuntimeLibcall; } foreach FPTy = ["F32", "F64", "F80", "F128", "PPCF128"] in { def POW_#FPTy : RuntimeLibcall; def POW_FINITE_#FPTy : RuntimeLibcall; def CEIL_#FPTy : RuntimeLibcall; def TRUNC_#FPTy : RuntimeLibcall; def RINT_#FPTy : RuntimeLibcall; def NEARBYINT_#FPTy : RuntimeLibcall; def ROUND_#FPTy : RuntimeLibcall; def ROUNDEVEN_#FPTy : RuntimeLibcall; def FLOOR_#FPTy : RuntimeLibcall; def COPYSIGN_#FPTy : RuntimeLibcall; def FMIN_#FPTy : RuntimeLibcall; def FMAX_#FPTy : RuntimeLibcall; def FMINIMUM_#FPTy : RuntimeLibcall; def FMAXIMUM_#FPTy : RuntimeLibcall; def FMINIMUM_NUM_#FPTy : RuntimeLibcall; def FMAXIMUM_NUM_#FPTy : RuntimeLibcall; def LROUND_#FPTy : RuntimeLibcall; def LLROUND_#FPTy : RuntimeLibcall; def LRINT_#FPTy : RuntimeLibcall; def LLRINT_#FPTy : RuntimeLibcall; def LDEXP_#FPTy : RuntimeLibcall; def FREXP_#FPTy : RuntimeLibcall; def SINCOSPI_#FPTy : RuntimeLibcall; def MODF_#FPTy : RuntimeLibcall; } def FEGETENV : RuntimeLibcall; def FESETENV : RuntimeLibcall; def FEGETMODE : RuntimeLibcall; def FESETMODE : RuntimeLibcall; def FPEXT_BF16_F32 : RuntimeLibcall; def FPEXT_F32_PPCF128 : RuntimeLibcall; def FPEXT_F64_PPCF128 : RuntimeLibcall; def FPEXT_F80_F128 : RuntimeLibcall; def FPEXT_F64_F128 : RuntimeLibcall; def FPEXT_F32_F128 : RuntimeLibcall; def FPEXT_F16_F128 : RuntimeLibcall; def FPEXT_F16_F80 : RuntimeLibcall; def FPEXT_F32_F64 : RuntimeLibcall; def FPEXT_F16_F64 : RuntimeLibcall; def FPEXT_F16_F32 : RuntimeLibcall; def FPROUND_F32_F16 : RuntimeLibcall; def FPROUND_F64_F16 : RuntimeLibcall; def FPROUND_F80_F16 : RuntimeLibcall; def FPROUND_F128_F16 : RuntimeLibcall; def FPROUND_PPCF128_F16 : RuntimeLibcall; def FPROUND_F32_BF16 : RuntimeLibcall; def FPROUND_F64_BF16 : RuntimeLibcall; def FPROUND_F80_BF16 : RuntimeLibcall; def FPROUND_F128_BF16 : RuntimeLibcall; def FPROUND_F64_F32 : RuntimeLibcall; def FPROUND_F80_F32 : RuntimeLibcall; def FPROUND_F128_F32 : RuntimeLibcall; def FPROUND_PPCF128_F32 : RuntimeLibcall; def FPROUND_F80_F64 : RuntimeLibcall; def FPROUND_F128_F64 : RuntimeLibcall; def FPROUND_PPCF128_F64 : RuntimeLibcall; def FPROUND_F128_F80 : RuntimeLibcall; def FPTOSINT_F16_I32 : RuntimeLibcall; def FPTOSINT_F16_I64 : RuntimeLibcall; def FPTOSINT_F16_I128 : RuntimeLibcall; def FPTOSINT_F32_I32 : RuntimeLibcall; def FPTOSINT_F32_I64 : RuntimeLibcall; def FPTOSINT_F32_I128 : RuntimeLibcall; def FPTOSINT_F64_I32 : RuntimeLibcall; def FPTOSINT_F64_I64 : RuntimeLibcall; def FPTOSINT_F64_I128 : RuntimeLibcall; def FPTOSINT_F80_I32 : RuntimeLibcall; def FPTOSINT_F80_I64 : RuntimeLibcall; def FPTOSINT_F80_I128 : RuntimeLibcall; def FPTOSINT_F128_I32 : RuntimeLibcall; def FPTOSINT_F128_I64 : RuntimeLibcall; def FPTOSINT_F128_I128 : RuntimeLibcall; def FPTOSINT_PPCF128_I32 : RuntimeLibcall; def FPTOSINT_PPCF128_I64 : RuntimeLibcall; def FPTOSINT_PPCF128_I128 : RuntimeLibcall; def FPTOUINT_F16_I32 : RuntimeLibcall; def FPTOUINT_F16_I64 : RuntimeLibcall; def FPTOUINT_F16_I128 : RuntimeLibcall; def FPTOUINT_F32_I32 : RuntimeLibcall; def FPTOUINT_F32_I64 : RuntimeLibcall; def FPTOUINT_F32_I128 : RuntimeLibcall; def FPTOUINT_F64_I32 : RuntimeLibcall; def FPTOUINT_F64_I64 : RuntimeLibcall; def FPTOUINT_F64_I128 : RuntimeLibcall; def FPTOUINT_F80_I32 : RuntimeLibcall; def FPTOUINT_F80_I64 : RuntimeLibcall; def FPTOUINT_F80_I128 : RuntimeLibcall; def FPTOUINT_F128_I32 : RuntimeLibcall; def FPTOUINT_F128_I64 : RuntimeLibcall; def FPTOUINT_F128_I128 : RuntimeLibcall; def FPTOUINT_PPCF128_I32 : RuntimeLibcall; def FPTOUINT_PPCF128_I64 : RuntimeLibcall; def FPTOUINT_PPCF128_I128 : RuntimeLibcall; def SINTTOFP_I32_F16 : RuntimeLibcall; def SINTTOFP_I32_F32 : RuntimeLibcall; def SINTTOFP_I32_F64 : RuntimeLibcall; def SINTTOFP_I32_F80 : RuntimeLibcall; def SINTTOFP_I32_F128 : RuntimeLibcall; def SINTTOFP_I32_PPCF128 : RuntimeLibcall; def SINTTOFP_I64_BF16 : RuntimeLibcall; def SINTTOFP_I64_F16 : RuntimeLibcall; def SINTTOFP_I64_F32 : RuntimeLibcall; def SINTTOFP_I64_F64 : RuntimeLibcall; def SINTTOFP_I64_F80 : RuntimeLibcall; def SINTTOFP_I64_F128 : RuntimeLibcall; def SINTTOFP_I64_PPCF128 : RuntimeLibcall; def SINTTOFP_I128_F16 : RuntimeLibcall; def SINTTOFP_I128_F32 : RuntimeLibcall; def SINTTOFP_I128_F64 : RuntimeLibcall; def SINTTOFP_I128_F80 : RuntimeLibcall; def SINTTOFP_I128_F128 : RuntimeLibcall; def SINTTOFP_I128_PPCF128 : RuntimeLibcall; def UINTTOFP_I32_F16 : RuntimeLibcall; def UINTTOFP_I32_F32 : RuntimeLibcall; def UINTTOFP_I32_F64 : RuntimeLibcall; def UINTTOFP_I32_F80 : RuntimeLibcall; def UINTTOFP_I32_F128 : RuntimeLibcall; def UINTTOFP_I32_PPCF128 : RuntimeLibcall; def UINTTOFP_I64_BF16 : RuntimeLibcall; def UINTTOFP_I64_F16 : RuntimeLibcall; def UINTTOFP_I64_F32 : RuntimeLibcall; def UINTTOFP_I64_F64 : RuntimeLibcall; def UINTTOFP_I64_F80 : RuntimeLibcall; def UINTTOFP_I64_F128 : RuntimeLibcall; def UINTTOFP_I64_PPCF128 : RuntimeLibcall; def UINTTOFP_I128_F16 : RuntimeLibcall; def UINTTOFP_I128_F32 : RuntimeLibcall; def UINTTOFP_I128_F64 : RuntimeLibcall; def UINTTOFP_I128_F80 : RuntimeLibcall; def UINTTOFP_I128_F128 : RuntimeLibcall; def UINTTOFP_I128_PPCF128 : RuntimeLibcall; def CONVERT_F128_PPCF128 : RuntimeLibcall; def CONVERT_PPCF128_F128 : RuntimeLibcall; // Comparisons foreach FPTy = ["F32", "F64", "F128", "PPCF128"] in { def OEQ_#FPTy : RuntimeLibcall; def UNE_#FPTy : RuntimeLibcall; def OGE_#FPTy : RuntimeLibcall; def OLT_#FPTy : RuntimeLibcall; def OLE_#FPTy : RuntimeLibcall; def OGT_#FPTy : RuntimeLibcall; def UO_#FPTy : RuntimeLibcall; } // Memory def MEMCPY : RuntimeLibcall; def MEMMOVE : RuntimeLibcall; def MEMSET : RuntimeLibcall; def CALLOC : RuntimeLibcall; def BZERO : RuntimeLibcall; // Element-wise unordered-atomic memory of different sizes foreach MemSize = [1, 2, 4, 8, 16] in { def MEMCPY_ELEMENT_UNORDERED_ATOMIC_#MemSize : RuntimeLibcall; def MEMMOVE_ELEMENT_UNORDERED_ATOMIC_#MemSize : RuntimeLibcall; def MEMSET_ELEMENT_UNORDERED_ATOMIC_#MemSize : RuntimeLibcall; } // Exception handling def UNWIND_RESUME : RuntimeLibcall; def UNWIND_REGISTER : RuntimeLibcall; def UNWIND_UNREGISTER : RuntimeLibcall; def UNWIND_CALL_PERSONALITY : RuntimeLibcall; def CXA_END_CLEANUP : RuntimeLibcall; // Note: there are two sets of atomics libcalls; see // for more info on the // difference between them. // Atomic '__sync_*' libcalls. defset list LibCalls__sync = { foreach MemSize = [1, 2, 4, 8, 16] in { def SYNC_VAL_COMPARE_AND_SWAP_#MemSize : RuntimeLibcall; def SYNC_LOCK_TEST_AND_SET_#MemSize : RuntimeLibcall; def SYNC_FETCH_AND_ADD_#MemSize : RuntimeLibcall; def SYNC_FETCH_AND_SUB_#MemSize : RuntimeLibcall; def SYNC_FETCH_AND_AND_#MemSize : RuntimeLibcall; def SYNC_FETCH_AND_OR_#MemSize : RuntimeLibcall; def SYNC_FETCH_AND_XOR_#MemSize : RuntimeLibcall; def SYNC_FETCH_AND_NAND_#MemSize : RuntimeLibcall; def SYNC_FETCH_AND_MAX_#MemSize : RuntimeLibcall; def SYNC_FETCH_AND_UMAX_#MemSize : RuntimeLibcall; def SYNC_FETCH_AND_MIN_#MemSize : RuntimeLibcall; def SYNC_FETCH_AND_UMIN_#MemSize : RuntimeLibcall; } } defset list LibCalls__atomic = { // Atomic `__atomic_*' libcalls. foreach MemSize = ["", "_1", "_2", "_4", "_8", "_16"] in { def ATOMIC_LOAD#MemSize : RuntimeLibcall; def ATOMIC_STORE#MemSize : RuntimeLibcall; def ATOMIC_EXCHANGE#MemSize : RuntimeLibcall; def ATOMIC_COMPARE_EXCHANGE#MemSize : RuntimeLibcall; } foreach MemSize = [1, 2, 4, 8, 16] in { def ATOMIC_FETCH_ADD_#MemSize : RuntimeLibcall; def ATOMIC_FETCH_SUB_#MemSize : RuntimeLibcall; def ATOMIC_FETCH_AND_#MemSize : RuntimeLibcall; def ATOMIC_FETCH_OR_#MemSize : RuntimeLibcall; def ATOMIC_FETCH_XOR_#MemSize : RuntimeLibcall; def ATOMIC_FETCH_NAND_#MemSize : RuntimeLibcall; } } multiclass AtomicOrderSizeLibcall { def _RELAX : RuntimeLibcall; def _ACQ : RuntimeLibcall; def _REL : RuntimeLibcall; def _ACQ_REL : RuntimeLibcall; } multiclass AtomicOrderSizeLibcallImpl { def _relax : RuntimeLibcallImpl(ProvidesBase#"_RELAX")>; def _acq : RuntimeLibcallImpl(ProvidesBase#"_ACQ")>; def _rel : RuntimeLibcallImpl(ProvidesBase#"_REL")>; def _acq_rel : RuntimeLibcallImpl(ProvidesBase#"_ACQ_REL")>; } // Out-of-line atomics libcalls defset list LibCalls__OutOfLineAtomic = { foreach MemSize = [1, 2, 4, 8, 16] in { defm OUTLINE_ATOMIC_CAS#MemSize : AtomicOrderSizeLibcall; defm OUTLINE_ATOMIC_SWP#MemSize : AtomicOrderSizeLibcall; defm OUTLINE_ATOMIC_LDADD#MemSize : AtomicOrderSizeLibcall; defm OUTLINE_ATOMIC_LDSET#MemSize : AtomicOrderSizeLibcall; defm OUTLINE_ATOMIC_LDCLR#MemSize : AtomicOrderSizeLibcall; defm OUTLINE_ATOMIC_LDEOR#MemSize : AtomicOrderSizeLibcall; } } // Stack Protector Fail def STACKPROTECTOR_CHECK_FAIL : RuntimeLibcall; def STACK_SMASH_HANDLER : RuntimeLibcall; // Safe stack def SAFESTACK_POINTER_ADDRESS : RuntimeLibcall; // Deoptimization def DEOPTIMIZE : RuntimeLibcall; // Return address def RETURN_ADDRESS : RuntimeLibcall; // Clear cache def CLEAR_CACHE : RuntimeLibcall; def RISCV_FLUSH_ICACHE : RuntimeLibcall; // Mips16 calls def MIPS16_RET_DC : RuntimeLibcall; def MIPS16_RET_DF : RuntimeLibcall; def MIPS16_RET_SC : RuntimeLibcall; def MIPS16_RET_SF : RuntimeLibcall; multiclass LibmLongDoubleLibCall { def NAME#"_f128" : RuntimeLibcallImpl(libcall_basename#"_F128"), !strconcat(rtbasename, "l")>; def NAME#"_ppcf128" : RuntimeLibcallImpl(libcall_basename#"_PPCF128"), !strconcat(rtbasename, "l")>; def NAME#"_f80" : RuntimeLibcallImpl(libcall_basename#"_F80"), !strconcat(rtbasename, "l")>; } // AArch64 calls def SC_MEMCPY : RuntimeLibcall; def SC_MEMMOVE : RuntimeLibcall; def SC_MEMSET : RuntimeLibcall; // ARM EABI calls def AEABI_MEMCPY4 : RuntimeLibcall; // Align 4 def AEABI_MEMCPY8 : RuntimeLibcall; // Align 8 def AEABI_MEMMOVE4 : RuntimeLibcall; def AEABI_MEMMOVE8 : RuntimeLibcall; def AEABI_MEMSET4 : RuntimeLibcall; def AEABI_MEMSET8 : RuntimeLibcall; def AEABI_MEMCLR : RuntimeLibcall; def AEABI_MEMCLR4 : RuntimeLibcall; def AEABI_MEMCLR8 : RuntimeLibcall; // Hexagon calls def HEXAGON_MEMCPY_LIKELY_ALIGNED_MIN32BYTES_MULT8BYTES : RuntimeLibcall; // XCore calls def MEMCPY_ALIGN_4 : RuntimeLibcall; // Objective-C calls def OBJC_AUTORELEASE : RuntimeLibcall; def OBJC_AUTORELEASEPOOLPOP : RuntimeLibcall; def OBJC_AUTORELEASEPOOLPUSH : RuntimeLibcall; def OBJC_AUTORELEASERETURNVALUE : RuntimeLibcall; def OBJC_COPYWEAK : RuntimeLibcall; def OBJC_DESTROYWEAK : RuntimeLibcall; def OBJC_INITWEAK : RuntimeLibcall; def OBJC_LOADWEAK : RuntimeLibcall; def OBJC_LOADWEAKRETAINED : RuntimeLibcall; def OBJC_MOVEWEAK : RuntimeLibcall; def OBJC_RELEASE : RuntimeLibcall; def OBJC_RETAIN : RuntimeLibcall; def OBJC_RETAINAUTORELEASE : RuntimeLibcall; def OBJC_RETAINAUTORELEASERETURNVALUE : RuntimeLibcall; def OBJC_RETAINAUTORELEASEDRETURNVALUE : RuntimeLibcall; def OBJC_CLAIMAUTORELEASEDRETURNVALUE : RuntimeLibcall; def OBJC_RETAINBLOCK : RuntimeLibcall; def OBJC_STORESTRONG : RuntimeLibcall; def OBJC_STOREWEAK : RuntimeLibcall; def OBJC_UNSAFECLAIMAUTORELEASEDRETURNVALUE : RuntimeLibcall; def OBJC_RETAINEDOBJECT : RuntimeLibcall; def OBJC_UNRETAINEDOBJECT : RuntimeLibcall; def OBJC_UNRETAINEDPOINTER : RuntimeLibcall; def OBJC_RETAIN_AUTORELEASE : RuntimeLibcall; def OBJC_SYNC_ENTER : RuntimeLibcall; def OBJC_SYNC_EXIT : RuntimeLibcall; //-------------------------------------------------------------------- // Define implementation default libcalls //-------------------------------------------------------------------- let IsDefault = true in { //-------------------------------------------------------------------- // compiler-rt / libgcc //-------------------------------------------------------------------- def __ashlhi3 : RuntimeLibcallImpl; def __ashlsi3 : RuntimeLibcallImpl; def __ashldi3 : RuntimeLibcallImpl; def __lshrhi3 : RuntimeLibcallImpl; def __lshrsi3 : RuntimeLibcallImpl; def __lshrdi3 : RuntimeLibcallImpl; def __ashrhi3 : RuntimeLibcallImpl; def __ashrsi3 : RuntimeLibcallImpl; def __ashrdi3 : RuntimeLibcallImpl; def __mulqi3 : RuntimeLibcallImpl; def __mulhi3 : RuntimeLibcallImpl; def __mulsi3 : RuntimeLibcallImpl; def __muldi3 : RuntimeLibcallImpl; def __mulosi4 : RuntimeLibcallImpl; def __divqi3 : RuntimeLibcallImpl; def __divhi3 : RuntimeLibcallImpl; def __divsi3 : RuntimeLibcallImpl; def __divdi3 : RuntimeLibcallImpl; def __divti3 : RuntimeLibcallImpl; def __udivqi3 : RuntimeLibcallImpl; def __udivhi3 : RuntimeLibcallImpl; def __udivsi3 : RuntimeLibcallImpl; def __udivdi3 : RuntimeLibcallImpl; def __udivti3 : RuntimeLibcallImpl; def __modqi3 : RuntimeLibcallImpl; def __modhi3 : RuntimeLibcallImpl; def __modsi3 : RuntimeLibcallImpl; def __moddi3 : RuntimeLibcallImpl; def __modti3 : RuntimeLibcallImpl; def __umodqi3 : RuntimeLibcallImpl; def __umodhi3 : RuntimeLibcallImpl; def __umodsi3 : RuntimeLibcallImpl; def __umoddi3 : RuntimeLibcallImpl; def __umodti3 : RuntimeLibcallImpl; def __negsi2 : RuntimeLibcallImpl; def __negdi2 : RuntimeLibcallImpl; def __clzsi2 : RuntimeLibcallImpl; def __clzdi2 : RuntimeLibcallImpl; def __clzti2 : RuntimeLibcallImpl; def __popcountsi2 : RuntimeLibcallImpl; def __popcountdi2 : RuntimeLibcallImpl; def __popcountti2 : RuntimeLibcallImpl; def __addsf3 : RuntimeLibcallImpl; def __adddf3 : RuntimeLibcallImpl; def __addxf3 : RuntimeLibcallImpl; def __addtf3 : RuntimeLibcallImpl; def __gcc_qadd : RuntimeLibcallImpl; def __subsf3 : RuntimeLibcallImpl; def __subdf3 : RuntimeLibcallImpl; def __subxf3 : RuntimeLibcallImpl; def __subtf3 : RuntimeLibcallImpl; def __gcc_qsub : RuntimeLibcallImpl; def __mulsf3 : RuntimeLibcallImpl; def __muldf3 : RuntimeLibcallImpl; def __mulxf3 : RuntimeLibcallImpl; def __multf3 : RuntimeLibcallImpl; def __gcc_qmul : RuntimeLibcallImpl; def __divsf3 : RuntimeLibcallImpl; def __divdf3 : RuntimeLibcallImpl; def __divxf3 : RuntimeLibcallImpl; def __divtf3 : RuntimeLibcallImpl; def __gcc_qdiv : RuntimeLibcallImpl; defset list PowiLibcallImpls = { def __powisf2 : RuntimeLibcallImpl; def __powidf2 : RuntimeLibcallImpl; def __powixf2 : RuntimeLibcallImpl; def __powitf2_f128 : RuntimeLibcallImpl; def __powitf2_ppc128 : RuntimeLibcallImpl; } // Conversion def __extendbfsf2 : RuntimeLibcallImpl; def __gcc_stoq : RuntimeLibcallImpl; def __gcc_dtoq : RuntimeLibcallImpl; def __extendxftf2 : RuntimeLibcallImpl; def __extenddftf2 : RuntimeLibcallImpl; def __extendsftf2 : RuntimeLibcallImpl; def __extendhftf2 : RuntimeLibcallImpl; def __extendhfxf2 : RuntimeLibcallImpl; def __extendsfdf2 : RuntimeLibcallImpl; def __extendhfdf2 : RuntimeLibcallImpl; def __extendhfsf2 : RuntimeLibcallImpl; def __truncsfhf2 : RuntimeLibcallImpl; def __truncdfhf2 : RuntimeLibcallImpl; def __truncxfhf2 : RuntimeLibcallImpl; def __trunctfhf2_f128 : RuntimeLibcallImpl; def __trunctfhf2_ppcf128 : RuntimeLibcallImpl; def __truncsfbf2 : RuntimeLibcallImpl; def __truncdfbf2 : RuntimeLibcallImpl; def __truncxfbf2 : RuntimeLibcallImpl; def __trunctfbf2 : RuntimeLibcallImpl; def __truncdfsf2 : RuntimeLibcallImpl; def __truncxfsf2 : RuntimeLibcallImpl; def __trunctfsf2 : RuntimeLibcallImpl; def __gcc_qtos : RuntimeLibcallImpl; def __truncxfdf2 : RuntimeLibcallImpl; def __trunctfdf2 : RuntimeLibcallImpl; def __gcc_qtod : RuntimeLibcallImpl; def __trunctfxf2 : RuntimeLibcallImpl; def __fixhfsi : RuntimeLibcallImpl; def __fixhfdi : RuntimeLibcallImpl; def __fixhfti : RuntimeLibcallImpl; def __fixsfsi : RuntimeLibcallImpl; def __fixsfdi : RuntimeLibcallImpl; def __fixsfti : RuntimeLibcallImpl; def __fixdfsi : RuntimeLibcallImpl; def __fixdfdi : RuntimeLibcallImpl; def __fixdfti : RuntimeLibcallImpl; def __fixxfsi : RuntimeLibcallImpl; def __fixxfdi : RuntimeLibcallImpl; def __fixxfti : RuntimeLibcallImpl; def __fixtfsi : RuntimeLibcallImpl; def __fixtfdi_f128 : RuntimeLibcallImpl; def __fixtfti_f128 : RuntimeLibcallImpl; def __gcc_qtou : RuntimeLibcallImpl; def __fixtfdi_ppcf128 : RuntimeLibcallImpl; def __fixtfti_ppcf128 : RuntimeLibcallImpl; def __fixunshfsi : RuntimeLibcallImpl; def __fixunshfdi : RuntimeLibcallImpl; def __fixunshfti : RuntimeLibcallImpl; def __fixunssfsi : RuntimeLibcallImpl; def __fixunssfdi : RuntimeLibcallImpl; def __fixunssfti : RuntimeLibcallImpl; def __fixunsdfsi : RuntimeLibcallImpl; def __fixunsdfdi : RuntimeLibcallImpl; def __fixunsdfti : RuntimeLibcallImpl; def __fixunsxfsi : RuntimeLibcallImpl; def __fixunsxfdi : RuntimeLibcallImpl; def __fixunsxfti : RuntimeLibcallImpl; def __fixunstfsi_f128 : RuntimeLibcallImpl; def __fixunstfdi_f128 : RuntimeLibcallImpl; def __fixunstfti_f128 : RuntimeLibcallImpl; def __fixunstfsi_ppcf128 : RuntimeLibcallImpl; def __fixunstfdi_ppcf128 : RuntimeLibcallImpl; def __fixunstfti_ppcf128 : RuntimeLibcallImpl; def __floatsihf : RuntimeLibcallImpl; def __floatsisf : RuntimeLibcallImpl; def __floatsidf : RuntimeLibcallImpl; def __floatsixf : RuntimeLibcallImpl; def __floatsitf : RuntimeLibcallImpl; def __gcc_itoq : RuntimeLibcallImpl; def __floatdibf : RuntimeLibcallImpl; def __floatdihf : RuntimeLibcallImpl; def __floatdisf : RuntimeLibcallImpl; def __floatdidf : RuntimeLibcallImpl; def __floatdixf : RuntimeLibcallImpl; def __floatditf_f128 : RuntimeLibcallImpl; def __floatditf_ppcf128 : RuntimeLibcallImpl; def __floattihf : RuntimeLibcallImpl; def __floattisf : RuntimeLibcallImpl; def __floattidf : RuntimeLibcallImpl; def __floattixf : RuntimeLibcallImpl; def __floattitf_f128 : RuntimeLibcallImpl; def __floattitf_ppcf128 : RuntimeLibcallImpl; def __floatunsihf : RuntimeLibcallImpl; def __floatunsisf : RuntimeLibcallImpl; def __floatunsidf : RuntimeLibcallImpl; def __floatunsixf : RuntimeLibcallImpl; def __floatunsitf : RuntimeLibcallImpl; def __gcc_utoq : RuntimeLibcallImpl; def __floatundibf : RuntimeLibcallImpl; def __floatundihf : RuntimeLibcallImpl; def __floatundisf : RuntimeLibcallImpl; def __floatundidf : RuntimeLibcallImpl; def __floatundixf : RuntimeLibcallImpl; def __floatunditf_f128 : RuntimeLibcallImpl; def __floatunditf_ppcf128 : RuntimeLibcallImpl; def __floatuntihf : RuntimeLibcallImpl; def __floatuntisf : RuntimeLibcallImpl; def __floatuntidf : RuntimeLibcallImpl; def __floatuntixf : RuntimeLibcallImpl; def __floatuntitf_f128 : RuntimeLibcallImpl; def __floatuntitf_ppcf128 : RuntimeLibcallImpl; def __extendkftf2 : RuntimeLibcallImpl; def __trunctfkf2 : RuntimeLibcallImpl; // Comparison def __eqsf2 : RuntimeLibcallImpl; def __eqdf2 : RuntimeLibcallImpl; def __eqtf2 : RuntimeLibcallImpl; def __gcc_qeq : RuntimeLibcallImpl; def __nesf2 : RuntimeLibcallImpl; def __nedf2 : RuntimeLibcallImpl; def __netf2 : RuntimeLibcallImpl; def __gcc_qne : RuntimeLibcallImpl; def __gesf2 : RuntimeLibcallImpl; def __gedf2 : RuntimeLibcallImpl; def __getf2 : RuntimeLibcallImpl; def __gcc_qge : RuntimeLibcallImpl; def __ltsf2 : RuntimeLibcallImpl; def __ltdf2 : RuntimeLibcallImpl; def __lttf2 : RuntimeLibcallImpl; def __gcc_qlt : RuntimeLibcallImpl; def __lesf2 : RuntimeLibcallImpl; def __ledf2 : RuntimeLibcallImpl; def __letf2 : RuntimeLibcallImpl; def __gcc_qle : RuntimeLibcallImpl; def __gtsf2 : RuntimeLibcallImpl; def __gtdf2 : RuntimeLibcallImpl; def __gttf2 : RuntimeLibcallImpl; def __gcc_qgt : RuntimeLibcallImpl; def __unordsf2 : RuntimeLibcallImpl; def __unorddf2 : RuntimeLibcallImpl; def __unordtf2 : RuntimeLibcallImpl; def __gcc_qunord : RuntimeLibcallImpl; // Element-wise unordered-atomic memory of different sizes foreach MemSize = [ 1, 2, 4, 8, 16 ] in { def __llvm_memcpy_element_unordered_atomic_#MemSize : RuntimeLibcallImpl< !cast("MEMCPY_ELEMENT_UNORDERED_ATOMIC_"#MemSize)>; def __llvm_memmove_element_unordered_atomic_#MemSize : RuntimeLibcallImpl< !cast("MEMMOVE_ELEMENT_UNORDERED_ATOMIC_"#MemSize)>; def __llvm_memset_element_unordered_atomic_#MemSize : RuntimeLibcallImpl< !cast("MEMSET_ELEMENT_UNORDERED_ATOMIC_"#MemSize)>; } // Exception handling def _Unwind_Resume : RuntimeLibcallImpl; def __cxa_end_cleanup : RuntimeLibcallImpl; // Atomic '__sync_*' libcalls. foreach lc = LibCalls__sync in { def __#!tolower(!cast(lc)) : RuntimeLibcallImpl; } // Atomic `__atomic_*' libcalls. foreach lc = LibCalls__atomic in { def __#!tolower(!cast(lc)) : RuntimeLibcallImpl; } // Stack Protector Fail def __stack_chk_fail : RuntimeLibcallImpl; // Safe stack. def __safestack_pointer_address : RuntimeLibcallImpl; // Deoptimization def __llvm_deoptimize : RuntimeLibcallImpl; // Clear cache def __clear_cache : RuntimeLibcallImpl; //-------------------------------------------------------------------- // libm //-------------------------------------------------------------------- def fmodf : RuntimeLibcallImpl; def fmod : RuntimeLibcallImpl; def fmodl_f128 : RuntimeLibcallImpl; def fmodl_f80 : RuntimeLibcallImpl; def fmodl_ppc128 : RuntimeLibcallImpl; def fmaf : RuntimeLibcallImpl; def fma : RuntimeLibcallImpl; defm fma : LibmLongDoubleLibCall; def sqrtf : RuntimeLibcallImpl; def sqrt : RuntimeLibcallImpl; defm sqrt : LibmLongDoubleLibCall; def cbrtf : RuntimeLibcallImpl; def cbrt : RuntimeLibcallImpl; defm cbrt : LibmLongDoubleLibCall; def logf : RuntimeLibcallImpl; def log : RuntimeLibcallImpl; defm log : LibmLongDoubleLibCall; def __logf_finite : RuntimeLibcallImpl; def __log_finite : RuntimeLibcallImpl; def __logl_finite_f80 : RuntimeLibcallImpl; def __logl_finite_f128 : RuntimeLibcallImpl; def __logl_finite_ppcf128 : RuntimeLibcallImpl; def log2f : RuntimeLibcallImpl; def log2 : RuntimeLibcallImpl; defm log2 : LibmLongDoubleLibCall; def __log2f_finite : RuntimeLibcallImpl; def __log2_finite : RuntimeLibcallImpl; def __log2l_finite_f80 : RuntimeLibcallImpl; def __log2l_finite_f128 : RuntimeLibcallImpl; def __log2l_finite_ppcf128 : RuntimeLibcallImpl; def log10f : RuntimeLibcallImpl; def log10 : RuntimeLibcallImpl; defm log10 : LibmLongDoubleLibCall; def __log10f_finite : RuntimeLibcallImpl; def __log10_finite : RuntimeLibcallImpl; def __log10l_finite_f80 : RuntimeLibcallImpl; def __log10l_finite_f128 : RuntimeLibcallImpl; def __log10l_finite_ppcf128 : RuntimeLibcallImpl; def expf : RuntimeLibcallImpl; def exp : RuntimeLibcallImpl; defm exp : LibmLongDoubleLibCall<"EXP", "exp">; def __expf_finite : RuntimeLibcallImpl; def __exp_finite : RuntimeLibcallImpl; def __expl_finite_f80 : RuntimeLibcallImpl; def __expl_finite_f128 : RuntimeLibcallImpl; def __expl_finite_ppcf128 : RuntimeLibcallImpl; def exp2f : RuntimeLibcallImpl; def exp2 : RuntimeLibcallImpl; defm exp2 : LibmLongDoubleLibCall<"EXP2", "exp2">; def __exp2f_finite : RuntimeLibcallImpl; def __exp2_finite : RuntimeLibcallImpl; def __exp2l_finite_f80 : RuntimeLibcallImpl; def __exp2l_finite_f128 : RuntimeLibcallImpl; def __exp2l_finite_ppcf128 : RuntimeLibcallImpl; def exp10f : RuntimeLibcallImpl; def exp10 : RuntimeLibcallImpl; def exp10l_f80 : RuntimeLibcallImpl; def exp10l_f128 : RuntimeLibcallImpl; def exp10l_ppcf128 : RuntimeLibcallImpl; def sinf : RuntimeLibcallImpl; def sin : RuntimeLibcallImpl; defm sin : LibmLongDoubleLibCall; def cosf : RuntimeLibcallImpl; def cos : RuntimeLibcallImpl; defm cos : LibmLongDoubleLibCall; def tanf : RuntimeLibcallImpl; def tan : RuntimeLibcallImpl; defm tan : LibmLongDoubleLibCall; def sinhf : RuntimeLibcallImpl; def sinh : RuntimeLibcallImpl; defm sinh : LibmLongDoubleLibCall; def coshf : RuntimeLibcallImpl; def cosh : RuntimeLibcallImpl; defm cosh : LibmLongDoubleLibCall; def tanhf : RuntimeLibcallImpl; def tanh : RuntimeLibcallImpl; defm tanh : LibmLongDoubleLibCall; def asinf : RuntimeLibcallImpl; def asin : RuntimeLibcallImpl; defm asin : LibmLongDoubleLibCall; def acosf : RuntimeLibcallImpl; def acos : RuntimeLibcallImpl; defm acos : LibmLongDoubleLibCall; def atanf : RuntimeLibcallImpl; def atan : RuntimeLibcallImpl; defm atan : LibmLongDoubleLibCall; def atan2f : RuntimeLibcallImpl; def atan2 : RuntimeLibcallImpl; defm atan2 : LibmLongDoubleLibCall; def powf : RuntimeLibcallImpl; def pow : RuntimeLibcallImpl; defm pow : LibmLongDoubleLibCall; def __powf_finite : RuntimeLibcallImpl; def __pow_finite : RuntimeLibcallImpl; def __powl_finite_f80 : RuntimeLibcallImpl; def __powl_finite_f128 : RuntimeLibcallImpl; def __powl_finite_ppcf128 : RuntimeLibcallImpl; def ceilf : RuntimeLibcallImpl; def ceil : RuntimeLibcallImpl; defm ceil : LibmLongDoubleLibCall; def truncf : RuntimeLibcallImpl; def trunc : RuntimeLibcallImpl; defm trunc : LibmLongDoubleLibCall; def rintf : RuntimeLibcallImpl; def rint : RuntimeLibcallImpl; defm rint : LibmLongDoubleLibCall; def nearbyintf : RuntimeLibcallImpl; def nearbyint : RuntimeLibcallImpl; defm nearbyint : LibmLongDoubleLibCall; def roundf : RuntimeLibcallImpl; def round : RuntimeLibcallImpl; defm round : LibmLongDoubleLibCall; def roundevenf : RuntimeLibcallImpl; def roundeven : RuntimeLibcallImpl; defm roundeven : LibmLongDoubleLibCall; def floorf : RuntimeLibcallImpl; def floor : RuntimeLibcallImpl; defm floor : LibmLongDoubleLibCall; def copysignf : RuntimeLibcallImpl; def copysign : RuntimeLibcallImpl; defm copysign : LibmLongDoubleLibCall; def fminf : RuntimeLibcallImpl; def fmin : RuntimeLibcallImpl; defm fmin : LibmLongDoubleLibCall; def fmaxf : RuntimeLibcallImpl; def fmax : RuntimeLibcallImpl; defm fmax : LibmLongDoubleLibCall; def fminimumf : RuntimeLibcallImpl; def fminimum : RuntimeLibcallImpl; defm fminimum : LibmLongDoubleLibCall; def fmaximumf : RuntimeLibcallImpl; def fmaximum : RuntimeLibcallImpl; defm fmaximum : LibmLongDoubleLibCall; def fminimum_numf : RuntimeLibcallImpl; def fminimum_num : RuntimeLibcallImpl; defm fminimum_num : LibmLongDoubleLibCall; def fmaximum_numf : RuntimeLibcallImpl; def fmaximum_num : RuntimeLibcallImpl; defm fmaximum_num : LibmLongDoubleLibCall; def lroundf : RuntimeLibcallImpl; def lround : RuntimeLibcallImpl; defm lround : LibmLongDoubleLibCall; def llroundf : RuntimeLibcallImpl; def llround : RuntimeLibcallImpl; defm llround : LibmLongDoubleLibCall; def lrintf : RuntimeLibcallImpl; def lrint : RuntimeLibcallImpl; defm lrint : LibmLongDoubleLibCall; def llrintf : RuntimeLibcallImpl; def llrint : RuntimeLibcallImpl; defm llrint : LibmLongDoubleLibCall; def ldexpf : RuntimeLibcallImpl; def ldexp : RuntimeLibcallImpl; defm ldexp : LibmLongDoubleLibCall; def frexpf : RuntimeLibcallImpl; def frexp : RuntimeLibcallImpl; defm frexp : LibmLongDoubleLibCall; def sincospif : RuntimeLibcallImpl; def sincospi : RuntimeLibcallImpl; defm sincospi : LibmLongDoubleLibCall; def modff : RuntimeLibcallImpl; def modf : RuntimeLibcallImpl; defm modf : LibmLongDoubleLibCall; // Floating point environment def fegetenv : RuntimeLibcallImpl; def fesetenv : RuntimeLibcallImpl; // Floating point control modes def fegetmode : RuntimeLibcallImpl; def fesetmode : RuntimeLibcallImpl; //-------------------------------------------------------------------- // libc //-------------------------------------------------------------------- // Memory def memcpy : RuntimeLibcallImpl; def memmove : RuntimeLibcallImpl; def memset : RuntimeLibcallImpl; // DSEPass can emit calloc if it finds a pair of malloc/memset def calloc : RuntimeLibcallImpl; } // End let IsDefault = true //-------------------------------------------------------------------- // compiler-rt/libgcc but 64-bit only, not available by default //-------------------------------------------------------------------- // Exist in libgcc and compiler-rt for 64-bit targets, or if // COMPILER_RT_ENABLE_SOFTWARE_INT128. defset list Int128RTLibcalls = { def __ashlti3 : RuntimeLibcallImpl; def __lshrti3 : RuntimeLibcallImpl; def __ashrti3 : RuntimeLibcallImpl; def __multi3 : RuntimeLibcallImpl; } //-------------------------------------------------------------------- // compiler-rt only, not available by default //-------------------------------------------------------------------- defset list CompilerRTOnlyInt64Libcalls = { def __mulodi4 : RuntimeLibcallImpl; } defset list CompilerRTOnlyInt128Libcalls = { def __muloti4 : RuntimeLibcallImpl; } //-------------------------------------------------------------------- // Define implementation other libcalls //-------------------------------------------------------------------- // TODO: Define other custom names targets use to override def __exp10f : RuntimeLibcallImpl; def __exp10 : RuntimeLibcallImpl; def __sincosf_stret : RuntimeLibcallImpl; def __sincos_stret : RuntimeLibcallImpl; def sincosf : RuntimeLibcallImpl; def sincos : RuntimeLibcallImpl; defm sincos : LibmLongDoubleLibCall; def bzero : RuntimeLibcallImpl; def __bzero : RuntimeLibcallImpl; def _Unwind_SjLj_Resume : RuntimeLibcallImpl; def _Unwind_SjLj_Register : RuntimeLibcallImpl; def _Unwind_SjLj_Unregister : RuntimeLibcallImpl; def _Unwind_CallPersonality : RuntimeLibcallImpl; // Used on OpenBSD def __stack_smash_handler : RuntimeLibcallImpl; def __riscv_flush_icache : RuntimeLibcallImpl; //===----------------------------------------------------------------------===// // F128 libm Runtime Libcalls //===----------------------------------------------------------------------===// defset list LibmF128Libcalls = { def logf128 : RuntimeLibcallImpl; def log2f128 : RuntimeLibcallImpl; def log10f128 : RuntimeLibcallImpl; def expf128 : RuntimeLibcallImpl; def exp2f128 : RuntimeLibcallImpl; def exp10f128 : RuntimeLibcallImpl; def sinf128 : RuntimeLibcallImpl; def cosf128 : RuntimeLibcallImpl; def tanf128 : RuntimeLibcallImpl; def tanhf128 : RuntimeLibcallImpl; def sincosf128 : RuntimeLibcallImpl; def powf128 : RuntimeLibcallImpl; def fminf128 : RuntimeLibcallImpl; def fmaxf128 : RuntimeLibcallImpl; def fmodf128 : RuntimeLibcallImpl; def sqrtf128 : RuntimeLibcallImpl; def ceilf128 : RuntimeLibcallImpl; def floorf128 : RuntimeLibcallImpl; def truncf128 : RuntimeLibcallImpl; def roundf128 : RuntimeLibcallImpl; def lroundf128 : RuntimeLibcallImpl; def llroundf128 : RuntimeLibcallImpl; def rintf128 : RuntimeLibcallImpl; def lrintf128 : RuntimeLibcallImpl; def llrintf128 : RuntimeLibcallImpl; def nearbyintf128 : RuntimeLibcallImpl; def fmaf128 : RuntimeLibcallImpl; def frexpf128 : RuntimeLibcallImpl; def cbrtf128 : RuntimeLibcallImpl; def fminimumf128 : RuntimeLibcallImpl; def fmaximumf128 : RuntimeLibcallImpl; def fminimum_numf128 : RuntimeLibcallImpl; def fmaximum_numf128 : RuntimeLibcallImpl; def asinf128 : RuntimeLibcallImpl; def acosf128 : RuntimeLibcallImpl; def atanf128 : RuntimeLibcallImpl; def atan2f128 : RuntimeLibcallImpl; def ldexpf128 : RuntimeLibcallImpl; def roundevenf128 : RuntimeLibcallImpl; def modff128 : RuntimeLibcallImpl; def sinhf128 : RuntimeLibcallImpl; def coshf128 : RuntimeLibcallImpl; def copysignf128 : RuntimeLibcallImpl; } defset list LibmF128FiniteLibcalls = { def __logf128_finite : RuntimeLibcallImpl; def __log2f128_finite : RuntimeLibcallImpl; def __log10f128_finite : RuntimeLibcallImpl; def __expf128_finite : RuntimeLibcallImpl; def __exp2f128_finite : RuntimeLibcallImpl; def __exp10f128_finite : RuntimeLibcallImpl; def __powf128_finite : RuntimeLibcallImpl; } //===----------------------------------------------------------------------===// // Common Libcall Sets //===----------------------------------------------------------------------===// // FIXME: Should move to explicit opt-in to different sets of libcalls // instead of trying to remove from a default set. We have // unreasonable defaults like reporting f80 calls on most targets when // they are relevant to only one. defvar AllDefaultRuntimeLibcallImpls = !filter(entry, !instances(), entry.IsDefault); defvar DefaultRuntimeLibcallImpls_f80 = !filter(entry, AllDefaultRuntimeLibcallImpls, !match(!cast(entry.Provides), "F80")); defvar DefaultRuntimeLibcallImpls_ppcf128 = !filter(entry, AllDefaultRuntimeLibcallImpls, !match(!cast(entry.Provides), "PPCF128")); defvar DefaultRuntimeLibcallImpls_f128 = !filter(entry, AllDefaultRuntimeLibcallImpls, !match(!cast(entry.Provides), "_F128")); defvar DefaultRuntimeLibcallImpls = !listremove( !listremove( !listremove(AllDefaultRuntimeLibcallImpls, Int128RTLibcalls), DefaultRuntimeLibcallImpls_f80), DefaultRuntimeLibcallImpls_ppcf128); /// Default set of libcall impls for 32-bit architectures. defvar DefaultLibcallImpls32 = DefaultRuntimeLibcallImpls; /// Default set of libcall impls for 64-bit architectures. defvar DefaultLibcallImpls64 = !listconcat(DefaultRuntimeLibcallImpls, Int128RTLibcalls); defvar DarwinSinCosStret = LibcallImpls<(add __sincosf_stret, __sincos_stret), darwinHasSinCosStret>; defvar DarwinExp10 = LibcallImpls<(add __exp10f, __exp10), darwinHasExp10>; defvar LibmHasSinCosF32 = LibcallImpls<(add sincosf), hasSinCos>; defvar LibmHasSinCosF64 = LibcallImpls<(add sincos), hasSinCos>; defvar LibmHasSinCosF80 = LibcallImpls<(add sincos_f80), hasSinCos>; defvar LibmHasSinCosF128 = LibcallImpls<(add sincos_f128), hasSinCos>; defvar LibmHasSinCosPPCF128 = LibcallImpls<(add sincos_ppcf128), hasSinCos>; defvar WindowsMathRemovals = [ ldexpf, ldexp_f80, ldexp_f128, ldexp_ppcf128, frexpf, frexp_f80, frexp_f128, frexp_ppcf128 ]; defvar MostPowI = !listremove(PowiLibcallImpls, [__powitf2_f128, __powitf2_ppc128]); defvar WindowsExclusions = !listconcat(WindowsMathRemovals, MostPowI); // Targets which support windows should start with these as a base and // add in calls for other OSes defvar Win32DefaultLibcallImpls = !listremove(DefaultLibcallImpls32, WindowsExclusions); defvar Win64DefaultLibcallImpls = !listremove(DefaultLibcallImpls64, WindowsExclusions); defvar LibmHasFrexpF32 = LibcallImpls<(add frexpf), isNotOSWindowsOrIsCygwinMinGW>; defvar LibmHasLdexpF32 = LibcallImpls<(add ldexpf), isNotOSWindowsOrIsCygwinMinGW>; defvar LibmHasFrexpF80 = LibcallImpls<(add frexp_f80), isNotOSWindowsOrIsCygwinMinGW>; defvar LibmHasLdexpF80 = LibcallImpls<(add ldexp_f80), isNotOSWindowsOrIsCygwinMinGW>; defvar LibmHasFrexpF128 = LibcallImpls<(add frexp_f128), isNotOSWindowsOrIsCygwinMinGW>; defvar LibmHasLdexpF128 = LibcallImpls<(add ldexp_f128), isNotOSWindowsOrIsCygwinMinGW>; //===----------------------------------------------------------------------===// // Objective-C Runtime Libcalls //===----------------------------------------------------------------------===// def objc_autorelease : RuntimeLibcallImpl; def objc_autoreleasePoolPop : RuntimeLibcallImpl; def objc_autoreleasePoolPush : RuntimeLibcallImpl; def objc_autoreleaseReturnValue : RuntimeLibcallImpl; def objc_copyWeak : RuntimeLibcallImpl; def objc_destroyWeak : RuntimeLibcallImpl; def objc_initWeak : RuntimeLibcallImpl; def objc_loadWeak : RuntimeLibcallImpl; def objc_loadWeakRetained : RuntimeLibcallImpl; def objc_moveWeak : RuntimeLibcallImpl; def objc_release : RuntimeLibcallImpl; def objc_retain : RuntimeLibcallImpl; def objc_retainAutorelease : RuntimeLibcallImpl; def objc_retainAutoreleaseReturnValue : RuntimeLibcallImpl; def objc_retainAutoreleasedReturnValue : RuntimeLibcallImpl; def objc_claimAutoreleasedReturnValue : RuntimeLibcallImpl; def objc_retainBlock : RuntimeLibcallImpl; def objc_storeStrong : RuntimeLibcallImpl; def objc_storeWeak : RuntimeLibcallImpl; def objc_unsafeClaimAutoreleasedReturnValue : RuntimeLibcallImpl; def objc_retainedObject : RuntimeLibcallImpl; def objc_unretainedObject : RuntimeLibcallImpl; def objc_unretainedPointer : RuntimeLibcallImpl; def objc_retain_autorelease : RuntimeLibcallImpl; def objc_sync_enter : RuntimeLibcallImpl; def objc_sync_exit : RuntimeLibcallImpl; //===----------------------------------------------------------------------===// // AArch64 Runtime Libcalls //===----------------------------------------------------------------------===// defset list AArch64LibcallImpls = { foreach MemSize = [1, 2, 4, 8, 16] in { defm __aarch64_cas#MemSize : AtomicOrderSizeLibcallImpl<"OUTLINE_ATOMIC_CAS"#MemSize>; } foreach MemSize = [1, 2, 4, 8] in { defm __aarch64_swp#MemSize : AtomicOrderSizeLibcallImpl<"OUTLINE_ATOMIC_SWP"#MemSize>; defm __aarch64_ldadd#MemSize : AtomicOrderSizeLibcallImpl<"OUTLINE_ATOMIC_LDADD"#MemSize>; defm __aarch64_ldset#MemSize : AtomicOrderSizeLibcallImpl<"OUTLINE_ATOMIC_LDSET"#MemSize>; defm __aarch64_ldclr#MemSize : AtomicOrderSizeLibcallImpl<"OUTLINE_ATOMIC_LDCLR"#MemSize>; defm __aarch64_ldeor#MemSize : AtomicOrderSizeLibcallImpl<"OUTLINE_ATOMIC_LDEOR"#MemSize>; } def __arm_sc_memcpy : RuntimeLibcallImpl; def __arm_sc_memmove : RuntimeLibcallImpl; def __arm_sc_memset : RuntimeLibcallImpl; } // End AArch64LibcallImpls def isAArch64_ExceptArm64EC : RuntimeLibcallPredicate<"(TT.isAArch64() && !TT.isWindowsArm64EC())">; def isWindowsArm64EC : RuntimeLibcallPredicate<"TT.isWindowsArm64EC()">; def isAArch64_ILP64 : RuntimeLibcallPredicate<"TT.isAArch64(64)">; def AArch64SystemLibrary : SystemRuntimeLibrary< isAArch64_ExceptArm64EC, (add Win64DefaultLibcallImpls, LibcallImpls<(add __powisf2, __powidf2), isNotOSMSVCRT>, LibmHasFrexpF32, LibmHasLdexpF32, LibmHasFrexpF128, LibmHasLdexpF128, AArch64LibcallImpls, LibcallImpls<(add Int128RTLibcalls), isAArch64_ILP64>, LibcallImpls<(add bzero), isOSDarwin>, DarwinExp10, DarwinSinCosStret, LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128) >; // Prepend a # to every name defset list WinArm64ECDefaultRuntimeLibcallImpls = { foreach libcall = Win64DefaultLibcallImpls in { def arm64ec_#libcall : DuplicateLibcallImplWithPrefix; } foreach libcall = AArch64LibcallImpls in { def arm64ec_#libcall : DuplicateLibcallImplWithPrefix; } } def WindowsARM64ECSystemLibrary : SystemRuntimeLibrary; //===----------------------------------------------------------------------===// // AMDGPU Runtime Libcalls //===----------------------------------------------------------------------===// def isAMDGPU : RuntimeLibcallPredicate<"TT.isAMDGPU()">; // No calls. def AMDGPUSystemLibrary : SystemRuntimeLibrary; //===----------------------------------------------------------------------===// // ARM Runtime Libcalls //===----------------------------------------------------------------------===// // if (isTargetMachO()) { // if (Subtarget->isThumb() && Subtarget->hasVFP2Base() && // Subtarget->hasARMOps() && !Subtarget->useSoftFloat()) { def __addsf3vfp : RuntimeLibcallImpl; def __subsf3vfp : RuntimeLibcallImpl; def __mulsf3vfp : RuntimeLibcallImpl; def __divsf3vfp : RuntimeLibcallImpl; // Double-precision floating-point arithmetic. def __adddf3vfp : RuntimeLibcallImpl; def __subdf3vfp : RuntimeLibcallImpl; def __muldf3vfp : RuntimeLibcallImpl; def __divdf3vfp : RuntimeLibcallImpl; // Single-precision comparisons. // TODO: Track setcc type def __eqsf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __nesf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __ltsf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __lesf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __gesf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __gtsf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __unordsf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE // Double-precision comparisons. def __eqdf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __nedf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __ltdf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __ledf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __gedf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __gtdf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE def __unorddf2vfp : RuntimeLibcallImpl; // CmpInst::ICMP_NE // Floating-point to integer conversions. // i64 conversions are done via library routines even when generating VFP // instructions, so use the same ones. def __fixdfsivfp : RuntimeLibcallImpl; def __fixunsdfsivfp : RuntimeLibcallImpl; def __fixsfsivfp : RuntimeLibcallImpl; def __fixunssfsivfp : RuntimeLibcallImpl; // Conversions between floating types. def __truncdfsf2vfp : RuntimeLibcallImpl; def __extendsfdf2vfp : RuntimeLibcallImpl; // Integer to floating-point conversions. // i64 conversions are done via library routines even when generating VFP // instructions, so use the same ones. // FIXME: There appears to be some naming inconsistency in ARM libgcc: // e.g., __floatunsidf vs. __floatunssidfvfp. def __floatsidfvfp : RuntimeLibcallImpl; def __floatunssidfvfp : RuntimeLibcallImpl; def __floatsisfvfp : RuntimeLibcallImpl; def __floatunssisfvfp : RuntimeLibcallImpl; // // RTLIB // if (isAAPCS_ABI() && // (isTargetAEABI() || isTargetGNUAEABI() || // isTargetMuslAEABI() || isTargetAndroid())) { // TODO: Set CallingConv = ARM_AAPCS // Double-precision floating-point arithmetic helper functions // RTABI chapter 4.1.2, Table 2 def __aeabi_dadd : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_ddiv : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_dmul : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_dsub : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // Double-precision floating-point comparison helper functions // RTABI chapter 4.1.2, Table 3 def __aeabi_dcmpeq__oeq : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_NE def __aeabi_dcmpeq__une : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_EQ def __aeabi_dcmplt : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_NE def __aeabi_dcmple : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_NE def __aeabi_dcmpge : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_NE def __aeabi_dcmpgt : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_NE def __aeabi_dcmpun : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // Single-precision floating-point arithmetic helper functions // RTABI chapter 4.1.2, Table 4 def __aeabi_fadd : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_fdiv : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_fmul : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_fsub : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // Single-precision floating-point comparison helper functions // RTABI chapter 4.1.2, Table 5 def __aeabi_fcmpeq__oeq : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_NE def __aeabi_fcmpeq__une : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_EQ def __aeabi_fcmplt : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_NE def __aeabi_fcmple : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_NE def __aeabi_fcmpge : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_NE def __aeabi_fcmpgt : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS, CmpInst::ICMP_NE def __aeabi_fcmpun : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // Floating-point to integer conversions. // RTABI chapter 4.1.2, Table 6 def __aeabi_d2iz : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_d2uiz : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_d2lz : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_d2ulz : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_f2iz : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_f2uiz : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_f2lz : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_f2ulz : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // Conversions between floating types. // RTABI chapter 4.1.2, Table 7 def __aeabi_d2f : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_d2h : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_f2d : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // Integer to floating-point conversions. // RTABI chapter 4.1.2, Table 8 def __aeabi_i2d : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_ui2d : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_l2d : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_ul2d : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_i2f : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_ui2f : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_l2f : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_ul2f : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // Long long helper functions // RTABI chapter 4.2, Table 9 def __aeabi_lmul : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_llsl : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_llsr : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_lasr : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // Integer division functions // RTABI chapter 4.3.1 def __aeabi_idiv__i8 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_idiv__i16 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_idiv__i32 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_ldivmod : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_uidiv__i8 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_uidiv__i16 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_uidiv__i32 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_uldivmod : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_idivmod : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_uidivmod : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // EABI dependent RTLIB // Memory operations // RTABI chapter 4.3.4 def __aeabi_memcpy : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_memcpy4 : RuntimeLibcallImpl; def __aeabi_memcpy8 : RuntimeLibcallImpl; def __aeabi_memmove : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_memmove4 : RuntimeLibcallImpl; def __aeabi_memmove8 : RuntimeLibcallImpl; def __aeabi_memset : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_memset4 : RuntimeLibcallImpl; def __aeabi_memset8 : RuntimeLibcallImpl; def __aeabi_memclr : RuntimeLibcallImpl; def __aeabi_memclr4 : RuntimeLibcallImpl; def __aeabi_memclr8 : RuntimeLibcallImpl; // isTargetWindows() defset list WindowsFPIntCastLibcalls = { def __stoi64 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS_VFP def __dtoi64 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS_VFP def __stou64 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS_VFP def __dtou64 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS_VFP def __i64tos : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS_VFP def __i64tod : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS_VFP def __u64tos : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS_VFP def __u64tod : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS_VFP } def __rt_sdiv : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __rt_sdiv64 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __rt_udiv : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __rt_udiv64 : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // Use divmod compiler-rt calls for iOS 5.0 and later. // isTargetMachO() && // !(isTargetIOS() && isOSVersionLT(5, 0)) def __divmodsi4 : RuntimeLibcallImpl; def __udivmodsi4 : RuntimeLibcallImpl; // FIXME: Change calling convention of FPROUND_F32_F16, // RTLIB::FPROUND_F64_F16, FPEXT_F16_F32 for !Subtarget->isTargetWatchABI()) // In EABI, these functions have an __aeabi_ prefix, but in GNUEABI they have // a __gnu_ prefix (which is the default). // isTargetAEABI() def __aeabi_f2h : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS //def __aeabi_d2h : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS def __aeabi_h2f : RuntimeLibcallImpl; // CallingConv::ARM_AAPCS // !isTargetMachO() def __gnu_f2h_ieee : RuntimeLibcallImpl; def __gnu_h2f_ieee : RuntimeLibcallImpl; def WindowARMDivRemCalls : LibcallImpls< (add __rt_sdiv, __rt_sdiv64, __rt_udiv, __rt_udiv64), isOSWindows> { let CallingConv = ARM_AAPCS; } def WindowARMFPIntCasts : LibcallImpls< (add WindowsFPIntCastLibcalls), isOSWindows> { let CallingConv = ARM_AAPCS_VFP; } // Register based DivRem for AEABI (RTABI 4.2) def AEABIDivRemCalls : LibcallImpls< (add __aeabi_idivmod, __aeabi_ldivmod, __aeabi_uidivmod, __aeabi_uldivmod), RuntimeLibcallPredicate<[{TT.isTargetAEABI() || TT.isAndroid() || TT.isTargetGNUAEABI() || TT.isTargetMuslAEABI()}]>> { let CallingConv = ARM_AAPCS; } def isARMOrThumb : RuntimeLibcallPredicate<"TT.isARM() || TT.isThumb()">; def ARMSystemLibrary : SystemRuntimeLibrary, LibmHasFrexpF32, LibmHasLdexpF32, LibmHasFrexpF128, LibmHasLdexpF128, WindowARMDivRemCalls, WindowARMFPIntCasts, AEABIDivRemCalls, DarwinSinCosStret, DarwinExp10, LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128, // Use divmod compiler-rt calls for iOS 5.0 and later. LibcallImpls<(add __divmodsi4, __udivmodsi4), RuntimeLibcallPredicate<[{TT.isOSBinFormatMachO() && (!TT.isiOS() || !TT.isOSVersionLT(5, 0))}]>>)> { let DefaultLibcallCallingConv = LibcallCallingConv<[{ (!TT.isOSDarwin() && !TT.isiOS() && !TT.isWatchOS() && !TT.isDriverKit()) ? (FloatABI == FloatABI::Hard ? CallingConv::ARM_AAPCS_VFP : CallingConv::ARM_AAPCS) : CallingConv::C }]>; } //===----------------------------------------------------------------------===// // AVR Runtime Libcalls //===----------------------------------------------------------------------===// // Several of the runtime library functions use a special calling conv def __divmodqi4 : RuntimeLibcallImpl; def __divmodhi4 : RuntimeLibcallImpl; def __udivmodqi4 : RuntimeLibcallImpl; def __udivmodhi4 : RuntimeLibcallImpl; //def __divmodsi4 : RuntimeLibcallImpl; //def __udivmodsi4 : RuntimeLibcallImpl; // Standard sinf/cosf name replaced with "sin" and "cos". Define a // separate Impl so we can set a different type signature. def avr_sin : RuntimeLibcallImpl; def avr_cos : RuntimeLibcallImpl; def isAVR : RuntimeLibcallPredicate<"TT.getArch() == Triple::avr">; def AVRSystemLibrary : SystemRuntimeLibrary< isAVR, (add (sub DefaultRuntimeLibcallImpls, // Division rtlib functions (not supported), use divmod // functions instead __divqi3, __divhi3, __divsi3, __udivqi3, __udivhi3, __udivsi3, // Modulus rtlib functions (not supported), use divmod functions // instead __modqi3, __modhi3, __modsi3, __umodqi3, __umodhi3, __umodsi3, // Standard f64 names are replaced sin, cos, sinf, cosf), // Several of the runtime library functions use a special calling // conv LibcallsWithCC<(add __divmodqi4, __divmodhi4, __udivmodqi4, __udivmodhi4), AVR_BUILTIN>, __divmodsi4, __udivmodsi4, // Trigonometric rtlib functions avr_sin, avr_cos)>; //===----------------------------------------------------------------------===// // Hexagon Runtime Libcalls //===----------------------------------------------------------------------===// defset list HexagonLibcalls = { def __hexagon_divsi3 : RuntimeLibcallImpl; def __hexagon_divdi3 : RuntimeLibcallImpl; def __hexagon_udivsi3 : RuntimeLibcallImpl; def __hexagon_udivdi3 : RuntimeLibcallImpl; def __hexagon_modsi3 : RuntimeLibcallImpl; def __hexagon_moddi3 : RuntimeLibcallImpl; def __hexagon_umodsi3 : RuntimeLibcallImpl; def __hexagon_umoddi3 : RuntimeLibcallImpl; def __hexagon_adddf3 : RuntimeLibcallImpl; def __hexagon_fast_adddf3 : RuntimeLibcallImpl; def __hexagon_subdf3 : RuntimeLibcallImpl; def __hexagon_fast_subdf3 : RuntimeLibcallImpl; def __hexagon_muldf3 : RuntimeLibcallImpl; def __hexagon_fast_muldf3 : RuntimeLibcallImpl; def __hexagon_divdf3 : RuntimeLibcallImpl; def __hexagon_fast_divdf3 : RuntimeLibcallImpl; def __hexagon_divsf3 : RuntimeLibcallImpl; def __hexagon_fast_divsf3 : RuntimeLibcallImpl; def __hexagon_sqrtf : RuntimeLibcallImpl; def __hexagon_fast2_sqrtf : RuntimeLibcallImpl; // This is the only fast library function for sqrtd. def __hexagon_fast2_sqrtdf2 : RuntimeLibcallImpl; def __hexagon_memcpy_likely_aligned_min32bytes_mult8bytes : RuntimeLibcallImpl; } def isHexagon : RuntimeLibcallPredicate<"TT.getArch() == Triple::hexagon">; def HexagonSystemLibrary : SystemRuntimeLibrary; //===----------------------------------------------------------------------===// // Lanai Runtime Libcalls //===----------------------------------------------------------------------===// def isLanai : RuntimeLibcallPredicate<"TT.getArch() == Triple::lanai">; // Use fast calling convention for library functions. def LanaiSystemLibrary : SystemRuntimeLibrary { let DefaultLibcallCallingConv = FASTCC; } //===----------------------------------------------------------------------===// // Mips16 Runtime Libcalls //===----------------------------------------------------------------------===// // Hard float libcalls def __mips16_adddf3 : RuntimeLibcallImpl; def __mips16_addsf3 : RuntimeLibcallImpl; def __mips16_divdf3 : RuntimeLibcallImpl; def __mips16_divsf3 : RuntimeLibcallImpl; def __mips16_eqdf2 : RuntimeLibcallImpl; def __mips16_eqsf2 : RuntimeLibcallImpl; def __mips16_extendsfdf2 : RuntimeLibcallImpl; def __mips16_fix_truncdfsi : RuntimeLibcallImpl; def __mips16_fix_truncsfsi : RuntimeLibcallImpl; def __mips16_floatsidf : RuntimeLibcallImpl; def __mips16_floatsisf : RuntimeLibcallImpl; def __mips16_floatunsidf : RuntimeLibcallImpl; def __mips16_floatunsisf : RuntimeLibcallImpl; def __mips16_gedf2 : RuntimeLibcallImpl; def __mips16_gesf2 : RuntimeLibcallImpl; def __mips16_gtdf2 : RuntimeLibcallImpl; def __mips16_gtsf2 : RuntimeLibcallImpl; def __mips16_ledf2 : RuntimeLibcallImpl; def __mips16_lesf2 : RuntimeLibcallImpl; def __mips16_ltdf2 : RuntimeLibcallImpl; def __mips16_ltsf2 : RuntimeLibcallImpl; def __mips16_muldf3 : RuntimeLibcallImpl; def __mips16_mulsf3 : RuntimeLibcallImpl; def __mips16_nedf2 : RuntimeLibcallImpl; def __mips16_nesf2 : RuntimeLibcallImpl; def __mips16_ret_dc : RuntimeLibcallImpl; def __mips16_ret_df : RuntimeLibcallImpl; def __mips16_ret_sc : RuntimeLibcallImpl; def __mips16_ret_sf : RuntimeLibcallImpl; def __mips16_subdf3 : RuntimeLibcallImpl; def __mips16_subsf3 : RuntimeLibcallImpl; def __mips16_truncdfsf2 : RuntimeLibcallImpl; def __mips16_unorddf2 : RuntimeLibcallImpl; def __mips16_unordsf2 : RuntimeLibcallImpl; //===----------------------------------------------------------------------===// // MSP430 Runtime Libcalls //===----------------------------------------------------------------------===// // EABI Libcalls - EABI Section 6.2 // Floating point conversions - EABI Table 6 def __mspabi_cvtdf : RuntimeLibcallImpl; def __mspabi_cvtfd : RuntimeLibcallImpl; // The following is NOT implemented in libgcc //def __mspabi_fixdi : RuntimeLibcallImpl; def __mspabi_fixdli : RuntimeLibcallImpl; def __mspabi_fixdlli : RuntimeLibcallImpl; // The following is NOT implemented in libgcc //def __mspabi_fixdu : RuntimeLibcallImpl; def __mspabi_fixdul : RuntimeLibcallImpl; def __mspabi_fixdull : RuntimeLibcallImpl; // The following is NOT implemented in libgcc //def __mspabi_fixfi : RuntimeLibcallImpl; def __mspabi_fixfli : RuntimeLibcallImpl; def __mspabi_fixflli : RuntimeLibcallImpl; // The following is NOT implemented in libgcc //def __mspabi_fixfu : RuntimeLibcallImpl; def __mspabi_fixful : RuntimeLibcallImpl; def __mspabi_fixfull : RuntimeLibcallImpl; // TODO The following IS implemented in libgcc //def __mspabi_fltid : RuntimeLibcallImpl; def __mspabi_fltlid : RuntimeLibcallImpl; // TODO The following IS implemented in libgcc but is not in the EABI def __mspabi_fltllid : RuntimeLibcallImpl; // TODO The following IS implemented in libgcc //def __mspabi_fltud : RuntimeLibcallImpl; def __mspabi_fltuld : RuntimeLibcallImpl; // The following IS implemented in libgcc but is not in the EABI def __mspabi_fltulld : RuntimeLibcallImpl; // TODO The following IS implemented in libgcc //def __mspabi_fltif : RuntimeLibcallImpl; def __mspabi_fltlif : RuntimeLibcallImpl; // TODO The following IS implemented in libgcc but is not in the EABI def __mspabi_fltllif : RuntimeLibcallImpl; // TODO The following IS implemented in libgcc //def __mspabi_fltuf : RuntimeLibcallImpl; def __mspabi_fltulf : RuntimeLibcallImpl; // The following IS implemented in libgcc but is not in the EABI def __mspabi_fltullf : RuntimeLibcallImpl; // Floating point comparisons - EABI Table 7 def __mspabi_cmpd__oeq : RuntimeLibcallImpl; def __mspabi_cmpd__une : RuntimeLibcallImpl; def __mspabi_cmpd__oge : RuntimeLibcallImpl; def __mspabi_cmpd__olt : RuntimeLibcallImpl; def __mspabi_cmpd__ole : RuntimeLibcallImpl; def __mspabi_cmpd__ogt : RuntimeLibcallImpl; def __mspabi_cmpf__oeq : RuntimeLibcallImpl; def __mspabi_cmpf__une : RuntimeLibcallImpl; def __mspabi_cmpf__oge : RuntimeLibcallImpl; def __mspabi_cmpf__olt : RuntimeLibcallImpl; def __mspabi_cmpf__ole : RuntimeLibcallImpl; def __mspabi_cmpf__ogt : RuntimeLibcallImpl; // Floating point arithmetic - EABI Table 8 def __mspabi_addd : RuntimeLibcallImpl; def __mspabi_addf : RuntimeLibcallImpl; def __mspabi_divd : RuntimeLibcallImpl; def __mspabi_divf : RuntimeLibcallImpl; def __mspabi_mpyd : RuntimeLibcallImpl; def __mspabi_mpyf : RuntimeLibcallImpl; def __mspabi_subd : RuntimeLibcallImpl; def __mspabi_subf : RuntimeLibcallImpl; // The following are NOT implemented in libgcc // def __mspabi_negd : RuntimeLibcallImpl; // def __mspabi_negf : RuntimeLibcallImpl; // Universal Integer Operations - EABI Table 9 def __mspabi_divi : RuntimeLibcallImpl; def __mspabi_divli : RuntimeLibcallImpl; def __mspabi_divlli : RuntimeLibcallImpl; def __mspabi_divu : RuntimeLibcallImpl; def __mspabi_divul : RuntimeLibcallImpl; def __mspabi_divull : RuntimeLibcallImpl; def __mspabi_remi : RuntimeLibcallImpl; def __mspabi_remli : RuntimeLibcallImpl; def __mspabi_remlli : RuntimeLibcallImpl; def __mspabi_remu : RuntimeLibcallImpl; def __mspabi_remul : RuntimeLibcallImpl; def __mspabi_remull : RuntimeLibcallImpl; // Bitwise Operations - EABI Table 10 // TODO: __mspabi_[srli/srai/slli] ARE implemented in libgcc def __mspabi_srll : RuntimeLibcallImpl; def __mspabi_sral : RuntimeLibcallImpl; def __mspabi_slll : RuntimeLibcallImpl; // __mspabi_[srlll/srall/sllll/rlli/rlll] are NOT implemented in libgcc // hasHWMult16() // Integer Multiply - EABI Table 9 //def __mspabi_mpyi_hw : RuntimeLibcallImpl; def __mspabi_mpyl_hw : RuntimeLibcallImpl; def __mspabi_mpyll_hw : RuntimeLibcallImpl; // TODO The __mspabi_mpysl*_hw functions ARE implemented in libgcc // TODO The __mspabi_mpyul*_hw functions ARE implemented in libgcc // hasHWMult32() // Integer Multiply - EABI Table 9 def __mspabi_mpyi_hw : RuntimeLibcallImpl; def __mspabi_mpyl_hw32 : RuntimeLibcallImpl; def __mspabi_mpyll_hw32 : RuntimeLibcallImpl; // TODO The __mspabi_mpysl*_hw32 functions ARE implemented in libgcc // TODO The __mspabi_mpyul*_hw32 functions ARE implemented in libgcc // hasHWMultF5() // Integer Multiply - EABI Table 9 def __mspabi_mpyi_f5hw : RuntimeLibcallImpl; def __mspabi_mpyl_f5hw : RuntimeLibcallImpl; def __mspabi_mpyll_f5hw : RuntimeLibcallImpl; // TODO The __mspabi_mpysl*_f5hw functions ARE implemented in libgcc // TODO The __mspabi_mpyul*_f5hw functions ARE implemented in libgcc // NoHWMult // Integer Multiply - EABI Table 9 def __mspabi_mpyi : RuntimeLibcallImpl; def __mspabi_mpyl : RuntimeLibcallImpl; def __mspabi_mpyll : RuntimeLibcallImpl; // The __mspabi_mpysl* functions are NOT implemented in libgcc // The __mspabi_mpyul* functions are NOT implemented in libgcc // setLibcallCallingConv(MUL_I64, CallingConv::MSP430_BUILTIN); def isMSP430 : RuntimeLibcallPredicate<"TT.getArch() == Triple::msp430">; defvar MSP430DefaultOptOut = [ __addsf3, __divsf3, __extendsfdf2, __truncdfsf2, __fixsfsi, __fixsfdi, __fixunssfsi, __mulsf3, __eqsf2, __gesf2, __gtsf2, __divhi3, __divsi3, __ashlsi3, __floatsidf, __floatsisf, __ashrsi3, __modhi3, __udivsi3, __fixdfsi, __fixunssfdi, __udivhi3, __umodsi3, __nesf2, __lesf2, __floatundisf, __fixdfdi, __fixunsdfsi, __modsi3, __floatunsisf, __fixunsdfdi, __ltsf2, __floatdisf, __floatdidf, __lshrsi3, __subsf3, __umodhi3, __floatunsidf, __floatundidf ]; // EABI Libcalls - EABI Section 6.2 def MSP430SystemLibrary : SystemRuntimeLibrary, __mspabi_cmpf__oeq, __mspabi_cmpf__une, __mspabi_cmpf__oge, __mspabi_cmpf__olt, __mspabi_cmpf__ole, __mspabi_cmpf__ogt, // Floating point arithmetic - EABI Table 8 LibcallsWithCC<(add __mspabi_addd, __mspabi_subd, __mspabi_mpyd, __mspabi_divd), MSP430_BUILTIN>, __mspabi_addf, __mspabi_subf, __mspabi_mpyf, __mspabi_divf, // The following are NOT implemented in libgcc // __mspabi_negd, // __mspabi_negf, // Universal Integer Operations - EABI Table 9 __mspabi_divi, __mspabi_divli, LibcallsWithCC<(add __mspabi_divlli), MSP430_BUILTIN>, __mspabi_divu, __mspabi_divul, LibcallsWithCC<(add __mspabi_divull), MSP430_BUILTIN>, __mspabi_remi, __mspabi_remli, LibcallsWithCC<(add __mspabi_remlli), MSP430_BUILTIN>, __mspabi_remu, __mspabi_remul, LibcallsWithCC<(add __mspabi_remull), MSP430_BUILTIN>, // Bitwise Operations - EABI Table 10 // TODO: __mspabi_[srli/srai/slli] ARE implemented in libgcc __mspabi_srll, __mspabi_sral, __mspabi_slll // __mspabi_[srlll/srall/sllll/rlli/rlll] are NOT implemented in libgcc ) >; //===----------------------------------------------------------------------===// // NVPTX Runtime Libcalls //===----------------------------------------------------------------------===// def isNVPTX : RuntimeLibcallPredicate<"TT.isNVPTX()">; // No calls. def NVPTXSystemLibrary : SystemRuntimeLibrary; //===----------------------------------------------------------------------===// // PPC Runtime Libcalls //===----------------------------------------------------------------------===// // For IEEE quad-precision libcall names, PPC uses "kf" instead of "tf". defset list PPCRuntimeLibcalls = { def __addkf3 : RuntimeLibcallImpl; def __subkf3 : RuntimeLibcallImpl; def __mulkf3 : RuntimeLibcallImpl; def __divkf3 : RuntimeLibcallImpl; def __powikf2 : RuntimeLibcallImpl; def __extendsfkf2 : RuntimeLibcallImpl; def __extenddfkf2 : RuntimeLibcallImpl; def __trunckfhf2 : RuntimeLibcallImpl; def __trunckfsf2 : RuntimeLibcallImpl; def __trunckfdf2 : RuntimeLibcallImpl; def __fixkfsi : RuntimeLibcallImpl; def __fixkfdi : RuntimeLibcallImpl; def __fixkfti : RuntimeLibcallImpl; def __fixunskfsi : RuntimeLibcallImpl; def __fixunskfdi : RuntimeLibcallImpl; def __fixunskfti : RuntimeLibcallImpl; def __floatsikf : RuntimeLibcallImpl; def __floatdikf : RuntimeLibcallImpl; def __floattikf : RuntimeLibcallImpl; def __floatunsikf : RuntimeLibcallImpl; def __floatundikf : RuntimeLibcallImpl; def __floatuntikf : RuntimeLibcallImpl; def __eqkf2 : RuntimeLibcallImpl; def __nekf2 : RuntimeLibcallImpl; def __gekf2 : RuntimeLibcallImpl; def __ltkf2 : RuntimeLibcallImpl; def __lekf2 : RuntimeLibcallImpl; def __gtkf2 : RuntimeLibcallImpl; def __unordkf2 : RuntimeLibcallImpl; } defset list PPC64AIXCallList = { def ___memmove64 : RuntimeLibcallImpl; def ___memset64 : RuntimeLibcallImpl; def ___bzero64 : RuntimeLibcallImpl; } defset list PPC32AIXCallList = { def ___memmove : RuntimeLibcallImpl; def ___memset : RuntimeLibcallImpl; def ___bzero : RuntimeLibcallImpl; } defvar PPCOverrides = !foreach(entry, PPCRuntimeLibcalls, entry.Provides); def isPPC : RuntimeLibcallPredicate<"TT.isPPC()">; def isPPC32 : RuntimeLibcallPredicate<"TT.isPPC32()">; def isPPC64 : RuntimeLibcallPredicate<"TT.isPPC64()">; def isAIX : RuntimeLibcallPredicate<"TT.isOSAIX()">; def isNotAIX : RuntimeLibcallPredicate<"!TT.isOSAIX()">; def isPPC32_AIX : RuntimeLibcallPredicate<"(TT.isPPC32() && TT.isOSAIX())">; def isPPC64_AIX : RuntimeLibcallPredicate<"(TT.isPPC64() && TT.isOSAIX())">; def AIX32Calls : LibcallImpls<(add PPC32AIXCallList), isPPC32_AIX>; def AIX64Calls : LibcallImpls<(add PPC64AIXCallList), isPPC64_AIX>; // FIXME: Current emission behavior with multiple implementations is // janky. We need to filter out the conflicting cases with different // f128 names, and then add the overrides. We should switch to // explicitly adding subsets of the default calls. def PPCSystemLibrary : SystemRuntimeLibrary, LibcallImpls<(add Int128RTLibcalls), isPPC64>)>; //===----------------------------------------------------------------------===// // RISCV Runtime Libcalls //===----------------------------------------------------------------------===// def isRISCV : RuntimeLibcallPredicate<"TT.isRISCV()">; def isRISCV64 : RuntimeLibcallPredicate<"TT.isRISCV64()">; def RISCVSystemLibrary : SystemRuntimeLibrary)>; //===----------------------------------------------------------------------===// // SPARC Runtime Libcalls //===----------------------------------------------------------------------===// // Subtarget->useSoftMulDiv() def sparc_umul : RuntimeLibcallImpl; def sparc_div : RuntimeLibcallImpl; def sparc_udiv : RuntimeLibcallImpl; def sparc_rem : RuntimeLibcallImpl; def sparc_urem : RuntimeLibcallImpl; // SPARC64 && !Subtarget->useSoftFloat() def _Qp_add : RuntimeLibcallImpl; def _Qp_sub : RuntimeLibcallImpl; def _Qp_mul : RuntimeLibcallImpl; def _Qp_div : RuntimeLibcallImpl; def _Qp_sqrt : RuntimeLibcallImpl; def _Qp_qtoi : RuntimeLibcallImpl; def _Qp_qtoui : RuntimeLibcallImpl; def _Qp_itoq : RuntimeLibcallImpl; def _Qp_uitoq : RuntimeLibcallImpl; def _Qp_qtox : RuntimeLibcallImpl; def _Qp_qtoux : RuntimeLibcallImpl; def _Qp_xtoq : RuntimeLibcallImpl; def _Qp_uxtoq : RuntimeLibcallImpl; def _Qp_stoq : RuntimeLibcallImpl; def _Qp_dtoq : RuntimeLibcallImpl; def _Qp_qtos : RuntimeLibcallImpl; def _Qp_qtod : RuntimeLibcallImpl; // SPARC32 && !Subtarget->useSoftFloat() def _Q_add : RuntimeLibcallImpl; def _Q_sub : RuntimeLibcallImpl; def _Q_mul : RuntimeLibcallImpl; def _Q_div : RuntimeLibcallImpl; def _Q_sqrt : RuntimeLibcallImpl; def _Q_qtoi : RuntimeLibcallImpl; def _Q_qtou : RuntimeLibcallImpl; def _Q_itoq : RuntimeLibcallImpl; def _Q_utoq : RuntimeLibcallImpl; def _Q_stoq : RuntimeLibcallImpl; def _Q_dtoq : RuntimeLibcallImpl; def _Q_qtos : RuntimeLibcallImpl; def _Q_qtod : RuntimeLibcallImpl; // SPARC32 && (Subtarget->hasHardQuad() || !Subtarget->useSoftFloat()) def _Q_qtoll : RuntimeLibcallImpl; def _Q_qtoull : RuntimeLibcallImpl; def _Q_lltoq : RuntimeLibcallImpl; def _Q_ulltoq : RuntimeLibcallImpl; def isSPARC : RuntimeLibcallPredicate<"TT.isSPARC()">; def isSPARC32 : RuntimeLibcallPredicate<"TT.isSPARC32()">; def isSPARC64 : RuntimeLibcallPredicate<"TT.isSPARC64()">; defvar SPARC64_MulDivCalls = [ __mulsi3, __divsi3, __modsi3, __udivsi3, __umodsi3 ]; def SPARCSystemLibrary : SystemRuntimeLibrary, LibcallImpls<(add SPARC64_MulDivCalls, Int128RTLibcalls), isSPARC64>, LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128) >; //===----------------------------------------------------------------------===// // SPIRV Runtime Libcalls //===----------------------------------------------------------------------===// def isSPIRV : RuntimeLibcallPredicate<"TT.isSPIRV()">; // No calls FIXME: Add memcpy/memset is a hack to skip // PreISelIntrinsicLowering in favor of SPIRVPrepareFunctions; // probably should remove that and just use the default one. def SPIRVSystemLibrary : SystemRuntimeLibrary; //===----------------------------------------------------------------------===// // Windows Runtime Libcalls //===----------------------------------------------------------------------===// defset list WindowsDivRemMulLibcalls = { def _alldiv : RuntimeLibcallImpl; def _aulldiv : RuntimeLibcallImpl; def _allrem : RuntimeLibcallImpl; def _aullrem : RuntimeLibcallImpl; def _allmul : RuntimeLibcallImpl; } //===----------------------------------------------------------------------===// // X86 Runtime Libcalls //===----------------------------------------------------------------------===// def isX86_32 : RuntimeLibcallPredicate<"TT.getArch() == Triple::x86">; def isX86_64 : RuntimeLibcallPredicate<"TT.getArch() == Triple::x86_64">; def isX86 : RuntimeLibcallPredicate<"TT.isX86()">; // Some darwins have an optimized __bzero/bzero function. def darwinHas__bzero : RuntimeLibcallPredicate<"TT.isMacOSX() && !TT.isMacOSXVersionLT(10, 6)">; // FIXME: This is has ldexpl/frexpl plus use f128 for long double. def hasFrexplLdexplF128 : RuntimeLibcallPredicate<[{(!TT.isOSWindows() || TT.isOSCygMing()) && !TT.isGNUEnvironment()}]>; // Use the f128 variants of math functions on x86 defvar X86_F128_Libcalls = LibcallImpls<(add LibmF128Libcalls, LibmF128FiniteLibcalls), isGNUEnvironment>; defvar SinCosF32F64Libcalls = LibcallImpls<(add sincosf, sincos), hasSinCos_f32_f64>; defvar X86CommonLibcalls = (add DarwinSinCosStret, DarwinExp10, X86_F128_Libcalls, LibmHasSinCosF80, // FIXME: Depends on long double SinCosF32F64Libcalls, LibcallImpls<(add __bzero), darwinHas__bzero>, LibmHasFrexpF32, LibmHasLdexpF32, LibmHasFrexpF80, LibmHasLdexpF80, LibcallImpls<(add frexp_f128, ldexp_f128), hasFrexplLdexplF128>, DefaultRuntimeLibcallImpls_f80, // FIXME: MSVCRT doesn't have powi. The f128 case is added as a // hack for one test relying on it. __powitf2_f128, LibcallImpls<(add MostPowI), isNotOSMSVCRT> ); defvar Windows32DivRemMulCalls = LibcallsWithCC<(add WindowsDivRemMulLibcalls), X86_STDCALL, RuntimeLibcallPredicate<"TT.isWindowsMSVCEnvironment() || TT.isWindowsItaniumEnvironment()">>; def X86_32SystemLibrary : SystemRuntimeLibrary; def X86_64SystemLibrary : SystemRuntimeLibrary; //===----------------------------------------------------------------------===// // XCore Runtime Libcalls //===----------------------------------------------------------------------===// def __memcpy_4 : RuntimeLibcallImpl; def isXCore : RuntimeLibcallPredicate<"TT.getArch() == Triple::xcore">; def XCoreSystemLibrary : SystemRuntimeLibrary; //===----------------------------------------------------------------------===// // ZOS Runtime Libcalls //===----------------------------------------------------------------------===// defset list ZOSRuntimeLibcalls = { def zos___TRNC_B : RuntimeLibcallImpl; def zos___FTRC_B : RuntimeLibcallImpl; def zos___LTRC_B : RuntimeLibcallImpl; def zos___WSQT_B : RuntimeLibcallImpl; def zos___FSQT_B : RuntimeLibcallImpl; def zos___LSQT_B : RuntimeLibcallImpl; def zos___SSIN_B : RuntimeLibcallImpl; def zos___FSIN_B : RuntimeLibcallImpl; def zos___LSIN_B : RuntimeLibcallImpl; def zos___ROUN_B : RuntimeLibcallImpl; def zos___ROUNFB : RuntimeLibcallImpl; def zos___ROUNLB : RuntimeLibcallImpl; def zos___SRNT_B : RuntimeLibcallImpl; def zos___RINTFB : RuntimeLibcallImpl; def zos___RINTLB : RuntimeLibcallImpl; def zos___WFMD_B : RuntimeLibcallImpl; def zos___FFMD_B : RuntimeLibcallImpl; def zos___LFMD_B : RuntimeLibcallImpl; def zos___WPOW_B : RuntimeLibcallImpl; def zos___FPOW_B : RuntimeLibcallImpl; def zos___LPOW_B : RuntimeLibcallImpl; def zos___NBYI_B : RuntimeLibcallImpl; def zos___NBYIFB : RuntimeLibcallImpl; def zos___NBYILB : RuntimeLibcallImpl; def zos___ROND_B : RuntimeLibcallImpl; def zos___FRND_B : RuntimeLibcallImpl; def zos___LRND_B : RuntimeLibcallImpl; def zos___LRNT_B : RuntimeLibcallImpl; def zos___LRNTFB : RuntimeLibcallImpl; def zos___LRNTLB : RuntimeLibcallImpl; def zos___WLOG_B : RuntimeLibcallImpl; def zos___FLOG_B : RuntimeLibcallImpl; def zos___LLOG_B : RuntimeLibcallImpl; def zos___LOG2_B : RuntimeLibcallImpl; def zos___FLG2_B : RuntimeLibcallImpl; def zos___LLG2_B : RuntimeLibcallImpl; def zos___WLG1_B : RuntimeLibcallImpl; def zos___FLG1_B : RuntimeLibcallImpl; def zos___LLG1_B : RuntimeLibcallImpl; def zos___LLRD_B : RuntimeLibcallImpl; def zos___LLRDFB : RuntimeLibcallImpl; def zos___LLRDLB : RuntimeLibcallImpl; def zos___LLRT_B : RuntimeLibcallImpl; def zos___LLRTFB : RuntimeLibcallImpl; def zos___LLRTLB : RuntimeLibcallImpl; def zos___SLXP_B : RuntimeLibcallImpl; def zos___FLXP_B : RuntimeLibcallImpl; def zos___LLXP_B : RuntimeLibcallImpl; def zos___SFXP_B : RuntimeLibcallImpl; def zos___FFXP_B : RuntimeLibcallImpl; def zos___LFXP_B : RuntimeLibcallImpl; def zos___FMIN_B : RuntimeLibcallImpl; def zos___FMINFB : RuntimeLibcallImpl; def zos___FMINLB : RuntimeLibcallImpl; def zos___FMA_B : RuntimeLibcallImpl; def zos___FMAFB : RuntimeLibcallImpl; def zos___FMALB : RuntimeLibcallImpl; def zos___FMAX_B : RuntimeLibcallImpl; def zos___FMAXFB : RuntimeLibcallImpl; def zos___FMAXLB : RuntimeLibcallImpl; def zos___SFLR_B : RuntimeLibcallImpl; def zos___FFLR_B : RuntimeLibcallImpl; def zos___LFLR_B : RuntimeLibcallImpl; def zos___WEXP_B : RuntimeLibcallImpl; def zos___FEXP_B : RuntimeLibcallImpl; def zos___LEXP_B : RuntimeLibcallImpl; def zos___EXP2_B : RuntimeLibcallImpl; def zos___FXP2_B : RuntimeLibcallImpl; def zos___LXP2_B : RuntimeLibcallImpl; def zos___SCOS_B : RuntimeLibcallImpl; def zos___FCOS_B : RuntimeLibcallImpl; def zos___LCOS_B : RuntimeLibcallImpl; def zos___DCPY_B : RuntimeLibcallImpl; def zos___FCPY_B : RuntimeLibcallImpl; def zos___LCPY_B : RuntimeLibcallImpl; def zos___SCEL_B : RuntimeLibcallImpl; def zos___FCEL_B : RuntimeLibcallImpl; def zos___LCEL_B : RuntimeLibcallImpl; def zos___SCRT_B : RuntimeLibcallImpl; def zos___FCBT_B : RuntimeLibcallImpl; def zos___LCBT_B : RuntimeLibcallImpl; } def isSystemZZOS : RuntimeLibcallPredicate<"(TT.isSystemZ() && TT.isOSzOS())">; def isZOS : RuntimeLibcallPredicate<"TT.isOSzOS()">; def SystemZZOSSystemLibrary : SystemRuntimeLibrary< isSystemZZOS, (add DefaultLibcallImpls64, LibcallImpls<(add ZOSRuntimeLibcalls), isZOS>)>; //===----------------------------------------------------------------------===// // WebAssembly Runtime Libcalls //===----------------------------------------------------------------------===// // Define the emscripten name for return address helper. // TODO: when implementing other Wasm backends, make this generic or only do // this on emscripten depending on what they end up doing. def emscripten_return_address : RuntimeLibcallImpl; def isWasm : RuntimeLibcallPredicate<"TT.isWasm()">; // Define the emscripten name for return address helper. // TODO: when implementing other Wasm backends, make this generic or only do // this on emscripten depending on what they end up doing. def WasmSystemLibrary : SystemRuntimeLibrary;