brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · e215ad7 Raw
56 lines · c
1//===-- lib/quadmath/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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef FLANG_RT_QUADMATH_NUMERIC_TEMPLATE_SPECS_H_10#define FLANG_RT_QUADMATH_NUMERIC_TEMPLATE_SPECS_H_11 12#include "math-entries.h"13#include "flang-rt/runtime/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::runtime55#endif // FLANG_RT_QUADMATH_NUMERIC_TEMPLATE_SPECS_H_56