]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Refactor long double information into bits/long-double.h.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 14 Dec 2016 18:27:56 +0000 (18:27 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 14 Dec 2016 18:27:56 +0000 (18:27 +0000)
Information about whether the ABI of long double is the same as that
of double is split between bits/mathdef.h and bits/wordsize.h.

When the ABIs are the same, bits/mathdef.h defines
__NO_LONG_DOUBLE_MATH.  In addition, in the case where the same glibc
binary supports both -mlong-double-64 and -mlong-double-128,
bits/wordsize.h defines __LONG_DOUBLE_MATH_OPTIONAL, along with
__NO_LONG_DOUBLE_MATH if this particular compilation is with
-mlong-double-64.

As part of the refactoring I proposed in
<https://sourceware.org/ml/libc-alpha/2016-11/msg00745.html>, this
patch puts all that information in a single header,
bits/long-double.h.  It is included from sys/cdefs.h alongside the
include of bits/wordsize.h, so other headers generally do not need to
include bits/long-double.h directly.

Previously, various bits/mathdef.h headers and bits/wordsize.h headers
had this long double information (including implicitly in some
bits/mathdef.h headers through not having the defines present in the
default version).  After the patch, it's all in six bits/long-double.h
headers.  Furthermore, most of those new headers are not
architecture-specific.  Architectures with optional long double all
use the ldbl-opt sysdeps directory, either in the order (ldbl-64-128,
ldbl-opt, ldbl-128) or (ldbl-128ibm, ldbl-opt).  Thus a generic header
for the case where long double = double, and headers in ldbl-128,
ldbl-96 and ldbl-opt, suffices to cover every architecture except for
cases where long double properties vary between different ABIs sharing
a set of installed headers; fortunately all the ldbl-opt cases share a
single compiler-predefined macro __LONG_DOUBLE_128__ that can be used
to tell whether this compilation is -mlong-double-64 or
-mlong-double-128.

The two cases where a set of headers is shared between ABIs with
different long double properties, MIPS (o32 has long double = double,
other ABIs use ldbl-128) and SPARC (32-bit has optional long double,
64-bit has required long double), need their own bits/long-double.h
headers.

As with bits/wordsize.h, multiple-include protection for this header
is generally implicit through the include guards on sys/cdefs.h, and
multiple inclusion is harmless in any case.  There is one subtlety:
the header must not define __LONG_DOUBLE_MATH_OPTIONAL if
__NO_LONG_DOUBLE_MATH was defined before its inclusion, because doing
so breaks how sysdeps/ieee754/ldbl-opt/nldbl-compat.h defines
__NO_LONG_DOUBLE_MATH itself before including system headers.  Subject
to keeping that working, it would be reasonable to move these macros
from defined/undefined #ifdef to always-defined 1/0 #if semantics, but
this patch does not attempt to do so, just rearranges where the macros
are defined.

After this patch, the only use of bits/mathdef.h is the alpha one for
modifying complex function ABIs for old GCC.  Thus, all versions of
the header other than the default and alpha versions are removed, as
is the include from math.h.

Tested for x86_64 and x86.  Also did compilation-only testing with
build-many-glibcs.py.

* bits/long-double.h: New file.
* sysdeps/ieee754/ldbl-128/bits/long-double.h: Likewise.
* sysdeps/ieee754/ldbl-96/bits/long-double.h: Likewise.
* sysdeps/ieee754/ldbl-opt/bits/long-double.h: Likewise.
* sysdeps/mips/bits/long-double.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/long-double.h: Likewise.
* math/Makefile (headers): Add bits/long-double.h.
* misc/sys/cdefs.h: Include <bits/long-double.h>.
* stdlib/strtold.c: Include <bits/long-double.h> instead of
<bits/wordsize.h>.
* bits/mathdef.h [!_COMPLEX_H]: Do not allow inclusion.
[!__NO_LONG_DOUBLE_MATH]: Remove conditional code.
* math/math.h: Do not include <bits/mathdef.h>.
* sysdeps/aarch64/bits/mathdef.h: Remove file.
* sysdeps/alpha/bits/mathdef.h [!_COMPLEX_H]: Do not allow
inclusion.
* sysdeps/ia64/bits/mathdef.h: Remove file.
* sysdeps/m68k/m680x0/bits/mathdef.h: Likewise.
* sysdeps/mips/bits/mathdef.h: Likewise.
* sysdeps/powerpc/bits/mathdef.h: Likewise.
* sysdeps/s390/bits/mathdef.h: Likewise.
* sysdeps/sparc/bits/mathdef.h: Likewise.
* sysdeps/x86/bits/mathdef.h: Likewise.
* sysdeps/s390/s390-32/bits/wordsize.h
[!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]: Remove
conditional code.
* sysdeps/s390/s390-64/bits/wordsize.h
[!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
[!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
[!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
[!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
Likewise.

21 files changed:
ChangeLog
bits/long-double.h [new file with mode: 0644]
bits/mathdef.h
math/Makefile
math/math.h
misc/sys/cdefs.h
stdlib/strtold.c
sysdeps/alpha/bits/mathdef.h
sysdeps/ieee754/ldbl-128/bits/long-double.h [moved from sysdeps/ia64/bits/mathdef.h with 72% similarity]
sysdeps/ieee754/ldbl-96/bits/long-double.h [moved from sysdeps/aarch64/bits/mathdef.h with 72% similarity]
sysdeps/ieee754/ldbl-opt/bits/long-double.h [moved from sysdeps/s390/bits/mathdef.h with 68% similarity]
sysdeps/m68k/m680x0/bits/mathdef.h [deleted file]
sysdeps/mips/bits/long-double.h [moved from sysdeps/sparc/bits/mathdef.h with 70% similarity]
sysdeps/mips/bits/mathdef.h [deleted file]
sysdeps/s390/s390-32/bits/wordsize.h
sysdeps/s390/s390-64/bits/wordsize.h
sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
sysdeps/unix/sysv/linux/sparc/bits/long-double.h [moved from sysdeps/powerpc/bits/mathdef.h with 64% similarity]
sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
sysdeps/x86/bits/mathdef.h [deleted file]

index 32ce9af459ceee93c0b024de743025a74c7bc3fc..ba42b5bd289682e0f2458fc10174e420e05696bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,44 @@
 2016-12-14  Joseph Myers  <joseph@codesourcery.com>
 
+       * bits/long-double.h: New file.
+       * sysdeps/ieee754/ldbl-128/bits/long-double.h: Likewise.
+       * sysdeps/ieee754/ldbl-96/bits/long-double.h: Likewise.
+       * sysdeps/ieee754/ldbl-opt/bits/long-double.h: Likewise.
+       * sysdeps/mips/bits/long-double.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/long-double.h: Likewise.
+       * math/Makefile (headers): Add bits/long-double.h.
+       * misc/sys/cdefs.h: Include <bits/long-double.h>.
+       * stdlib/strtold.c: Include <bits/long-double.h> instead of
+       <bits/wordsize.h>.
+       * bits/mathdef.h [!_COMPLEX_H]: Do not allow inclusion.
+       [!__NO_LONG_DOUBLE_MATH]: Remove conditional code.
+       * math/math.h: Do not include <bits/mathdef.h>.
+       * sysdeps/aarch64/bits/mathdef.h: Remove file.
+       * sysdeps/alpha/bits/mathdef.h [!_COMPLEX_H]: Do not allow
+       inclusion.
+       * sysdeps/ia64/bits/mathdef.h: Remove file.
+       * sysdeps/m68k/m680x0/bits/mathdef.h: Likewise.
+       * sysdeps/mips/bits/mathdef.h: Likewise.
+       * sysdeps/powerpc/bits/mathdef.h: Likewise.
+       * sysdeps/s390/bits/mathdef.h: Likewise.
+       * sysdeps/sparc/bits/mathdef.h: Likewise.
+       * sysdeps/x86/bits/mathdef.h: Likewise.
+       * sysdeps/s390/s390-32/bits/wordsize.h
+       [!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]: Remove
+       conditional code.
+       * sysdeps/s390/s390-64/bits/wordsize.h
+       [!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
+       Likewise.
+       * sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
+       [!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
+       [!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
+       Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
+       [!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
+       Likewise.
+
        * sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU]: Include
        <linux/falloc.h>.
        (FALLOC_FL_KEEP_SIZE): Remove.
diff --git a/bits/long-double.h b/bits/long-double.h
new file mode 100644 (file)
index 0000000..1657857
--- /dev/null
@@ -0,0 +1,39 @@
+/* Properties of long double type.
+   Copyright (C) 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  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/>.  */
+
+/* This header is included by <sys/cdefs.h>.
+
+   If long double is ABI-compatible with double, it should define
+   __NO_LONG_DOUBLE_MATH to 1; otherwise, it should leave
+   __NO_LONG_DOUBLE_MATH undefined.
+
+   If this build of the GNU C Library supports both long double
+   ABI-compatible with double and some other long double format not
+   ABI-compatible with double, it should define
+   __LONG_DOUBLE_MATH_OPTIONAL to 1; otherwise, it should leave
+   __LONG_DOUBLE_MATH_OPTIONAL undefined.
+
+   If __NO_LONG_DOUBLE_MATH is already defined, this header must not
+   define anything; this is needed to work with the definition of
+   __NO_LONG_DOUBLE_MATH in nldbl-compat.h.  */
+
+/* In the default version of this header, long double is
+   ABI-compatible with double.  */
+#ifndef __NO_LONG_DOUBLE_MATH
+# define __NO_LONG_DOUBLE_MATH 1
+#endif
index 014829790ab857c240b785833d38ecfcd3e4ade7..5e80e920b4c382a2f8dea408981d7e28680069e0 100644 (file)
    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"
-#endif
-
-#ifndef __NO_LONG_DOUBLE_MATH
-/* Signal that we do not really have a `long double'.  The disables the
-   declaration of all the `long double' function variants.  */
-# define __NO_LONG_DOUBLE_MATH 1
+#ifndef _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <complex.h> instead"
 #endif
index 1e9610012036a1fd4bc02dbf8d6862e04a7d6d0c..84d061f124cc5b107afecfdbe54ee59b5437351d 100644 (file)
@@ -28,7 +28,8 @@ headers               := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
                   bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \
                   bits/math-finite.h bits/math-vector.h \
                   bits/libm-simd-decl-stubs.h bits/iscanonical.h \
-                  bits/flt-eval-method.h bits/fp-fast.h bits/fp-logb.h
+                  bits/flt-eval-method.h bits/fp-fast.h bits/fp-logb.h \
+                  bits/long-double.h
 
 # FPU support code.
 aux            := setfpucw fpu_control
index b8f4b415c73f59b0dbbf02ca1eab6ebd32bdcfc9..1dca14684dab0c0a2568575abfcb5494b48f5ac8 100644 (file)
@@ -138,10 +138,6 @@ typedef _Float128x double_t;
 # endif
 #endif
 
-/* Get information about long double.  */
-
-#include <bits/mathdef.h>
-
 /* Get the architecture specific values describing the floating-point
    evaluation.  The following symbols will get defined:
 
index 9298dd60f94b9e4784973cc0a0bfd69e80bd37ee..e07f3fcbcb21566e0fbedad7fd86d3be7b5aab82 100644 (file)
 #endif
 
 #include <bits/wordsize.h>
+#include <bits/long-double.h>
 
 #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
 # define __LDBL_COMPAT 1
index bb46f23c29709ad9a2d6d90d19d97d2817545e79..251663ffcdeae0ca514bb04488585b09c8a8d043 100644 (file)
@@ -20,7 +20,7 @@
 /* The actual implementation for all floating point sizes is in strtod.c.
    These macros tell it to produce the `float' version, `strtof'.  */
 
-#include <bits/wordsize.h>
+#include <bits/long-double.h>
 
 #ifdef __LONG_DOUBLE_MATH_OPTIONAL
 # include <wchar.h>
index 021563f211fe1c64618f5367bf95046408173377..e56f3e521251263c913c5bfcaa61f00b2373e417 100644 (file)
@@ -15,8 +15,8 @@
    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 _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <complex.h> instead"
 #endif
 
 #if defined _COMPLEX_H && !defined _COMPLEX_H_MATHDEF
similarity index 72%
rename from sysdeps/ia64/bits/mathdef.h
rename to sysdeps/ieee754/ldbl-128/bits/long-double.h
index e689835716a7a8685a01d600f8c6f18657a0a346..3f10da8486289f5ee4e965a23e6d27364813e22c 100644 (file)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+/* Properties of long double type.  ldbl-128 version.
+   Copyright (C) 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
+   License  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,
@@ -15,6 +16,5 @@
    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"
-#endif
+/* long double is distinct from double, so there is nothing to
+   define here.  */
similarity index 72%
rename from sysdeps/aarch64/bits/mathdef.h
rename to sysdeps/ieee754/ldbl-96/bits/long-double.h
index 2213635bd84e085d2aafb3618349b086e47db311..180a7cf34369254ae8e461866d60ff5ab18abab6 100644 (file)
@@ -1,10 +1,10 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
-
+/* Properties of long double type.  ldbl-96 version.
+   Copyright (C) 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
+   License  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,
@@ -16,6 +16,5 @@
    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"
-#endif
+/* long double is distinct from double, so there is nothing to
+   define here.  */
similarity index 68%
rename from sysdeps/s390/bits/mathdef.h
rename to sysdeps/ieee754/ldbl-opt/bits/long-double.h
index eeea6fcdc2edbbb72fc3770b042a4b579ca67592..dce98c38c6c0ad3592a8074353904f4b3ab0a4a3 100644 (file)
@@ -1,9 +1,10 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Properties of long double type.  ldbl-opt version.
+   Copyright (C) 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
+   License  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,
@@ -15,6 +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 __NO_LONG_DOUBLE_MATH
+# define __LONG_DOUBLE_MATH_OPTIONAL   1
+# ifndef __LONG_DOUBLE_128__
+#  define __NO_LONG_DOUBLE_MATH                1
+# endif
 #endif
diff --git a/sysdeps/m68k/m680x0/bits/mathdef.h b/sysdeps/m68k/m680x0/bits/mathdef.h
deleted file mode 100644 (file)
index 7926c6a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* 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 _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
similarity index 70%
rename from sysdeps/sparc/bits/mathdef.h
rename to sysdeps/mips/bits/long-double.h
index 65ab45aad334ae9f8c076370f19e2cf85f2b11f6..b51fce8e6e71dcc0d1015cce3f7f0634ffe8f6ce 100644 (file)
@@ -1,9 +1,10 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Properties of long double type.  MIPS version.
+   Copyright (C) 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
+   License  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,
@@ -15,8 +16,8 @@
    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"
-#endif
+#include <sgidefs.h>
 
-#include <bits/wordsize.h>
+#if !defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
+# define __NO_LONG_DOUBLE_MATH 1
+#endif
diff --git a/sysdeps/mips/bits/mathdef.h b/sysdeps/mips/bits/mathdef.h
deleted file mode 100644 (file)
index 31fc400..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* 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 _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#include <sgidefs.h>
-
-#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
-/* Signal that we do not really have a `long double'.  This disables the
-   declaration of all the `long double' function variants.  */
-# define __NO_LONG_DOUBLE_MATH 1
-#endif
index c7a5fbf65596b81f0ad45e3869c0e0200b18f854..129e47182b8a1fa44f46a7db9dc7acc545d3f459 100644 (file)
@@ -9,14 +9,3 @@
 #endif
 
 #define __WORDSIZE_TIME64_COMPAT32     0
-
-#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
-
-/* Signal that we didn't used to have a `long double'. The changes all
-   the `long double' function variants to be redirects to the double
-   functions.  */
-# define __LONG_DOUBLE_MATH_OPTIONAL   1
-# ifndef __LONG_DOUBLE_128__
-#  define __NO_LONG_DOUBLE_MATH        1
-# endif
-#endif
index 31e0ec6699c5907e640b903827fd704f9c0d1bb5..00e88b0628201386ac24f336bef1cae80181fd27 100644 (file)
@@ -9,14 +9,3 @@
 #endif
 
 #define __WORDSIZE_TIME64_COMPAT32     0
-
-#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
-
-/* Signal that we didn't used to have a `long double'. The changes all
-   the `long double' function variants to be redirects to the double
-   functions.  */
-# define __LONG_DOUBLE_MATH_OPTIONAL   1
-# ifndef __LONG_DOUBLE_128__
-#  define __NO_LONG_DOUBLE_MATH        1
-# endif
-#endif
index f0961f69cc8e35e9bd63d08057b909fead47614b..2ef70a98dda7a3d38d3cd91197102b4e59fdec79 100644 (file)
 
 #define __WORDSIZE     64
 #define __WORDSIZE_TIME64_COMPAT32     0
-
-#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
-
-/* Signal that we didn't used to have a `long double'. The changes all
-   the `long double' function variants to be redirects to the double
-   functions.  */
-# define __LONG_DOUBLE_MATH_OPTIONAL   1
-# ifndef __LONG_DOUBLE_128__
-#  define __NO_LONG_DOUBLE_MATH                1
-# endif
-#endif
index 109f08ccdcf496fc7dff73d98970c659be129099..04ca9debf00d7ee97ddf83dcd2e66c139bcd9d7c 100644 (file)
@@ -9,14 +9,3 @@
 # define __WORDSIZE32_SIZE_ULONG       0
 # define __WORDSIZE32_PTRDIFF_LONG     0
 #endif
-
-#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
-
-/* Signal the glibc ABI didn't used to have a `long double'.
-   The changes all the `long double' function variants to be redirects
-   to the double functions.  */
-# define __LONG_DOUBLE_MATH_OPTIONAL   1
-# ifndef __LONG_DOUBLE_128__
-#  define __NO_LONG_DOUBLE_MATH        1
-# endif
-#endif
similarity index 64%
rename from sysdeps/powerpc/bits/mathdef.h
rename to sysdeps/unix/sysv/linux/sparc/bits/long-double.h
index eeea6fcdc2edbbb72fc3770b042a4b579ca67592..20039ce4cea275bfee657101dfdd0afcdb799d1c 100644 (file)
@@ -1,9 +1,10 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Properties of long double type.  SPARC version.
+   Copyright (C) 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
+   License  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,
    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"
+#include <bits/wordsize.h>
+
+#if !defined __NO_LONG_DOUBLE_MATH && __WORDSIZE == 32
+# define __LONG_DOUBLE_MATH_OPTIONAL   1
+# ifndef __LONG_DOUBLE_128__
+#  define __NO_LONG_DOUBLE_MATH        1
+# endif
 #endif
index 121b4fe8c96b05d651328b128664e745b04ab709..7562875ee23ba8c52156e7e0fa1f4457ae15286e 100644 (file)
@@ -9,16 +9,3 @@
 # define __WORDSIZE32_PTRDIFF_LONG     0
 # define __WORDSIZE_TIME64_COMPAT32    0
 #endif
-
-#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
-
-# if __WORDSIZE == 32
-/* Signal that in 32bit ABI we didn't used to have a `long double'.
-   The changes all the `long double' function variants to be redirects
-   to the double functions.  */
-#  define __LONG_DOUBLE_MATH_OPTIONAL   1
-#  ifndef __LONG_DOUBLE_128__
-#   define __NO_LONG_DOUBLE_MATH        1
-#  endif
-# endif
-#endif
diff --git a/sysdeps/x86/bits/mathdef.h b/sysdeps/x86/bits/mathdef.h
deleted file mode 100644 (file)
index 1c6aee6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (C) 2001-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 _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif