//===-- runtime/numeric.cpp -----------------------------------------------===// // // 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 "flang/Runtime/numeric.h" #include "terminator.h" #include "flang/Runtime/float128.h" #include #include #include #include namespace Fortran::runtime { template inline RES getIntArgValue(const char *source, int line, void *arg, int kind, std::int64_t defaultValue, int resKind) { RES res; if (!arg) { res = static_cast(defaultValue); } else if (kind == 1) { res = static_cast( *static_cast *>(arg)); } else if (kind == 2) { res = static_cast( *static_cast *>(arg)); } else if (kind == 4) { res = static_cast( *static_cast *>(arg)); } else if (kind == 8) { res = static_cast( *static_cast *>(arg)); #ifdef __SIZEOF_INT128__ } else if (kind == 16) { if (resKind != 16) { Terminator{source, line}.Crash("Unexpected integer kind in runtime"); } res = static_cast( *static_cast *>(arg)); #endif } else { Terminator{source, line}.Crash("Unexpected integer kind in runtime"); } return res; } // NINT (16.9.141) template inline RESULT Nint(ARG x) { if (x >= 0) { return std::trunc(x + ARG{0.5}); } else { return std::trunc(x - ARG{0.5}); } } // CEILING & FLOOR (16.9.43, .79) template inline RESULT Ceiling(ARG x) { return std::ceil(x); } template inline RESULT Floor(ARG x) { return std::floor(x); } // EXPONENT (16.9.75) template inline RESULT Exponent(ARG x) { if (std::isinf(x) || std::isnan(x)) { return std::numeric_limits::max(); // +/-Inf, NaN -> HUGE(0) } else if (x == 0) { return 0; // 0 -> 0 } else { return std::ilogb(x) + 1; } } // FRACTION (16.9.80) template inline T Fraction(T x) { if (std::isnan(x)) { return x; // NaN -> same NaN } else if (std::isinf(x)) { return std::numeric_limits::quiet_NaN(); // +/-Inf -> NaN } else if (x == 0) { return x; // 0 -> same 0 } else { int ignoredExp; return std::frexp(x, &ignoredExp); } } // MOD & MODULO (16.9.135, .136) template inline T IntMod(T x, T p, const char *sourceFile, int sourceLine) { if (p == 0) { Terminator{sourceFile, sourceLine}.Crash( IS_MODULO ? "MODULO with P==0" : "MOD with P==0"); } auto mod{x - (x / p) * p}; if (IS_MODULO && (x > 0) != (p > 0)) { mod += p; } return mod; } template inline T RealMod(T a, T p, const char *sourceFile, int sourceLine) { if (p == 0) { Terminator{sourceFile, sourceLine}.Crash( IS_MODULO ? "MODULO with P==0" : "MOD with P==0"); } T quotient{a / p}; if (std::isinf(quotient) && std::isfinite(a) && std::isfinite(p)) { // a/p overflowed -- so it must be an integer, and the result // must be a zero of the same sign as one of the operands. return std::copysign(T{}, IS_MODULO ? p : a); } T toInt{IS_MODULO ? std::floor(quotient) : std::trunc(quotient)}; return a - toInt * p; } // RRSPACING (16.9.164) template inline T RRSpacing(T x) { if (std::isnan(x)) { return x; // NaN -> same NaN } else if (std::isinf(x)) { return std::numeric_limits::quiet_NaN(); // +/-Inf -> NaN } else if (x == 0) { return 0; // 0 -> 0 } else { return std::ldexp(std::abs(x), PREC - (std::ilogb(x) + 1)); } } // SCALE (16.9.166) template inline T Scale(T x, std::int64_t p) { auto ip{static_cast(p)}; if (ip != p) { ip = p < 0 ? std::numeric_limits::min() : std::numeric_limits::max(); } return std::ldexp(x, p); // x*2**p } // SELECTED_INT_KIND (16.9.169) template inline CppTypeFor SelectedIntKind(T x) { if (x <= 2) { return 1; } else if (x <= 4) { return 2; } else if (x <= 9) { return 4; } else if (x <= 18) { return 8; #ifdef __SIZEOF_INT128__ } else if (x <= 38) { return 16; #endif } return -1; } // SELECTED_REAL_KIND (16.9.170) template inline CppTypeFor SelectedRealKind(P p, R r, D d) { if (d != 2) { return -5; } int error{0}; int kind{0}; if (p <= 3) { kind = 2; } else if (p <= 6) { kind = 4; } else if (p <= 15) { kind = 8; #if LDBL_MANT_DIG == 64 } else if (p <= 18) { kind = 10; } else if (p <= 33) { kind = 16; #elif LDBL_MANT_DIG == 113 } else if (p <= 33) { kind = 16; #endif } else { error -= 1; } if (r <= 4) { kind = kind < 2 ? 2 : kind; } else if (r <= 37) { kind = kind < 3 ? (p == 3 ? 4 : 3) : kind; } else if (r <= 307) { kind = kind < 8 ? 8 : kind; #if LDBL_MANT_DIG == 64 } else if (r <= 4931) { kind = kind < 10 ? 10 : kind; #elif LDBL_MANT_DIG == 113 } else if (r <= 4931) { kind = kind < 16 ? 16 : kind; #endif } else { error -= 2; } return error ? error : kind; } // SET_EXPONENT (16.9.171) template inline T SetExponent(T x, std::int64_t p) { if (std::isnan(x)) { return x; // NaN -> same NaN } else if (std::isinf(x)) { return std::numeric_limits::quiet_NaN(); // +/-Inf -> NaN } else if (x == 0) { return x; // return negative zero if x is negative zero } else { int expo{std::ilogb(x) + 1}; auto ip{static_cast(p - expo)}; if (ip != p - expo) { ip = p < 0 ? std::numeric_limits::min() : std::numeric_limits::max(); } return std::ldexp(x, ip); // x*2**(p-e) } } // SPACING (16.9.180) template inline T Spacing(T x) { if (std::isnan(x)) { return x; // NaN -> same NaN } else if (std::isinf(x)) { return std::numeric_limits::quiet_NaN(); // +/-Inf -> NaN } else if (x == 0) { // The standard-mandated behavior seems broken, since TINY() can't be // subnormal. return std::numeric_limits::min(); // 0 -> TINY(x) } else { T result{ std::ldexp(static_cast(1.0), std::ilogb(x) + 1 - PREC)}; // 2**(e-p) return result == 0 ? /*TINY(x)*/ std::numeric_limits::min() : result; } } // NEAREST (16.9.139) template inline T Nearest(T x, bool positive) { auto spacing{Spacing(x)}; if (x == 0) { auto least{std::numeric_limits::denorm_min()}; return positive ? least : -least; } else { return positive ? x + spacing : x - spacing; } } // Exponentiation operator for (Real ** Integer) cases (10.1.5.2.1). template BTy FPowI(BTy base, ETy exp) { if (exp == ETy{0}) return BTy{1}; bool isNegativePower{exp < ETy{0}}; bool isMinPower{exp == std::numeric_limits::min()}; if (isMinPower) { exp = std::numeric_limits::max(); } else if (isNegativePower) { exp = -exp; } BTy result{1}; BTy origBase{base}; while (true) { if (exp & ETy{1}) { result *= base; } exp >>= 1; if (exp == ETy{0}) { break; } base *= base; } if (isMinPower) { result *= origBase; } if (isNegativePower) { result = BTy{1} / result; } return result; } extern "C" { CppTypeFor RTNAME(Ceiling4_1)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling4_2)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling4_4)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling4_8)( CppTypeFor x) { return Ceiling>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Ceiling4_16)( CppTypeFor x) { return Ceiling>(x); } #endif CppTypeFor RTNAME(Ceiling8_1)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling8_2)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling8_4)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling8_8)( CppTypeFor x) { return Ceiling>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Ceiling8_16)( CppTypeFor x) { return Ceiling>(x); } #endif #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(Ceiling10_1)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling10_2)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling10_4)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling10_8)( CppTypeFor x) { return Ceiling>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Ceiling10_16)( CppTypeFor x) { return Ceiling>(x); } #endif #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(Ceiling16_1)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling16_2)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling16_4)( CppTypeFor x) { return Ceiling>(x); } CppTypeFor RTNAME(Ceiling16_8)( CppTypeFor x) { return Ceiling>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Ceiling16_16)( CppTypeFor x) { return Ceiling>(x); } #endif #endif CppTypeFor RTNAME(Exponent4_4)( CppTypeFor x) { return Exponent>(x); } CppTypeFor RTNAME(Exponent4_8)( CppTypeFor x) { return Exponent>(x); } CppTypeFor RTNAME(Exponent8_4)( CppTypeFor x) { return Exponent>(x); } CppTypeFor RTNAME(Exponent8_8)( CppTypeFor x) { return Exponent>(x); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(Exponent10_4)( CppTypeFor x) { return Exponent>(x); } CppTypeFor RTNAME(Exponent10_8)( CppTypeFor x) { return Exponent>(x); } #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(Exponent16_4)( CppTypeFor x) { return Exponent>(x); } CppTypeFor RTNAME(Exponent16_8)( CppTypeFor x) { return Exponent>(x); } #endif CppTypeFor RTNAME(Floor4_1)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor4_2)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor4_4)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor4_8)( CppTypeFor x) { return Floor>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Floor4_16)( CppTypeFor x) { return Floor>(x); } #endif CppTypeFor RTNAME(Floor8_1)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor8_2)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor8_4)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor8_8)( CppTypeFor x) { return Floor>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Floor8_16)( CppTypeFor x) { return Floor>(x); } #endif #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(Floor10_1)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor10_2)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor10_4)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor10_8)( CppTypeFor x) { return Floor>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Floor10_16)( CppTypeFor x) { return Floor>(x); } #endif #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(Floor16_1)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor16_2)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor16_4)( CppTypeFor x) { return Floor>(x); } CppTypeFor RTNAME(Floor16_8)( CppTypeFor x) { return Floor>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Floor16_16)( CppTypeFor x) { return Floor>(x); } #endif #endif CppTypeFor RTNAME(Fraction4)( CppTypeFor x) { return Fraction(x); } CppTypeFor RTNAME(Fraction8)( CppTypeFor x) { return Fraction(x); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(Fraction10)( CppTypeFor x) { return Fraction(x); } #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(Fraction16)( CppTypeFor x) { return Fraction(x); } #endif bool RTNAME(IsFinite4)(CppTypeFor x) { return std::isfinite(x); } bool RTNAME(IsFinite8)(CppTypeFor x) { return std::isfinite(x); } #if LDBL_MANT_DIG == 64 bool RTNAME(IsFinite10)(CppTypeFor x) { return std::isfinite(x); } #elif LDBL_MANT_DIG == 113 bool RTNAME(IsFinite16)(CppTypeFor x) { return std::isfinite(x); } #endif bool RTNAME(IsNaN4)(CppTypeFor x) { return std::isnan(x); } bool RTNAME(IsNaN8)(CppTypeFor x) { return std::isnan(x); } #if LDBL_MANT_DIG == 64 bool RTNAME(IsNaN10)(CppTypeFor x) { return std::isnan(x); } #elif LDBL_MANT_DIG == 113 bool RTNAME(IsNaN16)(CppTypeFor x) { return std::isnan(x); } #endif CppTypeFor RTNAME(ModInteger1)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return IntMod(x, p, sourceFile, sourceLine); } CppTypeFor RTNAME(ModInteger2)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return IntMod(x, p, sourceFile, sourceLine); } CppTypeFor RTNAME(ModInteger4)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return IntMod(x, p, sourceFile, sourceLine); } CppTypeFor RTNAME(ModInteger8)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return IntMod(x, p, sourceFile, sourceLine); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(ModInteger16)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return IntMod(x, p, sourceFile, sourceLine); } #endif CppTypeFor RTNAME(ModReal4)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return RealMod(x, p, sourceFile, sourceLine); } CppTypeFor RTNAME(ModReal8)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return RealMod(x, p, sourceFile, sourceLine); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(ModReal10)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return RealMod(x, p, sourceFile, sourceLine); } #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(ModReal16)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return RealMod(x, p, sourceFile, sourceLine); } #endif CppTypeFor RTNAME(ModuloInteger1)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return IntMod(x, p, sourceFile, sourceLine); } CppTypeFor RTNAME(ModuloInteger2)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return IntMod(x, p, sourceFile, sourceLine); } CppTypeFor RTNAME(ModuloInteger4)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return IntMod(x, p, sourceFile, sourceLine); } CppTypeFor RTNAME(ModuloInteger8)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return IntMod(x, p, sourceFile, sourceLine); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(ModuloInteger16)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return IntMod(x, p, sourceFile, sourceLine); } #endif CppTypeFor RTNAME(ModuloReal4)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return RealMod(x, p, sourceFile, sourceLine); } CppTypeFor RTNAME(ModuloReal8)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return RealMod(x, p, sourceFile, sourceLine); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(ModuloReal10)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return RealMod(x, p, sourceFile, sourceLine); } #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(ModuloReal16)( CppTypeFor x, CppTypeFor p, const char *sourceFile, int sourceLine) { return RealMod(x, p, sourceFile, sourceLine); } #endif CppTypeFor RTNAME(Nearest4)( CppTypeFor x, bool positive) { return Nearest<24>(x, positive); } CppTypeFor RTNAME(Nearest8)( CppTypeFor x, bool positive) { return Nearest<53>(x, positive); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(Nearest10)( CppTypeFor x, bool positive) { return Nearest<64>(x, positive); } #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(Nearest16)( CppTypeFor x, bool positive) { return Nearest<113>(x, positive); } #endif CppTypeFor RTNAME(Nint4_1)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint4_2)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint4_4)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint4_8)( CppTypeFor x) { return Nint>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Nint4_16)( CppTypeFor x) { return Nint>(x); } #endif CppTypeFor RTNAME(Nint8_1)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint8_2)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint8_4)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint8_8)( CppTypeFor x) { return Nint>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Nint8_16)( CppTypeFor x) { return Nint>(x); } #endif #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(Nint10_1)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint10_2)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint10_4)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint10_8)( CppTypeFor x) { return Nint>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Nint10_16)( CppTypeFor x) { return Nint>(x); } #endif #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(Nint16_1)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint16_2)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint16_4)( CppTypeFor x) { return Nint>(x); } CppTypeFor RTNAME(Nint16_8)( CppTypeFor x) { return Nint>(x); } #ifdef __SIZEOF_INT128__ CppTypeFor RTNAME(Nint16_16)( CppTypeFor x) { return Nint>(x); } #endif #endif CppTypeFor RTNAME(RRSpacing4)( CppTypeFor x) { return RRSpacing<24>(x); } CppTypeFor RTNAME(RRSpacing8)( CppTypeFor x) { return RRSpacing<53>(x); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(RRSpacing10)( CppTypeFor x) { return RRSpacing<64>(x); } #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(RRSpacing16)( CppTypeFor x) { return RRSpacing<113>(x); } #endif CppTypeFor RTNAME(SetExponent4)( CppTypeFor x, std::int64_t p) { return SetExponent(x, p); } CppTypeFor RTNAME(SetExponent8)( CppTypeFor x, std::int64_t p) { return SetExponent(x, p); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(SetExponent10)( CppTypeFor x, std::int64_t p) { return SetExponent(x, p); } #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(SetExponent16)( CppTypeFor x, std::int64_t p) { return SetExponent(x, p); } #endif CppTypeFor RTNAME(Scale4)( CppTypeFor x, std::int64_t p) { return Scale(x, p); } CppTypeFor RTNAME(Scale8)( CppTypeFor x, std::int64_t p) { return Scale(x, p); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(Scale10)( CppTypeFor x, std::int64_t p) { return Scale(x, p); } #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(Scale16)( CppTypeFor x, std::int64_t p) { return Scale(x, p); } #endif // SELECTED_INT_KIND CppTypeFor RTNAME(SelectedIntKind)( const char *source, int line, void *x, int xKind) { #ifdef __SIZEOF_INT128__ CppTypeFor r = getIntArgValue>( source, line, x, xKind, /*defaultValue*/ 0, /*resKind*/ 16); #else std::int64_t r = getIntArgValue( source, line, x, xKind, /*defaultValue*/ 0, /*resKind*/ 8); #endif return SelectedIntKind(r); } // SELECTED_REAL_KIND CppTypeFor RTNAME(SelectedRealKind)( const char *source, int line, void *precision, int pKind, void *range, int rKind, void *radix, int dKind) { #ifdef __SIZEOF_INT128__ CppTypeFor p = getIntArgValue>( source, line, precision, pKind, /*defaultValue*/ 0, /*resKind*/ 16); CppTypeFor r = getIntArgValue>( source, line, range, rKind, /*defaultValue*/ 0, /*resKind*/ 16); CppTypeFor d = getIntArgValue>( source, line, radix, dKind, /*defaultValue*/ 2, /*resKind*/ 16); #else std::int64_t p = getIntArgValue( source, line, precision, pKind, /*defaultValue*/ 0, /*resKind*/ 8); std::int64_t r = getIntArgValue( source, line, range, rKind, /*defaultValue*/ 0, /*resKind*/ 8); std::int64_t d = getIntArgValue( source, line, radix, dKind, /*defaultValue*/ 2, /*resKind*/ 8); #endif return SelectedRealKind(p, r, d); } CppTypeFor RTNAME(Spacing4)( CppTypeFor x) { return Spacing<24>(x); } CppTypeFor RTNAME(Spacing8)( CppTypeFor x) { return Spacing<53>(x); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(Spacing10)( CppTypeFor x) { return Spacing<64>(x); } #elif LDBL_MANT_DIG == 113 CppTypeFor RTNAME(Spacing16)( CppTypeFor x) { return Spacing<113>(x); } #endif CppTypeFor RTNAME(FPow4i)( CppTypeFor b, CppTypeFor e) { return FPowI(b, e); } CppTypeFor RTNAME(FPow8i)( CppTypeFor b, CppTypeFor e) { return FPowI(b, e); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(FPow10i)( CppTypeFor b, CppTypeFor e) { return FPowI(b, e); } #endif #if LDBL_MANT_DIG == 113 || HAS_FLOAT128 CppTypeFor RTNAME(FPow16i)( CppTypeFor b, CppTypeFor e) { return FPowI(b, e); } #endif CppTypeFor RTNAME(FPow4k)( CppTypeFor b, CppTypeFor e) { return FPowI(b, e); } CppTypeFor RTNAME(FPow8k)( CppTypeFor b, CppTypeFor e) { return FPowI(b, e); } #if LDBL_MANT_DIG == 64 CppTypeFor RTNAME(FPow10k)( CppTypeFor b, CppTypeFor e) { return FPowI(b, e); } #endif #if LDBL_MANT_DIG == 113 || HAS_FLOAT128 CppTypeFor RTNAME(FPow16k)( CppTypeFor b, CppTypeFor e) { return FPowI(b, e); } #endif } // extern "C" } // namespace Fortran::runtime