kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

int_math.h (1202B)


      1 //===-- int_math.h - internal math inlines --------------------------------===//
      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 // kit-tailored: assumes a GCC/clang-compatible compiler with the standard
      8 // __builtin_* family. MSVC paths and GCC <7 fallbacks have been dropped.
      9 //===----------------------------------------------------------------------===//
     10 
     11 #ifndef INT_MATH_H
     12 #define INT_MATH_H
     13 
     14 #define CRT_INFINITY __builtin_huge_valf()
     15 
     16 #define crt_isfinite(x) __builtin_isfinite((x))
     17 #define crt_isinf(x) __builtin_isinf((x))
     18 #define crt_isnan(x) __builtin_isnan((x))
     19 
     20 #define crt_copysign(x, y) __builtin_copysign((x), (y))
     21 #define crt_copysignf(x, y) __builtin_copysignf((x), (y))
     22 #define crt_copysignl(x, y) __builtin_copysignl((x), (y))
     23 
     24 #define crt_fabs(x) __builtin_fabs((x))
     25 #define crt_fabsf(x) __builtin_fabsf((x))
     26 #define crt_fabsl(x) __builtin_fabsl((x))
     27 
     28 #define crt_fmaxl(x, y) __builtin_fmaxl((x), (y))
     29 #define crt_logbl(x) __builtin_logbl((x))
     30 #define crt_scalbnl(x, y) __builtin_scalbnl((x), (y))
     31 
     32 #endif  // INT_MATH_H