[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master c6902b0d 19/22: Fix the defect just noted
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master c6902b0d 19/22: Fix the defect just noted |
Date: |
Fri, 20 May 2022 22:43:42 -0400 (EDT) |
branch: master
commit c6902b0d4d1cc8f78e54f333f4dce319bdfaa54d
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Fix the defect just noted
Now the desired test can be enabled, in the next commit.
---
fdlibm_expm1.c | 21 ++++++++++-----------
fdlibm_log1p.c | 21 ++++++++++-----------
2 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/fdlibm_expm1.c b/fdlibm_expm1.c
index 4b8be959..44e2a1f4 100644
--- a/fdlibm_expm1.c
+++ b/fdlibm_expm1.c
@@ -50,26 +50,25 @@
* ====================================================
*/
-/* Sometimes it's necessary to define __LITTLE_ENDIAN explicitly
- but these catch some common cases. */
+#if !defined __FLOAT_WORD_ORDER__ || \
+ !defined __ORDER_BIG_ENDIAN__ || \
+ !defined __ORDER_LITTLE_ENDIAN__
+#error Expected ndianness macros not defined.
+#endif // expected endianness macros not defined
-#if defined(i386) || defined(i486) || \
- defined(intel) || defined(x86) || defined(i86pc) || \
- defined(__alpha) || defined(__osf__)
-#define __LITTLE_ENDIAN
-#endif // big endian
-
-#if defined __LITTLE_ENDIAN
+#if __FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define FDLIBM_HI(x) *(1+(int*)&x)
#define FDLIBM_LO(x) *(int*)&x
#define FDLIBM_HIp(x) *(1+(int*)x)
#define FDLIBM_LOp(x) *(int*)x
-#else // !defined __LITTLE_ENDIAN
+#elif __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__
#define FDLIBM_HI(x) *(int*)&x
#define FDLIBM_LO(x) *(1+(int*)&x)
#define FDLIBM_HIp(x) *(int*)x
#define FDLIBM_LOp(x) *(1+(int*)x)
-#endif // !defined __LITTLE_ENDIAN
+#else // unknown endianness
+#error Unknown endianness.
+#endif // unknown endianness
#if defined __STDC__
#define FDLIBM_PROTOTYPE(p) p
diff --git a/fdlibm_log1p.c b/fdlibm_log1p.c
index 47062032..3834aa50 100644
--- a/fdlibm_log1p.c
+++ b/fdlibm_log1p.c
@@ -48,26 +48,25 @@
* ====================================================
*/
-/* Sometimes it's necessary to define __LITTLE_ENDIAN explicitly
- but these catch some common cases. */
+#if !defined __FLOAT_WORD_ORDER__ || \
+ !defined __ORDER_BIG_ENDIAN__ || \
+ !defined __ORDER_LITTLE_ENDIAN__
+#error Expected ndianness macros not defined.
+#endif // expected endianness macros not defined
-#if defined(i386) || defined(i486) || \
- defined(intel) || defined(x86) || defined(i86pc) || \
- defined(__alpha) || defined(__osf__)
-#define __LITTLE_ENDIAN
-#endif // big endian
-
-#if defined __LITTLE_ENDIAN
+#if __FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define FDLIBM_HI(x) *(1+(int*)&x)
#define FDLIBM_LO(x) *(int*)&x
#define FDLIBM_HIp(x) *(1+(int*)x)
#define FDLIBM_LOp(x) *(int*)x
-#else // !defined __LITTLE_ENDIAN
+#elif __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__
#define FDLIBM_HI(x) *(int*)&x
#define FDLIBM_LO(x) *(1+(int*)&x)
#define FDLIBM_HIp(x) *(int*)x
#define FDLIBM_LOp(x) *(1+(int*)x)
-#endif // !defined __LITTLE_ENDIAN
+#else // unknown endianness
+#error Unknown endianness.
+#endif // unknown endianness
#if defined __STDC__
#define FDLIBM_PROTOTYPE(p) p
- [lmi-commits] [lmi] master 324e171e 02/22: Rectify whitespace, (continued)
- [lmi-commits] [lmi] master 324e171e 02/22: Rectify whitespace, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 15b1aa35 11/22: Add license and copyright boilerplate, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 4ec9da1f 12/22: Rename fdlibm sources, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master e8a859a3 06/22: Rename prototyping macro, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 078e9a1c 16/22: Ignore certain diagnostics, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 2d514bdc 09/22: Allow some common macros, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 1646f4c0 13/22: Rename fdlibm entry points, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 75dc2686 17/22: Write unambiguous braces, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 9e608afe 20/22: Remove debugging output for tests that now succeed, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master 2563b0f6 07/22: Expunge prototypes for unreferenced functions, Greg Chicares, 2022/05/20
- [lmi-commits] [lmi] master c6902b0d 19/22: Fix the defect just noted,
Greg Chicares <=
- [lmi-commits] [lmi] master 6c12b4ea 22/22: Specify widths of some integers, Greg Chicares, 2022/05/20