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
15namespace Fortran::runtime {
16using F128Type = CppTypeFor<TypeCategory::Real, 16>;
17
18template <> struct ABSTy<F128Type> {
19 static F128Type compute(F128Type x) { return Abs<true>::invoke(x); }
20};
21
22template <> struct FREXPTy<F128Type> {
23 static F128Type compute(F128Type x, int *e) {
24 return Frexp<true>::invoke(x, e);
25 }
26};
27
28template <> struct ILOGBTy<F128Type> {
29 static int compute(F128Type x) { return Ilogb<true>::invoke(x); }
30};
31
32template <> struct ISINFTy<F128Type> {
33 static bool compute(F128Type x) { return Isinf<true>::invoke(x); }
34};
35
36template <> struct ISNANTy<F128Type> {
37 static bool compute(F128Type x) { return Isnan<true>::invoke(x); }
38};
39
40template <> struct LDEXPTy<F128Type> {
41 template <typename ET> static F128Type compute(F128Type x, ET p) {
42 return Ldexp<true>::invoke(x, p);
43 }
44};
45
46template <> struct QNANTy<F128Type> {
47 static F128Type compute() { return F128_RT_QNAN; }
48};
49
50template <> 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

source code of flang/runtime/Float128Math/numeric-template-specs.h