Blame sysdeps/ia64/bits/floatn.h

Packit 6c4009
/* Macros to control TS 18661-3 glibc features on ia64.
Packit 6c4009
   Copyright (C) 2017-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _BITS_FLOATN_H
Packit 6c4009
#define _BITS_FLOATN_H
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
/* Defined to 1 if the current compiler invocation provides a
Packit 6c4009
   floating-point type with the IEEE 754 binary128 format, and this
Packit 6c4009
   glibc includes corresponding *f128 interfaces for it.  The required
Packit 6c4009
   libgcc support was added some time after the basic compiler
Packit 6c4009
   support.  */
Packit 6c4009
#if __GNUC_PREREQ (4, 4)
Packit 6c4009
# define __HAVE_FLOAT128 1
Packit 6c4009
#else
Packit 6c4009
# define __HAVE_FLOAT128 0
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
Packit 6c4009
   from the default float, double and long double types in this glibc.  */
Packit 6c4009
#if __HAVE_FLOAT128
Packit 6c4009
# define __HAVE_DISTINCT_FLOAT128 1
Packit 6c4009
#else
Packit 6c4009
# define __HAVE_DISTINCT_FLOAT128 0
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Defined to 1 if the current compiler invocation provides a
Packit 6c4009
   floating-point type with the right format for _Float64x, and this
Packit 6c4009
   glibc includes corresponding *f64x interfaces for it.  */
Packit 6c4009
#define __HAVE_FLOAT64X 1
Packit 6c4009
Packit 6c4009
/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
Packit 6c4009
   of long double.  Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
Packit 6c4009
   the format of _Float128, which must be different from that of long
Packit 6c4009
   double.  */
Packit 6c4009
#define __HAVE_FLOAT64X_LONG_DOUBLE 1
Packit 6c4009
Packit 6c4009
#ifndef __ASSEMBLER__
Packit 6c4009
Packit 6c4009
/* Defined to concatenate the literal suffix to be used with _Float128
Packit 6c4009
   types, if __HAVE_FLOAT128 is 1. */
Packit 6c4009
# if __HAVE_FLOAT128
Packit 6c4009
#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
Packit 6c4009
/* The literal suffix f128 exists only since GCC 7.0.  */
Packit 6c4009
#   define __f128(x) x##q
Packit 6c4009
#  else
Packit 6c4009
#   define __f128(x) x##f128
Packit 6c4009
#  endif
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
Packit 6c4009
# if __HAVE_FLOAT128
Packit 6c4009
#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
Packit 6c4009
/* Add a typedef for older GCC compilers which don't natively support
Packit 6c4009
   _Complex _Float128.  */
Packit 6c4009
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
Packit 6c4009
#   define __CFLOAT128 __cfloat128
Packit 6c4009
#  else
Packit 6c4009
#   define __CFLOAT128 _Complex _Float128
Packit 6c4009
#  endif
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
/* The remaining of this file provides support for older compilers.  */
Packit 6c4009
# if __HAVE_FLOAT128
Packit 6c4009
Packit 6c4009
/* The type _Float128 exists only since GCC 7.0.  */
Packit 6c4009
#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
Packit 6c4009
typedef __float128 _Float128;
Packit 6c4009
#  endif
Packit 6c4009
Packit 6c4009
/* __builtin_huge_valf128 doesn't exist before GCC 7.0.  */
Packit 6c4009
#  if !__GNUC_PREREQ (7, 0)
Packit 6c4009
#   define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())
Packit 6c4009
#  endif
Packit 6c4009
Packit 6c4009
/* Older GCC has only a subset of built-in functions for _Float128 on
Packit 6c4009
   ia64, and __builtin_infq is not usable in static initializers.
Packit 6c4009
   Converting a narrower sNaN to _Float128 produces a quiet NaN, so
Packit 6c4009
   attempts to use _Float128 sNaNs will not work properly with older
Packit 6c4009
   compilers.  */
Packit 6c4009
#  if !__GNUC_PREREQ (7, 0)
Packit 6c4009
#   define __builtin_copysignf128 __builtin_copysignq
Packit 6c4009
#   define __builtin_fabsf128 __builtin_fabsq
Packit 6c4009
#   define __builtin_inff128() ((_Float128) __builtin_inf ())
Packit 6c4009
#   define __builtin_nanf128(x) ((_Float128) __builtin_nan (x))
Packit 6c4009
#   define __builtin_nansf128(x) ((_Float128) __builtin_nans (x))
Packit 6c4009
#  endif
Packit 6c4009
Packit 6c4009
/* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
Packit 6c4009
   e.g.: __builtin_signbitf128, before GCC 6.  However, there has never
Packit 6c4009
   been a __builtin_signbitf128 in GCC and the type-generic builtin is
Packit 6c4009
   only available since GCC 6.  */
Packit 6c4009
#  if !__GNUC_PREREQ (6, 0)
Packit 6c4009
#   define __builtin_signbitf128 __signbitf128
Packit 6c4009
#  endif
Packit 6c4009
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
#endif /* !__ASSEMBLER__.  */
Packit 6c4009
Packit 6c4009
#include <bits/floatn-common.h>
Packit 6c4009
Packit 6c4009
#endif /* _BITS_FLOATN_H */