1 | //===-- runtime/Float128Math/numeric-template-specs.h -----------*- 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 | #ifndef FORTRAN_RUNTIME_FLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_ |
10 | #define FORTRAN_RUNTIME_FLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_ |
11 | |
12 | #include "math-entries.h" |
13 | #include "numeric-templates.h" |
14 | |
15 | namespace Fortran::runtime { |
16 | using F128Type = CppTypeFor<TypeCategory::Real, 16>; |
17 | |
18 | template <> struct ABSTy<F128Type> { |
19 | static F128Type compute(F128Type x) { return Abs<true>::invoke(x); } |
20 | }; |
21 | |
22 | template <> struct FREXPTy<F128Type> { |
23 | static F128Type compute(F128Type x, int *e) { |
24 | return Frexp<true>::invoke(x, e); |
25 | } |
26 | }; |
27 | |
28 | template <> struct ILOGBTy<F128Type> { |
29 | static int compute(F128Type x) { return Ilogb<true>::invoke(x); } |
30 | }; |
31 | |
32 | template <> struct ISINFTy<F128Type> { |
33 | static bool compute(F128Type x) { return Isinf<true>::invoke(x); } |
34 | }; |
35 | |
36 | template <> struct ISNANTy<F128Type> { |
37 | static bool compute(F128Type x) { return Isnan<true>::invoke(x); } |
38 | }; |
39 | |
40 | template <> struct LDEXPTy<F128Type> { |
41 | template <typename ET> static F128Type compute(F128Type x, ET p) { |
42 | return Ldexp<true>::invoke(x, p); |
43 | } |
44 | }; |
45 | |
46 | template <> struct QNANTy<F128Type> { |
47 | static F128Type compute() { return F128_RT_QNAN; } |
48 | }; |
49 | |
50 | template <> struct SQRTTy<F128Type> { |
51 | static F128Type compute(F128Type x) { return Sqrt<true>::invoke(x); } |
52 | }; |
53 | |
54 | } // namespace Fortran::runtime |
55 | #endif // FORTRAN_RUNTIME_FLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_ |
56 | |