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