1//===-- llvm/RuntimeLibcalls.def - File that describes libcalls -*- C++ -*-===// 2// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6// 7//===----------------------------------------------------------------------===// 8// 9// This file defines all of the runtime library calls the backend can emit. 10// The various long double types cannot be merged, because 80-bit library 11// functions use "xf" and 128-bit use "tf". 12// 13// When adding PPCF128 functions here, note that their names generally need 14// to be overridden for Darwin with the xxx$LDBL128 form. See 15// PPCISelLowering.cpp. 16// 17//===----------------------------------------------------------------------===// 18 19// NOTE: NO INCLUDE GUARD DESIRED! 20 21// Provide definitions of macros so that users of this file do not have to 22// define everything to use it... 23 24// Declare the enumerator for each libcall, along with its default name. Some 25// libcalls have different names on particular OSes or architectures. These 26// are set in InitLibcalls() in TargetLoweringBase.cpp and/or by targets 27// using TargetLoweringBase::setLibcallName() 28#ifndef HANDLE_LIBCALL 29#error "HANDLE_LIBCALL must be defined" 30#endif 31 32// Integer 33HANDLE_LIBCALL(SHL_I16, "__ashlhi3") 34HANDLE_LIBCALL(SHL_I32, "__ashlsi3") 35HANDLE_LIBCALL(SHL_I64, "__ashldi3") 36HANDLE_LIBCALL(SHL_I128, "__ashlti3") 37HANDLE_LIBCALL(SRL_I16, "__lshrhi3") 38HANDLE_LIBCALL(SRL_I32, "__lshrsi3") 39HANDLE_LIBCALL(SRL_I64, "__lshrdi3") 40HANDLE_LIBCALL(SRL_I128, "__lshrti3") 41HANDLE_LIBCALL(SRA_I16, "__ashrhi3") 42HANDLE_LIBCALL(SRA_I32, "__ashrsi3") 43HANDLE_LIBCALL(SRA_I64, "__ashrdi3") 44HANDLE_LIBCALL(SRA_I128, "__ashrti3") 45HANDLE_LIBCALL(MUL_I8, "__mulqi3") 46HANDLE_LIBCALL(MUL_I16, "__mulhi3") 47HANDLE_LIBCALL(MUL_I32, "__mulsi3") 48HANDLE_LIBCALL(MUL_I64, "__muldi3") 49HANDLE_LIBCALL(MUL_I128, "__multi3") 50HANDLE_LIBCALL(MULO_I32, "__mulosi4") 51HANDLE_LIBCALL(MULO_I64, "__mulodi4") 52HANDLE_LIBCALL(MULO_I128, "__muloti4") 53HANDLE_LIBCALL(SDIV_I8, "__divqi3") 54HANDLE_LIBCALL(SDIV_I16, "__divhi3") 55HANDLE_LIBCALL(SDIV_I32, "__divsi3") 56HANDLE_LIBCALL(SDIV_I64, "__divdi3") 57HANDLE_LIBCALL(SDIV_I128, "__divti3") 58HANDLE_LIBCALL(UDIV_I8, "__udivqi3") 59HANDLE_LIBCALL(UDIV_I16, "__udivhi3") 60HANDLE_LIBCALL(UDIV_I32, "__udivsi3") 61HANDLE_LIBCALL(UDIV_I64, "__udivdi3") 62HANDLE_LIBCALL(UDIV_I128, "__udivti3") 63HANDLE_LIBCALL(SREM_I8, "__modqi3") 64HANDLE_LIBCALL(SREM_I16, "__modhi3") 65HANDLE_LIBCALL(SREM_I32, "__modsi3") 66HANDLE_LIBCALL(SREM_I64, "__moddi3") 67HANDLE_LIBCALL(SREM_I128, "__modti3") 68HANDLE_LIBCALL(UREM_I8, "__umodqi3") 69HANDLE_LIBCALL(UREM_I16, "__umodhi3") 70HANDLE_LIBCALL(UREM_I32, "__umodsi3") 71HANDLE_LIBCALL(UREM_I64, "__umoddi3") 72HANDLE_LIBCALL(UREM_I128, "__umodti3") 73HANDLE_LIBCALL(SDIVREM_I8, nullptr) 74HANDLE_LIBCALL(SDIVREM_I16, nullptr) 75HANDLE_LIBCALL(SDIVREM_I32, nullptr) 76HANDLE_LIBCALL(SDIVREM_I64, nullptr) 77HANDLE_LIBCALL(SDIVREM_I128, nullptr) 78HANDLE_LIBCALL(UDIVREM_I8, nullptr) 79HANDLE_LIBCALL(UDIVREM_I16, nullptr) 80HANDLE_LIBCALL(UDIVREM_I32, nullptr) 81HANDLE_LIBCALL(UDIVREM_I64, nullptr) 82HANDLE_LIBCALL(UDIVREM_I128, nullptr) 83HANDLE_LIBCALL(NEG_I32, "__negsi2") 84HANDLE_LIBCALL(NEG_I64, "__negdi2") 85HANDLE_LIBCALL(CTLZ_I32, "__clzsi2") 86HANDLE_LIBCALL(CTLZ_I64, "__clzdi2") 87HANDLE_LIBCALL(CTLZ_I128, "__clzti2") 88 89// Floating-point 90HANDLE_LIBCALL(ADD_F32, "__addsf3") 91HANDLE_LIBCALL(ADD_F64, "__adddf3") 92HANDLE_LIBCALL(ADD_F80, "__addxf3") 93HANDLE_LIBCALL(ADD_F128, "__addtf3") 94HANDLE_LIBCALL(ADD_PPCF128, "__gcc_qadd") 95HANDLE_LIBCALL(SUB_F32, "__subsf3") 96HANDLE_LIBCALL(SUB_F64, "__subdf3") 97HANDLE_LIBCALL(SUB_F80, "__subxf3") 98HANDLE_LIBCALL(SUB_F128, "__subtf3") 99HANDLE_LIBCALL(SUB_PPCF128, "__gcc_qsub") 100HANDLE_LIBCALL(MUL_F32, "__mulsf3") 101HANDLE_LIBCALL(MUL_F64, "__muldf3") 102HANDLE_LIBCALL(MUL_F80, "__mulxf3") 103HANDLE_LIBCALL(MUL_F128, "__multf3") 104HANDLE_LIBCALL(MUL_PPCF128, "__gcc_qmul") 105HANDLE_LIBCALL(DIV_F32, "__divsf3") 106HANDLE_LIBCALL(DIV_F64, "__divdf3") 107HANDLE_LIBCALL(DIV_F80, "__divxf3") 108HANDLE_LIBCALL(DIV_F128, "__divtf3") 109HANDLE_LIBCALL(DIV_PPCF128, "__gcc_qdiv") 110HANDLE_LIBCALL(REM_F32, "fmodf") 111HANDLE_LIBCALL(REM_F64, "fmod") 112HANDLE_LIBCALL(REM_F80, "fmodl") 113HANDLE_LIBCALL(REM_F128, "fmodl") 114HANDLE_LIBCALL(REM_PPCF128, "fmodl") 115HANDLE_LIBCALL(FMA_F32, "fmaf") 116HANDLE_LIBCALL(FMA_F64, "fma") 117HANDLE_LIBCALL(FMA_F80, "fmal") 118HANDLE_LIBCALL(FMA_F128, "fmal") 119HANDLE_LIBCALL(FMA_PPCF128, "fmal") 120HANDLE_LIBCALL(POWI_F32, "__powisf2") 121HANDLE_LIBCALL(POWI_F64, "__powidf2") 122HANDLE_LIBCALL(POWI_F80, "__powixf2") 123HANDLE_LIBCALL(POWI_F128, "__powitf2") 124HANDLE_LIBCALL(POWI_PPCF128, "__powitf2") 125HANDLE_LIBCALL(SQRT_F32, "sqrtf") 126HANDLE_LIBCALL(SQRT_F64, "sqrt") 127HANDLE_LIBCALL(SQRT_F80, "sqrtl") 128HANDLE_LIBCALL(SQRT_F128, "sqrtl") 129HANDLE_LIBCALL(SQRT_PPCF128, "sqrtl") 130HANDLE_LIBCALL(CBRT_F32, "cbrtf") 131HANDLE_LIBCALL(CBRT_F64, "cbrt") 132HANDLE_LIBCALL(CBRT_F80, "cbrtl") 133HANDLE_LIBCALL(CBRT_F128, "cbrtl") 134HANDLE_LIBCALL(CBRT_PPCF128, "cbrtl") 135HANDLE_LIBCALL(LOG_F32, "logf") 136HANDLE_LIBCALL(LOG_F64, "log") 137HANDLE_LIBCALL(LOG_F80, "logl") 138HANDLE_LIBCALL(LOG_F128, "logl") 139HANDLE_LIBCALL(LOG_PPCF128, "logl") 140HANDLE_LIBCALL(LOG_FINITE_F32, "__logf_finite") 141HANDLE_LIBCALL(LOG_FINITE_F64, "__log_finite") 142HANDLE_LIBCALL(LOG_FINITE_F80, "__logl_finite") 143HANDLE_LIBCALL(LOG_FINITE_F128, "__logl_finite") 144HANDLE_LIBCALL(LOG_FINITE_PPCF128, "__logl_finite") 145HANDLE_LIBCALL(LOG2_F32, "log2f") 146HANDLE_LIBCALL(LOG2_F64, "log2") 147HANDLE_LIBCALL(LOG2_F80, "log2l") 148HANDLE_LIBCALL(LOG2_F128, "log2l") 149HANDLE_LIBCALL(LOG2_PPCF128, "log2l") 150HANDLE_LIBCALL(LOG2_FINITE_F32, "__log2f_finite") 151HANDLE_LIBCALL(LOG2_FINITE_F64, "__log2_finite") 152HANDLE_LIBCALL(LOG2_FINITE_F80, "__log2l_finite") 153HANDLE_LIBCALL(LOG2_FINITE_F128, "__log2l_finite") 154HANDLE_LIBCALL(LOG2_FINITE_PPCF128, "__log2l_finite") 155HANDLE_LIBCALL(LOG10_F32, "log10f") 156HANDLE_LIBCALL(LOG10_F64, "log10") 157HANDLE_LIBCALL(LOG10_F80, "log10l") 158HANDLE_LIBCALL(LOG10_F128, "log10l") 159HANDLE_LIBCALL(LOG10_PPCF128, "log10l") 160HANDLE_LIBCALL(LOG10_FINITE_F32, "__log10f_finite") 161HANDLE_LIBCALL(LOG10_FINITE_F64, "__log10_finite") 162HANDLE_LIBCALL(LOG10_FINITE_F80, "__log10l_finite") 163HANDLE_LIBCALL(LOG10_FINITE_F128, "__log10l_finite") 164HANDLE_LIBCALL(LOG10_FINITE_PPCF128, "__log10l_finite") 165HANDLE_LIBCALL(EXP_F32, "expf") 166HANDLE_LIBCALL(EXP_F64, "exp") 167HANDLE_LIBCALL(EXP_F80, "expl") 168HANDLE_LIBCALL(EXP_F128, "expl") 169HANDLE_LIBCALL(EXP_PPCF128, "expl") 170HANDLE_LIBCALL(EXP_FINITE_F32, "__expf_finite") 171HANDLE_LIBCALL(EXP_FINITE_F64, "__exp_finite") 172HANDLE_LIBCALL(EXP_FINITE_F80, "__expl_finite") 173HANDLE_LIBCALL(EXP_FINITE_F128, "__expl_finite") 174HANDLE_LIBCALL(EXP_FINITE_PPCF128, "__expl_finite") 175HANDLE_LIBCALL(EXP2_F32, "exp2f") 176HANDLE_LIBCALL(EXP2_F64, "exp2") 177HANDLE_LIBCALL(EXP2_F80, "exp2l") 178HANDLE_LIBCALL(EXP2_F128, "exp2l") 179HANDLE_LIBCALL(EXP2_PPCF128, "exp2l") 180HANDLE_LIBCALL(EXP2_FINITE_F32, "__exp2f_finite") 181HANDLE_LIBCALL(EXP2_FINITE_F64, "__exp2_finite") 182HANDLE_LIBCALL(EXP2_FINITE_F80, "__exp2l_finite") 183HANDLE_LIBCALL(EXP2_FINITE_F128, "__exp2l_finite") 184HANDLE_LIBCALL(EXP2_FINITE_PPCF128, "__exp2l_finite") 185HANDLE_LIBCALL(SIN_F32, "sinf") 186HANDLE_LIBCALL(SIN_F64, "sin") 187HANDLE_LIBCALL(SIN_F80, "sinl") 188HANDLE_LIBCALL(SIN_F128, "sinl") 189HANDLE_LIBCALL(SIN_PPCF128, "sinl") 190HANDLE_LIBCALL(COS_F32, "cosf") 191HANDLE_LIBCALL(COS_F64, "cos") 192HANDLE_LIBCALL(COS_F80, "cosl") 193HANDLE_LIBCALL(COS_F128, "cosl") 194HANDLE_LIBCALL(COS_PPCF128, "cosl") 195HANDLE_LIBCALL(SINCOS_F32, nullptr) 196HANDLE_LIBCALL(SINCOS_F64, nullptr) 197HANDLE_LIBCALL(SINCOS_F80, nullptr) 198HANDLE_LIBCALL(SINCOS_F128, nullptr) 199HANDLE_LIBCALL(SINCOS_PPCF128, nullptr) 200HANDLE_LIBCALL(SINCOS_STRET_F32, nullptr) 201HANDLE_LIBCALL(SINCOS_STRET_F64, nullptr) 202HANDLE_LIBCALL(POW_F32, "powf") 203HANDLE_LIBCALL(POW_F64, "pow") 204HANDLE_LIBCALL(POW_F80, "powl") 205HANDLE_LIBCALL(POW_F128, "powl") 206HANDLE_LIBCALL(POW_PPCF128, "powl") 207HANDLE_LIBCALL(POW_FINITE_F32, "__powf_finite") 208HANDLE_LIBCALL(POW_FINITE_F64, "__pow_finite") 209HANDLE_LIBCALL(POW_FINITE_F80, "__powl_finite") 210HANDLE_LIBCALL(POW_FINITE_F128, "__powl_finite") 211HANDLE_LIBCALL(POW_FINITE_PPCF128, "__powl_finite") 212HANDLE_LIBCALL(CEIL_F32, "ceilf") 213HANDLE_LIBCALL(CEIL_F64, "ceil") 214HANDLE_LIBCALL(CEIL_F80, "ceill") 215HANDLE_LIBCALL(CEIL_F128, "ceill") 216HANDLE_LIBCALL(CEIL_PPCF128, "ceill") 217HANDLE_LIBCALL(TRUNC_F32, "truncf") 218HANDLE_LIBCALL(TRUNC_F64, "trunc") 219HANDLE_LIBCALL(TRUNC_F80, "truncl") 220HANDLE_LIBCALL(TRUNC_F128, "truncl") 221HANDLE_LIBCALL(TRUNC_PPCF128, "truncl") 222HANDLE_LIBCALL(RINT_F32, "rintf") 223HANDLE_LIBCALL(RINT_F64, "rint") 224HANDLE_LIBCALL(RINT_F80, "rintl") 225HANDLE_LIBCALL(RINT_F128, "rintl") 226HANDLE_LIBCALL(RINT_PPCF128, "rintl") 227HANDLE_LIBCALL(NEARBYINT_F32, "nearbyintf") 228HANDLE_LIBCALL(NEARBYINT_F64, "nearbyint") 229HANDLE_LIBCALL(NEARBYINT_F80, "nearbyintl") 230HANDLE_LIBCALL(NEARBYINT_F128, "nearbyintl") 231HANDLE_LIBCALL(NEARBYINT_PPCF128, "nearbyintl") 232HANDLE_LIBCALL(ROUND_F32, "roundf") 233HANDLE_LIBCALL(ROUND_F64, "round") 234HANDLE_LIBCALL(ROUND_F80, "roundl") 235HANDLE_LIBCALL(ROUND_F128, "roundl") 236HANDLE_LIBCALL(ROUND_PPCF128, "roundl") 237HANDLE_LIBCALL(FLOOR_F32, "floorf") 238HANDLE_LIBCALL(FLOOR_F64, "floor") 239HANDLE_LIBCALL(FLOOR_F80, "floorl") 240HANDLE_LIBCALL(FLOOR_F128, "floorl") 241HANDLE_LIBCALL(FLOOR_PPCF128, "floorl") 242HANDLE_LIBCALL(COPYSIGN_F32, "copysignf") 243HANDLE_LIBCALL(COPYSIGN_F64, "copysign") 244HANDLE_LIBCALL(COPYSIGN_F80, "copysignl") 245HANDLE_LIBCALL(COPYSIGN_F128, "copysignl") 246HANDLE_LIBCALL(COPYSIGN_PPCF128, "copysignl") 247HANDLE_LIBCALL(FMIN_F32, "fminf") 248HANDLE_LIBCALL(FMIN_F64, "fmin") 249HANDLE_LIBCALL(FMIN_F80, "fminl") 250HANDLE_LIBCALL(FMIN_F128, "fminl") 251HANDLE_LIBCALL(FMIN_PPCF128, "fminl") 252HANDLE_LIBCALL(FMAX_F32, "fmaxf") 253HANDLE_LIBCALL(FMAX_F64, "fmax") 254HANDLE_LIBCALL(FMAX_F80, "fmaxl") 255HANDLE_LIBCALL(FMAX_F128, "fmaxl") 256HANDLE_LIBCALL(FMAX_PPCF128, "fmaxl") 257HANDLE_LIBCALL(LROUND_F32, "lroundf") 258HANDLE_LIBCALL(LROUND_F64, "lround") 259HANDLE_LIBCALL(LROUND_F80, "lroundl") 260HANDLE_LIBCALL(LROUND_F128, "lroundl") 261HANDLE_LIBCALL(LROUND_PPCF128, "lroundl") 262HANDLE_LIBCALL(LLROUND_F32, "llroundf") 263HANDLE_LIBCALL(LLROUND_F64, "llround") 264HANDLE_LIBCALL(LLROUND_F80, "llroundl") 265HANDLE_LIBCALL(LLROUND_F128, "llroundl") 266HANDLE_LIBCALL(LLROUND_PPCF128, "llroundl") 267HANDLE_LIBCALL(LRINT_F32, "lrintf") 268HANDLE_LIBCALL(LRINT_F64, "lrint") 269HANDLE_LIBCALL(LRINT_F80, "lrintl") 270HANDLE_LIBCALL(LRINT_F128, "lrintl") 271HANDLE_LIBCALL(LRINT_PPCF128, "lrintl") 272HANDLE_LIBCALL(LLRINT_F32, "llrintf") 273HANDLE_LIBCALL(LLRINT_F64, "llrint") 274HANDLE_LIBCALL(LLRINT_F80, "llrintl") 275HANDLE_LIBCALL(LLRINT_F128, "llrintl") 276HANDLE_LIBCALL(LLRINT_PPCF128, "llrintl") 277 278// Conversion 279HANDLE_LIBCALL(FPEXT_F32_PPCF128, "__gcc_stoq") 280HANDLE_LIBCALL(FPEXT_F64_PPCF128, "__gcc_dtoq") 281HANDLE_LIBCALL(FPEXT_F80_F128, "__extendxftf2") 282HANDLE_LIBCALL(FPEXT_F64_F128, "__extenddftf2") 283HANDLE_LIBCALL(FPEXT_F32_F128, "__extendsftf2") 284HANDLE_LIBCALL(FPEXT_F32_F64, "__extendsfdf2") 285HANDLE_LIBCALL(FPEXT_F16_F32, "__gnu_h2f_ieee") 286HANDLE_LIBCALL(FPROUND_F32_F16, "__gnu_f2h_ieee") 287HANDLE_LIBCALL(FPROUND_F64_F16, "__truncdfhf2") 288HANDLE_LIBCALL(FPROUND_F80_F16, "__truncxfhf2") 289HANDLE_LIBCALL(FPROUND_F128_F16, "__trunctfhf2") 290HANDLE_LIBCALL(FPROUND_PPCF128_F16, "__trunctfhf2") 291HANDLE_LIBCALL(FPROUND_F64_F32, "__truncdfsf2") 292HANDLE_LIBCALL(FPROUND_F80_F32, "__truncxfsf2") 293HANDLE_LIBCALL(FPROUND_F128_F32, "__trunctfsf2") 294HANDLE_LIBCALL(FPROUND_PPCF128_F32, "__gcc_qtos") 295HANDLE_LIBCALL(FPROUND_F80_F64, "__truncxfdf2") 296HANDLE_LIBCALL(FPROUND_F128_F64, "__trunctfdf2") 297HANDLE_LIBCALL(FPROUND_PPCF128_F64, "__gcc_qtod") 298HANDLE_LIBCALL(FPROUND_F128_F80, "__trunctfxf2") 299HANDLE_LIBCALL(FPTOSINT_F32_I32, "__fixsfsi") 300HANDLE_LIBCALL(FPTOSINT_F32_I64, "__fixsfdi") 301HANDLE_LIBCALL(FPTOSINT_F32_I128, "__fixsfti") 302HANDLE_LIBCALL(FPTOSINT_F64_I32, "__fixdfsi") 303HANDLE_LIBCALL(FPTOSINT_F64_I64, "__fixdfdi") 304HANDLE_LIBCALL(FPTOSINT_F64_I128, "__fixdfti") 305HANDLE_LIBCALL(FPTOSINT_F80_I32, "__fixxfsi") 306HANDLE_LIBCALL(FPTOSINT_F80_I64, "__fixxfdi") 307HANDLE_LIBCALL(FPTOSINT_F80_I128, "__fixxfti") 308HANDLE_LIBCALL(FPTOSINT_F128_I32, "__fixtfsi") 309HANDLE_LIBCALL(FPTOSINT_F128_I64, "__fixtfdi") 310HANDLE_LIBCALL(FPTOSINT_F128_I128, "__fixtfti") 311HANDLE_LIBCALL(FPTOSINT_PPCF128_I32, "__gcc_qtou") 312HANDLE_LIBCALL(FPTOSINT_PPCF128_I64, "__fixtfdi") 313HANDLE_LIBCALL(FPTOSINT_PPCF128_I128, "__fixtfti") 314HANDLE_LIBCALL(FPTOUINT_F32_I32, "__fixunssfsi") 315HANDLE_LIBCALL(FPTOUINT_F32_I64, "__fixunssfdi") 316HANDLE_LIBCALL(FPTOUINT_F32_I128, "__fixunssfti") 317HANDLE_LIBCALL(FPTOUINT_F64_I32, "__fixunsdfsi") 318HANDLE_LIBCALL(FPTOUINT_F64_I64, "__fixunsdfdi") 319HANDLE_LIBCALL(FPTOUINT_F64_I128, "__fixunsdfti") 320HANDLE_LIBCALL(FPTOUINT_F80_I32, "__fixunsxfsi") 321HANDLE_LIBCALL(FPTOUINT_F80_I64, "__fixunsxfdi") 322HANDLE_LIBCALL(FPTOUINT_F80_I128, "__fixunsxfti") 323HANDLE_LIBCALL(FPTOUINT_F128_I32, "__fixunstfsi") 324HANDLE_LIBCALL(FPTOUINT_F128_I64, "__fixunstfdi") 325HANDLE_LIBCALL(FPTOUINT_F128_I128, "__fixunstfti") 326HANDLE_LIBCALL(FPTOUINT_PPCF128_I32, "__fixunstfsi") 327HANDLE_LIBCALL(FPTOUINT_PPCF128_I64, "__fixunstfdi") 328HANDLE_LIBCALL(FPTOUINT_PPCF128_I128, "__fixunstfti") 329HANDLE_LIBCALL(SINTTOFP_I32_F32, "__floatsisf") 330HANDLE_LIBCALL(SINTTOFP_I32_F64, "__floatsidf") 331HANDLE_LIBCALL(SINTTOFP_I32_F80, "__floatsixf") 332HANDLE_LIBCALL(SINTTOFP_I32_F128, "__floatsitf") 333HANDLE_LIBCALL(SINTTOFP_I32_PPCF128, "__gcc_itoq") 334HANDLE_LIBCALL(SINTTOFP_I64_F32, "__floatdisf") 335HANDLE_LIBCALL(SINTTOFP_I64_F64, "__floatdidf") 336HANDLE_LIBCALL(SINTTOFP_I64_F80, "__floatdixf") 337HANDLE_LIBCALL(SINTTOFP_I64_F128, "__floatditf") 338HANDLE_LIBCALL(SINTTOFP_I64_PPCF128, "__floatditf") 339HANDLE_LIBCALL(SINTTOFP_I128_F32, "__floattisf") 340HANDLE_LIBCALL(SINTTOFP_I128_F64, "__floattidf") 341HANDLE_LIBCALL(SINTTOFP_I128_F80, "__floattixf") 342HANDLE_LIBCALL(SINTTOFP_I128_F128, "__floattitf") 343HANDLE_LIBCALL(SINTTOFP_I128_PPCF128, "__floattitf") 344HANDLE_LIBCALL(UINTTOFP_I32_F32, "__floatunsisf") 345HANDLE_LIBCALL(UINTTOFP_I32_F64, "__floatunsidf") 346HANDLE_LIBCALL(UINTTOFP_I32_F80, "__floatunsixf") 347HANDLE_LIBCALL(UINTTOFP_I32_F128, "__floatunsitf") 348HANDLE_LIBCALL(UINTTOFP_I32_PPCF128, "__gcc_utoq") 349HANDLE_LIBCALL(UINTTOFP_I64_F32, "__floatundisf") 350HANDLE_LIBCALL(UINTTOFP_I64_F64, "__floatundidf") 351HANDLE_LIBCALL(UINTTOFP_I64_F80, "__floatundixf") 352HANDLE_LIBCALL(UINTTOFP_I64_F128, "__floatunditf") 353HANDLE_LIBCALL(UINTTOFP_I64_PPCF128, "__floatunditf") 354HANDLE_LIBCALL(UINTTOFP_I128_F32, "__floatuntisf") 355HANDLE_LIBCALL(UINTTOFP_I128_F64, "__floatuntidf") 356HANDLE_LIBCALL(UINTTOFP_I128_F80, "__floatuntixf") 357HANDLE_LIBCALL(UINTTOFP_I128_F128, "__floatuntitf") 358HANDLE_LIBCALL(UINTTOFP_I128_PPCF128, "__floatuntitf") 359 360// Comparison 361HANDLE_LIBCALL(OEQ_F32, "__eqsf2") 362HANDLE_LIBCALL(OEQ_F64, "__eqdf2") 363HANDLE_LIBCALL(OEQ_F128, "__eqtf2") 364HANDLE_LIBCALL(OEQ_PPCF128, "__gcc_qeq") 365HANDLE_LIBCALL(UNE_F32, "__nesf2") 366HANDLE_LIBCALL(UNE_F64, "__nedf2") 367HANDLE_LIBCALL(UNE_F128, "__netf2") 368HANDLE_LIBCALL(UNE_PPCF128, "__gcc_qne") 369HANDLE_LIBCALL(OGE_F32, "__gesf2") 370HANDLE_LIBCALL(OGE_F64, "__gedf2") 371HANDLE_LIBCALL(OGE_F128, "__getf2") 372HANDLE_LIBCALL(OGE_PPCF128, "__gcc_qge") 373HANDLE_LIBCALL(OLT_F32, "__ltsf2") 374HANDLE_LIBCALL(OLT_F64, "__ltdf2") 375HANDLE_LIBCALL(OLT_F128, "__lttf2") 376HANDLE_LIBCALL(OLT_PPCF128, "__gcc_qlt") 377HANDLE_LIBCALL(OLE_F32, "__lesf2") 378HANDLE_LIBCALL(OLE_F64, "__ledf2") 379HANDLE_LIBCALL(OLE_F128, "__letf2") 380HANDLE_LIBCALL(OLE_PPCF128, "__gcc_qle") 381HANDLE_LIBCALL(OGT_F32, "__gtsf2") 382HANDLE_LIBCALL(OGT_F64, "__gtdf2") 383HANDLE_LIBCALL(OGT_F128, "__gttf2") 384HANDLE_LIBCALL(OGT_PPCF128, "__gcc_qgt") 385HANDLE_LIBCALL(UO_F32, "__unordsf2") 386HANDLE_LIBCALL(UO_F64, "__unorddf2") 387HANDLE_LIBCALL(UO_F128, "__unordtf2") 388HANDLE_LIBCALL(UO_PPCF128, "__gcc_qunord") 389 390// Memory 391HANDLE_LIBCALL(MEMCPY, "memcpy") 392HANDLE_LIBCALL(MEMMOVE, "memmove") 393HANDLE_LIBCALL(MEMSET, "memset") 394HANDLE_LIBCALL(BZERO, nullptr) 395 396// Element-wise unordered-atomic memory of different sizes 397HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memcpy_element_unordered_atomic_1") 398HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memcpy_element_unordered_atomic_2") 399HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memcpy_element_unordered_atomic_4") 400HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memcpy_element_unordered_atomic_8") 401HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memcpy_element_unordered_atomic_16") 402HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memmove_element_unordered_atomic_1") 403HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memmove_element_unordered_atomic_2") 404HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memmove_element_unordered_atomic_4") 405HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memmove_element_unordered_atomic_8") 406HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memmove_element_unordered_atomic_16") 407HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memset_element_unordered_atomic_1") 408HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memset_element_unordered_atomic_2") 409HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memset_element_unordered_atomic_4") 410HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memset_element_unordered_atomic_8") 411HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memset_element_unordered_atomic_16") 412 413// Exception handling 414HANDLE_LIBCALL(UNWIND_RESUME, "_Unwind_Resume") 415 416// Note: there are two sets of atomics libcalls; see 417// <https://llvm.org/docs/Atomics.html> for more info on the 418// difference between them. 419 420// Atomic '__sync_*' libcalls. 421HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_1, "__sync_val_compare_and_swap_1") 422HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_2, "__sync_val_compare_and_swap_2") 423HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_4, "__sync_val_compare_and_swap_4") 424HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_8, "__sync_val_compare_and_swap_8") 425HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_16, "__sync_val_compare_and_swap_16") 426HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_1, "__sync_lock_test_and_set_1") 427HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_2, "__sync_lock_test_and_set_2") 428HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_4, "__sync_lock_test_and_set_4") 429HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_8, "__sync_lock_test_and_set_8") 430HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_16, "__sync_lock_test_and_set_16") 431HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_1, "__sync_fetch_and_add_1") 432HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_2, "__sync_fetch_and_add_2") 433HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_4, "__sync_fetch_and_add_4") 434HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_8, "__sync_fetch_and_add_8") 435HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_16, "__sync_fetch_and_add_16") 436HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_1, "__sync_fetch_and_sub_1") 437HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_2, "__sync_fetch_and_sub_2") 438HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_4, "__sync_fetch_and_sub_4") 439HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_8, "__sync_fetch_and_sub_8") 440HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_16, "__sync_fetch_and_sub_16") 441HANDLE_LIBCALL(SYNC_FETCH_AND_AND_1, "__sync_fetch_and_and_1") 442HANDLE_LIBCALL(SYNC_FETCH_AND_AND_2, "__sync_fetch_and_and_2") 443HANDLE_LIBCALL(SYNC_FETCH_AND_AND_4, "__sync_fetch_and_and_4") 444HANDLE_LIBCALL(SYNC_FETCH_AND_AND_8, "__sync_fetch_and_and_8") 445HANDLE_LIBCALL(SYNC_FETCH_AND_AND_16, "__sync_fetch_and_and_16") 446HANDLE_LIBCALL(SYNC_FETCH_AND_OR_1, "__sync_fetch_and_or_1") 447HANDLE_LIBCALL(SYNC_FETCH_AND_OR_2, "__sync_fetch_and_or_2") 448HANDLE_LIBCALL(SYNC_FETCH_AND_OR_4, "__sync_fetch_and_or_4") 449HANDLE_LIBCALL(SYNC_FETCH_AND_OR_8, "__sync_fetch_and_or_8") 450HANDLE_LIBCALL(SYNC_FETCH_AND_OR_16, "__sync_fetch_and_or_16") 451HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_1, "__sync_fetch_and_xor_1") 452HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_2, "__sync_fetch_and_xor_2") 453HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_4, "__sync_fetch_and_xor_4") 454HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_8, "__sync_fetch_and_xor_8") 455HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_16, "__sync_fetch_and_xor_16") 456HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_1, "__sync_fetch_and_nand_1") 457HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_2, "__sync_fetch_and_nand_2") 458HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_4, "__sync_fetch_and_nand_4") 459HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_8, "__sync_fetch_and_nand_8") 460HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_16, "__sync_fetch_and_nand_16") 461HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_1, "__sync_fetch_and_max_1") 462HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_2, "__sync_fetch_and_max_2") 463HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_4, "__sync_fetch_and_max_4") 464HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_8, "__sync_fetch_and_max_8") 465HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_16, "__sync_fetch_and_max_16") 466HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_1, "__sync_fetch_and_umax_1") 467HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_2, "__sync_fetch_and_umax_2") 468HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_4, "__sync_fetch_and_umax_4") 469HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_8, "__sync_fetch_and_umax_8") 470HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_16, "__sync_fetch_and_umax_16") 471HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_1, "__sync_fetch_and_min_1") 472HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_2, "__sync_fetch_and_min_2") 473HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_4, "__sync_fetch_and_min_4") 474HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_8, "__sync_fetch_and_min_8") 475HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_16, "__sync_fetch_and_min_16") 476HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_1, "__sync_fetch_and_umin_1") 477HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_2, "__sync_fetch_and_umin_2") 478HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_4, "__sync_fetch_and_umin_4") 479HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_8, "__sync_fetch_and_umin_8") 480HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_16, "__sync_fetch_and_umin_16") 481 482// Atomic `__atomic_*' libcalls. 483HANDLE_LIBCALL(ATOMIC_LOAD, "__atomic_load") 484HANDLE_LIBCALL(ATOMIC_LOAD_1, "__atomic_load_1") 485HANDLE_LIBCALL(ATOMIC_LOAD_2, "__atomic_load_2") 486HANDLE_LIBCALL(ATOMIC_LOAD_4, "__atomic_load_4") 487HANDLE_LIBCALL(ATOMIC_LOAD_8, "__atomic_load_8") 488HANDLE_LIBCALL(ATOMIC_LOAD_16, "__atomic_load_16") 489 490HANDLE_LIBCALL(ATOMIC_STORE, "__atomic_store") 491HANDLE_LIBCALL(ATOMIC_STORE_1, "__atomic_store_1") 492HANDLE_LIBCALL(ATOMIC_STORE_2, "__atomic_store_2") 493HANDLE_LIBCALL(ATOMIC_STORE_4, "__atomic_store_4") 494HANDLE_LIBCALL(ATOMIC_STORE_8, "__atomic_store_8") 495HANDLE_LIBCALL(ATOMIC_STORE_16, "__atomic_store_16") 496 497HANDLE_LIBCALL(ATOMIC_EXCHANGE, "__atomic_exchange") 498HANDLE_LIBCALL(ATOMIC_EXCHANGE_1, "__atomic_exchange_1") 499HANDLE_LIBCALL(ATOMIC_EXCHANGE_2, "__atomic_exchange_2") 500HANDLE_LIBCALL(ATOMIC_EXCHANGE_4, "__atomic_exchange_4") 501HANDLE_LIBCALL(ATOMIC_EXCHANGE_8, "__atomic_exchange_8") 502HANDLE_LIBCALL(ATOMIC_EXCHANGE_16, "__atomic_exchange_16") 503 504HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE, "__atomic_compare_exchange") 505HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_1, "__atomic_compare_exchange_1") 506HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_2, "__atomic_compare_exchange_2") 507HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_4, "__atomic_compare_exchange_4") 508HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_8, "__atomic_compare_exchange_8") 509HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_16, "__atomic_compare_exchange_16") 510 511HANDLE_LIBCALL(ATOMIC_FETCH_ADD_1, "__atomic_fetch_add_1") 512HANDLE_LIBCALL(ATOMIC_FETCH_ADD_2, "__atomic_fetch_add_2") 513HANDLE_LIBCALL(ATOMIC_FETCH_ADD_4, "__atomic_fetch_add_4") 514HANDLE_LIBCALL(ATOMIC_FETCH_ADD_8, "__atomic_fetch_add_8") 515HANDLE_LIBCALL(ATOMIC_FETCH_ADD_16, "__atomic_fetch_add_16") 516HANDLE_LIBCALL(ATOMIC_FETCH_SUB_1, "__atomic_fetch_sub_1") 517HANDLE_LIBCALL(ATOMIC_FETCH_SUB_2, "__atomic_fetch_sub_2") 518HANDLE_LIBCALL(ATOMIC_FETCH_SUB_4, "__atomic_fetch_sub_4") 519HANDLE_LIBCALL(ATOMIC_FETCH_SUB_8, "__atomic_fetch_sub_8") 520HANDLE_LIBCALL(ATOMIC_FETCH_SUB_16, "__atomic_fetch_sub_16") 521HANDLE_LIBCALL(ATOMIC_FETCH_AND_1, "__atomic_fetch_and_1") 522HANDLE_LIBCALL(ATOMIC_FETCH_AND_2, "__atomic_fetch_and_2") 523HANDLE_LIBCALL(ATOMIC_FETCH_AND_4, "__atomic_fetch_and_4") 524HANDLE_LIBCALL(ATOMIC_FETCH_AND_8, "__atomic_fetch_and_8") 525HANDLE_LIBCALL(ATOMIC_FETCH_AND_16, "__atomic_fetch_and_16") 526HANDLE_LIBCALL(ATOMIC_FETCH_OR_1, "__atomic_fetch_or_1") 527HANDLE_LIBCALL(ATOMIC_FETCH_OR_2, "__atomic_fetch_or_2") 528HANDLE_LIBCALL(ATOMIC_FETCH_OR_4, "__atomic_fetch_or_4") 529HANDLE_LIBCALL(ATOMIC_FETCH_OR_8, "__atomic_fetch_or_8") 530HANDLE_LIBCALL(ATOMIC_FETCH_OR_16, "__atomic_fetch_or_16") 531HANDLE_LIBCALL(ATOMIC_FETCH_XOR_1, "__atomic_fetch_xor_1") 532HANDLE_LIBCALL(ATOMIC_FETCH_XOR_2, "__atomic_fetch_xor_2") 533HANDLE_LIBCALL(ATOMIC_FETCH_XOR_4, "__atomic_fetch_xor_4") 534HANDLE_LIBCALL(ATOMIC_FETCH_XOR_8, "__atomic_fetch_xor_8") 535HANDLE_LIBCALL(ATOMIC_FETCH_XOR_16, "__atomic_fetch_xor_16") 536HANDLE_LIBCALL(ATOMIC_FETCH_NAND_1, "__atomic_fetch_nand_1") 537HANDLE_LIBCALL(ATOMIC_FETCH_NAND_2, "__atomic_fetch_nand_2") 538HANDLE_LIBCALL(ATOMIC_FETCH_NAND_4, "__atomic_fetch_nand_4") 539HANDLE_LIBCALL(ATOMIC_FETCH_NAND_8, "__atomic_fetch_nand_8") 540HANDLE_LIBCALL(ATOMIC_FETCH_NAND_16, "__atomic_fetch_nand_16") 541 542// Stack Protector Fail 543HANDLE_LIBCALL(STACKPROTECTOR_CHECK_FAIL, "__stack_chk_fail") 544 545// Deoptimization 546HANDLE_LIBCALL(DEOPTIMIZE, "__llvm_deoptimize") 547 548// Return address 549HANDLE_LIBCALL(RETURN_ADDRESS, nullptr) 550 551HANDLE_LIBCALL(UNKNOWN_LIBCALL, nullptr) 552 553#undef HANDLE_LIBCALL 554