summaryrefslogtreecommitdiff
path: root/sysdeps/ia64/bits
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 16:03:01 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 16:03:01 +0000
commit14970231a38310b9561052a67b617138eeaad300 (patch)
tree35c201a651afa5d5e4fff241280081b3f88b9c2c /sysdeps/ia64/bits
parentf08c7420b5e8b017a1a47b880a62b15bdc588f4d (diff)
parent25ead03a3712d57df2208fe82f3d316eb8faeaf6 (diff)
Merge commit 'refs/top-bases/t/extern_inline' into t/extern_inline
Diffstat (limited to 'sysdeps/ia64/bits')
-rw-r--r--sysdeps/ia64/bits/byteswap-16.h42
-rw-r--r--sysdeps/ia64/bits/byteswap.h100
-rw-r--r--sysdeps/ia64/bits/fenv.h10
-rw-r--r--sysdeps/ia64/bits/floatn.h119
-rw-r--r--sysdeps/ia64/bits/fp-logb.h (renamed from sysdeps/ia64/bits/mathdef.h)24
-rw-r--r--sysdeps/ia64/bits/huge_vall.h41
-rw-r--r--sysdeps/ia64/bits/link.h2
-rw-r--r--sysdeps/ia64/bits/xtitypes.h2
8 files changed, 136 insertions, 204 deletions
diff --git a/sysdeps/ia64/bits/byteswap-16.h b/sysdeps/ia64/bits/byteswap-16.h
deleted file mode 100644
index 9a2c46bd59..0000000000
--- a/sysdeps/ia64/bits/byteswap-16.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Macros to swap the order of bytes in 16-bit integer values.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _BITS_BYTESWAP_H
-# error "Never use <bits/byteswap-16.h> directly; include <byteswap.h> instead."
-#endif
-
-#if defined __GNUC__ && __GNUC__ >= 2
-# define __bswap_16(x) \
- (__extension__ \
- ({ unsigned short int __v, __x = (unsigned short int) (x); \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_16 (__x); \
- else \
- __asm__ __volatile__ ("shl %0 = %1, 48 ;;" \
- "mux1 %0 = %0, @rev ;;" \
- : "=r" (__v) \
- : "r" ((unsigned short int) (__x))); \
- __v; }))
-#else
-/* This is better than nothing. */
-static __inline unsigned short int
-__bswap_16 (unsigned short int __bsx)
-{
- return __bswap_constant_16 (__bsx);
-}
-#endif
diff --git a/sysdeps/ia64/bits/byteswap.h b/sysdeps/ia64/bits/byteswap.h
deleted file mode 100644
index 1dd488473f..0000000000
--- a/sysdeps/ia64/bits/byteswap.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Macros to swap the order of bytes in integer values.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
-# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
-#endif
-
-#ifndef _BITS_BYTESWAP_H
-#define _BITS_BYTESWAP_H 1
-
-/* Swap bytes in 16 bit value. */
-#define __bswap_constant_16(x) \
- ((unsigned short int)((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
-
-/* Get __bswap_16. */
-#include <bits/byteswap-16.h>
-
-/* Swap bytes in 32 bit value. */
-#define __bswap_constant_32(x) \
- ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
- (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
-
-#if defined __GNUC__ && __GNUC__ >= 2
-# define __bswap_32(x) \
- (__extension__ \
- ({ unsigned int __v, __x = (x); \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_32 (__x); \
- else \
- __asm__ __volatile__ ("shl %0 = %1, 32 ;;" \
- "mux1 %0 = %0, @rev ;;" \
- : "=r" (__v) \
- : "r" ((unsigned int) (__x))); \
- __v; }))
-#else
-static __inline unsigned int
-__bswap_32 (unsigned int __bsx)
-{
- return __bswap_constant_32 (__bsx);
-}
-#endif
-
-
-/* Swap bytes in 64 bit value. */
-#if defined __GNUC__ && __GNUC__ >= 2
-# define __bswap_constant_64(x) \
- (__extension__ ((((x) & 0xff00000000000000ul) >> 56) \
- | (((x) & 0x00ff000000000000ul) >> 40) \
- | (((x) & 0x0000ff0000000000ul) >> 24) \
- | (((x) & 0x000000ff00000000ul) >> 8) \
- | (((x) & 0x00000000ff000000ul) << 8) \
- | (((x) & 0x0000000000ff0000ul) << 24) \
- | (((x) & 0x000000000000ff00ul) << 40) \
- | (((x) & 0x00000000000000fful) << 56)))
-
-# define __bswap_64(x) \
- (__extension__ \
- ({ unsigned long int __v, __x = (x); \
- if (__builtin_constant_p (x)) \
- __v = __bswap_constant_64 (__x); \
- else \
- __asm__ __volatile__ ("mux1 %0 = %1, @rev ;;" \
- : "=r" (__v) \
- : "r" ((unsigned long int) (__x))); \
- __v; }))
-
-#else
-# define __bswap_constant_64(x) \
- ((((x) & 0xff00000000000000ul) >> 56) \
- | (((x) & 0x00ff000000000000ul) >> 40) \
- | (((x) & 0x0000ff0000000000ul) >> 24) \
- | (((x) & 0x000000ff00000000ul) >> 8) \
- | (((x) & 0x00000000ff000000ul) << 8) \
- | (((x) & 0x0000000000ff0000ul) << 24) \
- | (((x) & 0x000000000000ff00ul) << 40) \
- | (((x) & 0x00000000000000fful) << 56))
-
-static __inline unsigned long int
-__bswap_64 (unsigned long int __bsx)
-{
- return __bswap_constant_64 (__bsx);
-}
-#endif
-
-#endif /* _BITS_BYTESWAP_H */
diff --git a/sysdeps/ia64/bits/fenv.h b/sysdeps/ia64/bits/fenv.h
index 9bb20de27b..6e4f937981 100644
--- a/sysdeps/ia64/bits/fenv.h
+++ b/sysdeps/ia64/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -94,3 +94,11 @@ typedef unsigned long int fenv_t;
s0, s2, and s3. */
# define FE_NONIEEE_ENV ((const fenv_t *) 0xc009a04d0270037fUL)
#endif
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes. */
+typedef unsigned long int femode_t;
+
+/* Default floating-point control modes. */
+# define FE_DFL_MODE ((const femode_t *) 0xc009804c0270033fUL)
+#endif
diff --git a/sysdeps/ia64/bits/floatn.h b/sysdeps/ia64/bits/floatn.h
new file mode 100644
index 0000000000..633ee10d65
--- /dev/null
+++ b/sysdeps/ia64/bits/floatn.h
@@ -0,0 +1,119 @@
+/* Macros to control TS 18661-3 glibc features on ia64.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _BITS_FLOATN_H
+#define _BITS_FLOATN_H
+
+#include <features.h>
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the IEEE 754 binary128 format, and this
+ glibc includes corresponding *f128 interfaces for it. The required
+ libgcc support was added some time after the basic compiler
+ support. */
+#if __GNUC_PREREQ (4, 4)
+# define __HAVE_FLOAT128 1
+#else
+# define __HAVE_FLOAT128 0
+#endif
+
+/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
+ from the default float, double and long double types in this glibc. */
+#if __HAVE_FLOAT128
+# define __HAVE_DISTINCT_FLOAT128 1
+#else
+# define __HAVE_DISTINCT_FLOAT128 0
+#endif
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the right format for _Float64x, and this
+ glibc includes corresponding *f64x interfaces for it. */
+#define __HAVE_FLOAT64X 1
+
+/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
+ of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
+ the format of _Float128, which must be different from that of long
+ double. */
+#define __HAVE_FLOAT64X_LONG_DOUBLE 1
+
+#ifndef __ASSEMBLER__
+
+/* Defined to concatenate the literal suffix to be used with _Float128
+ types, if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* The literal suffix f128 exists only since GCC 7.0. */
+# define __f128(x) x##q
+# else
+# define __f128(x) x##f128
+# endif
+# endif
+
+/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* Add a typedef for older GCC compilers which don't natively support
+ _Complex _Float128. */
+typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
+# define __CFLOAT128 __cfloat128
+# else
+# define __CFLOAT128 _Complex _Float128
+# endif
+# endif
+
+/* The remaining of this file provides support for older compilers. */
+# if __HAVE_FLOAT128
+
+/* The type _Float128 exists only since GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+typedef __float128 _Float128;
+# endif
+
+/* __builtin_huge_valf128 doesn't exist before GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())
+# endif
+
+/* Older GCC has only a subset of built-in functions for _Float128 on
+ ia64, and __builtin_infq is not usable in static initializers.
+ Converting a narrower sNaN to _Float128 produces a quiet NaN, so
+ attempts to use _Float128 sNaNs will not work properly with older
+ compilers. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_copysignf128 __builtin_copysignq
+# define __builtin_fabsf128 __builtin_fabsq
+# define __builtin_inff128() ((_Float128) __builtin_inf ())
+# define __builtin_nanf128(x) ((_Float128) __builtin_nan (x))
+# define __builtin_nansf128(x) ((_Float128) __builtin_nans (x))
+# endif
+
+/* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
+ e.g.: __builtin_signbitf128, before GCC 6. However, there has never
+ been a __builtin_signbitf128 in GCC and the type-generic builtin is
+ only available since GCC 6. */
+# if !__GNUC_PREREQ (6, 0)
+# define __builtin_signbitf128 __signbitf128
+# endif
+
+# endif
+
+#endif /* !__ASSEMBLER__. */
+
+#include <bits/floatn-common.h>
+
+#endif /* _BITS_FLOATN_H */
diff --git a/sysdeps/ia64/bits/mathdef.h b/sysdeps/ia64/bits/fp-logb.h
index 5a31bd3db7..e4cda10f44 100644
--- a/sysdeps/ia64/bits/mathdef.h
+++ b/sysdeps/ia64/bits/fp-logb.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. IA64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,22 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#ifndef _MATH_H
+# error "Never use <bits/fp-logb.h> directly; include <math.h> instead."
#endif
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* The IA-64 architecture computes values with the precision of the
- used type. */
-typedef float float_t; /* `float' expressions are evaluated as
- `float'. */
-typedef double double_t; /* `double' expressions are evaluated as
- `double'. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647 - 1)
-# define FP_ILOGBNAN 2147483647
-
-#endif /* ISO C99 */
+#define __FP_LOGB0_IS_MIN 1
+#define __FP_LOGBNAN_IS_MIN 0
diff --git a/sysdeps/ia64/bits/huge_vall.h b/sysdeps/ia64/bits/huge_vall.h
deleted file mode 100644
index 24281792f8..0000000000
--- a/sysdeps/ia64/bits/huge_vall.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* `HUGE_VALL' constant for ia64 (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 2000-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _MATH_H
-# error "Never use <bits/huge_vall.h> directly; include <math.h> instead."
-#endif
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VALL (__builtin_huge_vall())
-#elif __GNUC_PREREQ(2,96)
-# define HUGE_VALL (__extension__ 0x1.0p32767L)
-#else
-
-# define __HUGE_VALL_bytes { 0,0,0,0,0,0,0, 0x80, 0xff, 0x7f, 0,0,0,0,0,0}
-
-# define __huge_vall_t union { unsigned char __c[16]; long double __ld; }
-# ifdef __GNUC__
-# define HUGE_VALL (__extension__ \
- ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld)
-# else /* Not GCC. */
-static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
-# define HUGE_VALL (__huge_vall.__ld)
-# endif /* GCC. */
-
-#endif /* GCC 2.95 */
diff --git a/sysdeps/ia64/bits/link.h b/sysdeps/ia64/bits/link.h
index b39db79dc2..abe558f350 100644
--- a/sysdeps/ia64/bits/link.h
+++ b/sysdeps/ia64/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ia64/bits/xtitypes.h b/sysdeps/ia64/bits/xtitypes.h
index 65141bbb82..60ba7aff54 100644
--- a/sysdeps/ia64/bits/xtitypes.h
+++ b/sysdeps/ia64/bits/xtitypes.h
@@ -1,5 +1,5 @@
/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>. IA64
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or