Skip to content

Commit 7148397

Browse files
committed
[flang] Added support for REAL16 math intrinsics in lowering and runtime.
This PR does not include support for COMPLEX(16) intrinsics. Note that (fp ** int) operations do not require Float128Math library, as they are implemented via basic F128 operations, which are supported by the build compilers' runtimes.
1 parent 7b66b5d commit 7148397

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1207
-0
lines changed

flang/lib/Optimizer/Builder/IntrinsicCall.cpp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,16 @@ mlir::Value genComplexMathOp(fir::FirOpBuilder &builder, mlir::Location loc,
916916
/// See https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gfortran/\
917917
/// Intrinsic-Procedures.html for a reference.
918918
constexpr auto FuncTypeReal16Real16 = genFuncType<Ty::Real<16>, Ty::Real<16>>;
919+
constexpr auto FuncTypeReal16Real16Real16 =
920+
genFuncType<Ty::Real<16>, Ty::Real<16>, Ty::Real<16>>;
921+
constexpr auto FuncTypeReal16Integer4Real16 =
922+
genFuncType<Ty::Real<16>, Ty::Integer<4>, Ty::Real<16>>;
923+
constexpr auto FuncTypeReal16Integer8Real16 =
924+
genFuncType<Ty::Real<16>, Ty::Integer<8>, Ty::Real<16>>;
925+
constexpr auto FuncTypeInteger4Real16 =
926+
genFuncType<Ty::Integer<4>, Ty::Real<16>>;
927+
constexpr auto FuncTypeInteger8Real16 =
928+
genFuncType<Ty::Integer<8>, Ty::Real<16>>;
919929
constexpr auto FuncTypeReal16Complex16 =
920930
genFuncType<Ty::Real<16>, Ty::Complex<16>>;
921931

@@ -933,10 +943,12 @@ static constexpr MathOperation mathOperations[] = {
933943
{"abs", RTNAME_STRING(CAbsF128), FuncTypeReal16Complex16, genLibF128Call},
934944
{"acos", "acosf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
935945
{"acos", "acos", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
946+
{"acos", RTNAME_STRING(AcosF128), FuncTypeReal16Real16, genLibF128Call},
936947
{"acos", "cacosf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>, genLibCall},
937948
{"acos", "cacos", genFuncType<Ty::Complex<8>, Ty::Complex<8>>, genLibCall},
938949
{"acosh", "acoshf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
939950
{"acosh", "acosh", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
951+
{"acosh", RTNAME_STRING(AcoshF128), FuncTypeReal16Real16, genLibF128Call},
940952
{"acosh", "cacoshf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>,
941953
genLibCall},
942954
{"acosh", "cacosh", genFuncType<Ty::Complex<8>, Ty::Complex<8>>,
@@ -948,19 +960,23 @@ static constexpr MathOperation mathOperations[] = {
948960
genLibCall},
949961
{"aint", "llvm.trunc.f80", genFuncType<Ty::Real<10>, Ty::Real<10>>,
950962
genLibCall},
963+
{"aint", RTNAME_STRING(TruncF128), FuncTypeReal16Real16, genLibF128Call},
951964
// llvm.round behaves the same way as libm's round.
952965
{"anint", "llvm.round.f32", genFuncType<Ty::Real<4>, Ty::Real<4>>,
953966
genMathOp<mlir::LLVM::RoundOp>},
954967
{"anint", "llvm.round.f64", genFuncType<Ty::Real<8>, Ty::Real<8>>,
955968
genMathOp<mlir::LLVM::RoundOp>},
956969
{"anint", "llvm.round.f80", genFuncType<Ty::Real<10>, Ty::Real<10>>,
957970
genMathOp<mlir::LLVM::RoundOp>},
971+
{"anint", RTNAME_STRING(RoundF128), FuncTypeReal16Real16, genLibF128Call},
958972
{"asin", "asinf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
959973
{"asin", "asin", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
974+
{"asin", RTNAME_STRING(AsinF128), FuncTypeReal16Real16, genLibF128Call},
960975
{"asin", "casinf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>, genLibCall},
961976
{"asin", "casin", genFuncType<Ty::Complex<8>, Ty::Complex<8>>, genLibCall},
962977
{"asinh", "asinhf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
963978
{"asinh", "asinh", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
979+
{"asinh", RTNAME_STRING(AsinhF128), FuncTypeReal16Real16, genLibF128Call},
964980
{"asinh", "casinhf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>,
965981
genLibCall},
966982
{"asinh", "casinh", genFuncType<Ty::Complex<8>, Ty::Complex<8>>,
@@ -969,49 +985,64 @@ static constexpr MathOperation mathOperations[] = {
969985
genMathOp<mlir::math::AtanOp>},
970986
{"atan", "atan", genFuncType<Ty::Real<8>, Ty::Real<8>>,
971987
genMathOp<mlir::math::AtanOp>},
988+
{"atan", RTNAME_STRING(AtanF128), FuncTypeReal16Real16, genLibF128Call},
972989
{"atan", "catanf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>, genLibCall},
973990
{"atan", "catan", genFuncType<Ty::Complex<8>, Ty::Complex<8>>, genLibCall},
974991
{"atan2", "atan2f", genFuncType<Ty::Real<4>, Ty::Real<4>, Ty::Real<4>>,
975992
genMathOp<mlir::math::Atan2Op>},
976993
{"atan2", "atan2", genFuncType<Ty::Real<8>, Ty::Real<8>, Ty::Real<8>>,
977994
genMathOp<mlir::math::Atan2Op>},
995+
{"atan2", RTNAME_STRING(Atan2F128), FuncTypeReal16Real16Real16,
996+
genLibF128Call},
978997
{"atanh", "atanhf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
979998
{"atanh", "atanh", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
999+
{"atanh", RTNAME_STRING(AtanhF128), FuncTypeReal16Real16, genLibF128Call},
9801000
{"atanh", "catanhf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>,
9811001
genLibCall},
9821002
{"atanh", "catanh", genFuncType<Ty::Complex<8>, Ty::Complex<8>>,
9831003
genLibCall},
9841004
{"bessel_j0", "j0f", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
9851005
{"bessel_j0", "j0", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
1006+
{"bessel_j0", RTNAME_STRING(J0F128), FuncTypeReal16Real16, genLibF128Call},
9861007
{"bessel_j1", "j1f", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
9871008
{"bessel_j1", "j1", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
1009+
{"bessel_j1", RTNAME_STRING(J1F128), FuncTypeReal16Real16, genLibF128Call},
9881010
{"bessel_jn", "jnf", genFuncType<Ty::Real<4>, Ty::Integer<4>, Ty::Real<4>>,
9891011
genLibCall},
9901012
{"bessel_jn", "jn", genFuncType<Ty::Real<8>, Ty::Integer<4>, Ty::Real<8>>,
9911013
genLibCall},
1014+
{"bessel_jn", RTNAME_STRING(JnF128), FuncTypeReal16Integer4Real16,
1015+
genLibF128Call},
9921016
{"bessel_y0", "y0f", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
9931017
{"bessel_y0", "y0", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
1018+
{"bessel_y0", RTNAME_STRING(Y0F128), FuncTypeReal16Real16, genLibF128Call},
9941019
{"bessel_y1", "y1f", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
9951020
{"bessel_y1", "y1", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
1021+
{"bessel_y1", RTNAME_STRING(Y1F128), FuncTypeReal16Real16, genLibF128Call},
9961022
{"bessel_yn", "ynf", genFuncType<Ty::Real<4>, Ty::Integer<4>, Ty::Real<4>>,
9971023
genLibCall},
9981024
{"bessel_yn", "yn", genFuncType<Ty::Real<8>, Ty::Integer<4>, Ty::Real<8>>,
9991025
genLibCall},
1026+
{"bessel_yn", RTNAME_STRING(YnF128), FuncTypeReal16Integer4Real16,
1027+
genLibF128Call},
10001028
// math::CeilOp returns a real, while Fortran CEILING returns integer.
10011029
{"ceil", "ceilf", genFuncType<Ty::Real<4>, Ty::Real<4>>,
10021030
genMathOp<mlir::math::CeilOp>},
10031031
{"ceil", "ceil", genFuncType<Ty::Real<8>, Ty::Real<8>>,
10041032
genMathOp<mlir::math::CeilOp>},
1033+
{"ceil", RTNAME_STRING(CeilF128), FuncTypeReal16Real16, genLibF128Call},
10051034
{"cos", "cosf", genFuncType<Ty::Real<4>, Ty::Real<4>>,
10061035
genMathOp<mlir::math::CosOp>},
10071036
{"cos", "cos", genFuncType<Ty::Real<8>, Ty::Real<8>>,
10081037
genMathOp<mlir::math::CosOp>},
1038+
{"cos", RTNAME_STRING(CosF128), FuncTypeReal16Real16, genLibF128Call},
10091039
{"cos", "ccosf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>,
10101040
genComplexMathOp<mlir::complex::CosOp>},
10111041
{"cos", "ccos", genFuncType<Ty::Complex<8>, Ty::Complex<8>>,
10121042
genComplexMathOp<mlir::complex::CosOp>},
10131043
{"cosh", "coshf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
10141044
{"cosh", "cosh", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
1045+
{"cosh", RTNAME_STRING(CoshF128), FuncTypeReal16Real16, genLibF128Call},
10151046
{"cosh", "ccoshf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>, genLibCall},
10161047
{"cosh", "ccosh", genFuncType<Ty::Complex<8>, Ty::Complex<8>>, genLibCall},
10171048
{"divc",
@@ -1038,12 +1069,15 @@ static constexpr MathOperation mathOperations[] = {
10381069
genMathOp<mlir::math::ErfOp>},
10391070
{"erf", "erf", genFuncType<Ty::Real<8>, Ty::Real<8>>,
10401071
genMathOp<mlir::math::ErfOp>},
1072+
{"erf", RTNAME_STRING(ErfF128), FuncTypeReal16Real16, genLibF128Call},
10411073
{"erfc", "erfcf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
10421074
{"erfc", "erfc", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
1075+
{"erfc", RTNAME_STRING(ErfcF128), FuncTypeReal16Real16, genLibF128Call},
10431076
{"exp", "expf", genFuncType<Ty::Real<4>, Ty::Real<4>>,
10441077
genMathOp<mlir::math::ExpOp>},
10451078
{"exp", "exp", genFuncType<Ty::Real<8>, Ty::Real<8>>,
10461079
genMathOp<mlir::math::ExpOp>},
1080+
{"exp", RTNAME_STRING(ExpF128), FuncTypeReal16Real16, genLibF128Call},
10471081
{"exp", "cexpf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>,
10481082
genComplexMathOp<mlir::complex::ExpOp>},
10491083
{"exp", "cexp", genFuncType<Ty::Complex<8>, Ty::Complex<8>>,
@@ -1074,6 +1108,7 @@ static constexpr MathOperation mathOperations[] = {
10741108
genMathOp<mlir::math::FloorOp>},
10751109
{"floor", "floor", genFuncType<Ty::Real<8>, Ty::Real<8>>,
10761110
genMathOp<mlir::math::FloorOp>},
1111+
{"floor", RTNAME_STRING(FloorF128), FuncTypeReal16Real16, genLibF128Call},
10771112
{"fma", "llvm.fma.f32",
10781113
genFuncType<Ty::Real<4>, Ty::Real<4>, Ty::Real<4>, Ty::Real<4>>,
10791114
genMathOp<mlir::math::FmaOp>},
@@ -1082,14 +1117,18 @@ static constexpr MathOperation mathOperations[] = {
10821117
genMathOp<mlir::math::FmaOp>},
10831118
{"gamma", "tgammaf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
10841119
{"gamma", "tgamma", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
1120+
{"gamma", RTNAME_STRING(TgammaF128), FuncTypeReal16Real16, genLibF128Call},
10851121
{"hypot", "hypotf", genFuncType<Ty::Real<4>, Ty::Real<4>, Ty::Real<4>>,
10861122
genLibCall},
10871123
{"hypot", "hypot", genFuncType<Ty::Real<8>, Ty::Real<8>, Ty::Real<8>>,
10881124
genLibCall},
1125+
{"hypot", RTNAME_STRING(HypotF128), FuncTypeReal16Real16Real16,
1126+
genLibF128Call},
10891127
{"log", "logf", genFuncType<Ty::Real<4>, Ty::Real<4>>,
10901128
genMathOp<mlir::math::LogOp>},
10911129
{"log", "log", genFuncType<Ty::Real<8>, Ty::Real<8>>,
10921130
genMathOp<mlir::math::LogOp>},
1131+
{"log", RTNAME_STRING(LogF128), FuncTypeReal16Real16, genLibF128Call},
10931132
{"log", "clogf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>,
10941133
genComplexMathOp<mlir::complex::LogOp>},
10951134
{"log", "clog", genFuncType<Ty::Complex<8>, Ty::Complex<8>>,
@@ -1098,17 +1137,23 @@ static constexpr MathOperation mathOperations[] = {
10981137
genMathOp<mlir::math::Log10Op>},
10991138
{"log10", "log10", genFuncType<Ty::Real<8>, Ty::Real<8>>,
11001139
genMathOp<mlir::math::Log10Op>},
1140+
{"log10", RTNAME_STRING(Log10F128), FuncTypeReal16Real16, genLibF128Call},
11011141
{"log_gamma", "lgammaf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
11021142
{"log_gamma", "lgamma", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
1143+
{"log_gamma", RTNAME_STRING(LgammaF128), FuncTypeReal16Real16,
1144+
genLibF128Call},
11031145
// llvm.lround behaves the same way as libm's lround.
11041146
{"nint", "llvm.lround.i64.f64", genFuncType<Ty::Integer<8>, Ty::Real<8>>,
11051147
genLibCall},
11061148
{"nint", "llvm.lround.i64.f32", genFuncType<Ty::Integer<8>, Ty::Real<4>>,
11071149
genLibCall},
1150+
{"nint", RTNAME_STRING(LlroundF128), FuncTypeInteger8Real16,
1151+
genLibF128Call},
11081152
{"nint", "llvm.lround.i32.f64", genFuncType<Ty::Integer<4>, Ty::Real<8>>,
11091153
genLibCall},
11101154
{"nint", "llvm.lround.i32.f32", genFuncType<Ty::Integer<4>, Ty::Real<4>>,
11111155
genLibCall},
1156+
{"nint", RTNAME_STRING(LroundF128), FuncTypeInteger4Real16, genLibF128Call},
11121157
{"pow",
11131158
{},
11141159
genFuncType<Ty::Integer<1>, Ty::Integer<1>, Ty::Integer<1>>,
@@ -1129,6 +1174,7 @@ static constexpr MathOperation mathOperations[] = {
11291174
genMathOp<mlir::math::PowFOp>},
11301175
{"pow", "pow", genFuncType<Ty::Real<8>, Ty::Real<8>, Ty::Real<8>>,
11311176
genMathOp<mlir::math::PowFOp>},
1177+
{"pow", RTNAME_STRING(PowF128), FuncTypeReal16Real16Real16, genLibF128Call},
11321178
{"pow", "cpowf",
11331179
genFuncType<Ty::Complex<4>, Ty::Complex<4>, Ty::Complex<4>>,
11341180
genComplexMathOp<mlir::complex::PowOp>},
@@ -1140,12 +1186,18 @@ static constexpr MathOperation mathOperations[] = {
11401186
{"pow", RTNAME_STRING(FPow8i),
11411187
genFuncType<Ty::Real<8>, Ty::Real<8>, Ty::Integer<4>>,
11421188
genMathOp<mlir::math::FPowIOp>},
1189+
{"pow", RTNAME_STRING(FPow16i),
1190+
genFuncType<Ty::Real<16>, Ty::Real<16>, Ty::Integer<4>>,
1191+
genMathOp<mlir::math::FPowIOp>},
11431192
{"pow", RTNAME_STRING(FPow4k),
11441193
genFuncType<Ty::Real<4>, Ty::Real<4>, Ty::Integer<8>>,
11451194
genMathOp<mlir::math::FPowIOp>},
11461195
{"pow", RTNAME_STRING(FPow8k),
11471196
genFuncType<Ty::Real<8>, Ty::Real<8>, Ty::Integer<8>>,
11481197
genMathOp<mlir::math::FPowIOp>},
1198+
{"pow", RTNAME_STRING(FPow16k),
1199+
genFuncType<Ty::Real<16>, Ty::Real<16>, Ty::Integer<8>>,
1200+
genMathOp<mlir::math::FPowIOp>},
11491201
{"pow", RTNAME_STRING(cpowi),
11501202
genFuncType<Ty::Complex<4>, Ty::Complex<4>, Ty::Integer<4>>, genLibCall},
11511203
{"pow", RTNAME_STRING(zpowi),
@@ -1174,6 +1226,7 @@ static constexpr MathOperation mathOperations[] = {
11741226
genComplexMathOp<mlir::complex::SinOp>},
11751227
{"sinh", "sinhf", genFuncType<Ty::Real<4>, Ty::Real<4>>, genLibCall},
11761228
{"sinh", "sinh", genFuncType<Ty::Real<8>, Ty::Real<8>>, genLibCall},
1229+
{"sinh", RTNAME_STRING(SinhF128), FuncTypeReal16Real16, genLibF128Call},
11771230
{"sinh", "csinhf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>, genLibCall},
11781231
{"sinh", "csinh", genFuncType<Ty::Complex<8>, Ty::Complex<8>>, genLibCall},
11791232
{"sqrt", "sqrtf", genFuncType<Ty::Real<4>, Ty::Real<4>>,
@@ -1189,6 +1242,7 @@ static constexpr MathOperation mathOperations[] = {
11891242
genMathOp<mlir::math::TanOp>},
11901243
{"tan", "tan", genFuncType<Ty::Real<8>, Ty::Real<8>>,
11911244
genMathOp<mlir::math::TanOp>},
1245+
{"tan", RTNAME_STRING(TanF128), FuncTypeReal16Real16, genLibF128Call},
11921246
{"tan", "ctanf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>,
11931247
genComplexMathOp<mlir::complex::TanOp>},
11941248
{"tan", "ctan", genFuncType<Ty::Complex<8>, Ty::Complex<8>>,
@@ -1197,6 +1251,7 @@ static constexpr MathOperation mathOperations[] = {
11971251
genMathOp<mlir::math::TanhOp>},
11981252
{"tanh", "tanh", genFuncType<Ty::Real<8>, Ty::Real<8>>,
11991253
genMathOp<mlir::math::TanhOp>},
1254+
{"tanh", RTNAME_STRING(TanhF128), FuncTypeReal16Real16, genLibF128Call},
12001255
{"tanh", "ctanhf", genFuncType<Ty::Complex<4>, Ty::Complex<4>>,
12011256
genComplexMathOp<mlir::complex::TanhOp>},
12021257
{"tanh", "ctanh", genFuncType<Ty::Complex<8>, Ty::Complex<8>>,

flang/runtime/Float128Math/CMakeLists.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,42 @@ else()
3333
endif()
3434

3535
set(sources
36+
acos.cpp
37+
acosh.cpp
38+
asin.cpp
39+
asinh.cpp
40+
atan.cpp
41+
atan2.cpp
42+
atanh.cpp
3643
cabs.cpp
44+
ceil.cpp
45+
cos.cpp
46+
cosh.cpp
47+
erf.cpp
48+
erfc.cpp
49+
exp.cpp
50+
floor.cpp
51+
hypot.cpp
52+
j0.cpp
53+
j1.cpp
54+
jn.cpp
55+
lgamma.cpp
56+
llround.cpp
57+
log.cpp
58+
log10.cpp
59+
lround.cpp
60+
pow.cpp
61+
round.cpp
3762
sin.cpp
63+
sinh.cpp
3864
sqrt.cpp
65+
tan.cpp
66+
tanh.cpp
67+
tgamma.cpp
68+
trunc.cpp
69+
y0.cpp
70+
y1.cpp
71+
yn.cpp
3972
)
4073

4174
include_directories(AFTER "${CMAKE_CURRENT_SOURCE_DIR}/..")

flang/runtime/Float128Math/acos.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- runtime/Float128Math/acos.cpp -------------------------------------===//
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+
#include "math-entries.h"
10+
11+
namespace Fortran::runtime {
12+
extern "C" {
13+
14+
#if LDBL_MANT_DIG == 113 || HAS_FLOAT128
15+
CppTypeFor<TypeCategory::Real, 16> RTDEF(AcosF128)(
16+
CppTypeFor<TypeCategory::Real, 16> x) {
17+
return Acos<RTNAME(AcosF128)>::invoke(x);
18+
}
19+
#endif
20+
21+
} // extern "C"
22+
} // namespace Fortran::runtime

flang/runtime/Float128Math/acosh.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- runtime/Float128Math/acosh.cpp ------------------------------------===//
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+
#include "math-entries.h"
10+
11+
namespace Fortran::runtime {
12+
extern "C" {
13+
14+
#if LDBL_MANT_DIG == 113 || HAS_FLOAT128
15+
CppTypeFor<TypeCategory::Real, 16> RTDEF(AcoshF128)(
16+
CppTypeFor<TypeCategory::Real, 16> x) {
17+
return Acosh<RTNAME(AcoshF128)>::invoke(x);
18+
}
19+
#endif
20+
21+
} // extern "C"
22+
} // namespace Fortran::runtime

flang/runtime/Float128Math/asin.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- runtime/Float128Math/asin.cpp -------------------------------------===//
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+
#include "math-entries.h"
10+
11+
namespace Fortran::runtime {
12+
extern "C" {
13+
14+
#if LDBL_MANT_DIG == 113 || HAS_FLOAT128
15+
CppTypeFor<TypeCategory::Real, 16> RTDEF(AsinF128)(
16+
CppTypeFor<TypeCategory::Real, 16> x) {
17+
return Asin<RTNAME(AsinF128)>::invoke(x);
18+
}
19+
#endif
20+
21+
} // extern "C"
22+
} // namespace Fortran::runtime

flang/runtime/Float128Math/asinh.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- runtime/Float128Math/asinh.cpp ------------------------------------===//
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+
#include "math-entries.h"
10+
11+
namespace Fortran::runtime {
12+
extern "C" {
13+
14+
#if LDBL_MANT_DIG == 113 || HAS_FLOAT128
15+
CppTypeFor<TypeCategory::Real, 16> RTDEF(AsinhF128)(
16+
CppTypeFor<TypeCategory::Real, 16> x) {
17+
return Asinh<RTNAME(AsinhF128)>::invoke(x);
18+
}
19+
#endif
20+
21+
} // extern "C"
22+
} // namespace Fortran::runtime

flang/runtime/Float128Math/atan.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- runtime/Float128Math/atan.cpp -------------------------------------===//
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+
#include "math-entries.h"
10+
11+
namespace Fortran::runtime {
12+
extern "C" {
13+
14+
#if LDBL_MANT_DIG == 113 || HAS_FLOAT128
15+
CppTypeFor<TypeCategory::Real, 16> RTDEF(AtanF128)(
16+
CppTypeFor<TypeCategory::Real, 16> x) {
17+
return Atan<RTNAME(AtanF128)>::invoke(x);
18+
}
19+
#endif
20+
21+
} // extern "C"
22+
} // namespace Fortran::runtime

0 commit comments

Comments
 (0)