summaryrefslogtreecommitdiff
path: root/libquadmath/quadmath-imp.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-01-16 17:44:35 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-01-16 17:44:35 +0100
commitdbc9f6c6ee8decb40aed6c790ebe4337b52a37df (patch)
treecbbd98da06ef06f334e26d4cd08eea03e60befdb /libquadmath/quadmath-imp.h
parentfa23b182095ab7bd85605c62f2209c439b8a8018 (diff)
downloadgcc-dbc9f6c6ee8decb40aed6c790ebe4337b52a37df.tar.gz
re PR fortran/46416 (libquadmath: missing functions)
PR fortran/46416 * quadmath.h (cbrtq, finiteq, isnanq, signbitq, sqrtq): Remove const from prototype argument. (cimagq, conjq, cprojq, crealq, fdimq, fmaxq, fminq, ilogbq, llrintq, log2q, lrintq, nearbyintq, remquoq): New prototypes. (__quadmath_extern_inline): Define. (cimagq, conjq, crealq): New inlines. * Makefile.am (libquadmath_la_SOURCES): Add math/cimagq.c, math/conjq.c, math/cprojq.c, math/crealq.c, math/fdimq.c, math/fmaxq.c, math/fminq.c, math/ilogbq.c, math/llrintq.c, math/log2q.c, math/lrintq.c, math/nearbyintq.c and math/remquoq.c. * Makefile.in: Regenerated. * quadmath_weak.h (cimagq, conjq, cprojq, crealq, fdimq, fmaxq, fminq, ilogbq, llrintq, log2q, lrintq, nearbyintq, remquoq): Add. * quadmath-imp.h (__LITTLE_ENDIAN__): Don't define. (ieee854_float128): Use __BYTE_ORDER == __ORDER_BIG_ENDIAN__ tests instead of __BIG_ENDIAN__. * quadmath.map (QUADMATH_1.0): Add cimagq, conjq, cprojq, crealq, fdimq, fmaxq, fminq, ilogbq, llrintq, log2q, lrintq, nearbyintq and remquoq. * libquadmath.texi (cimagq, conjq, cprojq, crealq, fdimq, fmaxq, fminq, ilogbq, llrintq, log2q, lrintq, nearbyintq, remquoq): Add. * math/cprojq.c: New file. * math/ilogbq.c: New file. * math/fminq.c: New file. * math/llrintq.c: New file. * math/log2q.c: New file. * math/lrintq.c: New file. * math/crealq.c: New file. * math/nearbyintq.c: New file. * math/fmaxq.c: New file. * math/conjq.c: New file. * math/remquoq.c: New file. * math/cimagq.c: New file. * math/fdimq.c: New file. * math/ldexpq.c: Include errno.h. Set errno to ERANGE if needed. From-SVN: r168854
Diffstat (limited to 'libquadmath/quadmath-imp.h')
-rw-r--r--libquadmath/quadmath-imp.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/libquadmath/quadmath-imp.h b/libquadmath/quadmath-imp.h
index 5404c9eef99..58e3146e364 100644
--- a/libquadmath/quadmath-imp.h
+++ b/libquadmath/quadmath-imp.h
@@ -42,12 +42,6 @@ extern __float128 __quadmath_kernel_cosq (__float128, __float128);
#endif
-// If we don't have macros to know endianess, assume little endian
-#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
-# define __LITTLE_ENDIAN__ 1
-#endif
-
-
// Main union type we use to manipulate the floating-point type
typedef union
{
@@ -55,13 +49,12 @@ typedef union
struct
{
-#if __BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
unsigned negative:1;
unsigned exponent:15;
uint64_t mant_high:48;
uint64_t mant_low:64;
-#endif
-#if __LITTLE_ENDIAN__
+#else
uint64_t mant_low:64;
uint64_t mant_high:48;
unsigned exponent:15;
@@ -71,11 +64,10 @@ typedef union
struct
{
-#if __BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
uint64_t high;
uint64_t low;
-#endif
-#if __LITTLE_ENDIAN__
+#else
uint64_t low;
uint64_t high;
#endif
@@ -83,13 +75,12 @@ typedef union
struct
{
-#if __BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
uint32_t w0;
uint32_t w1;
uint32_t w2;
uint32_t w3;
-#endif
-#if __LITTLE_ENDIAN__
+#else
uint32_t w3;
uint32_t w2;
uint32_t w1;
@@ -99,14 +90,13 @@ typedef union
struct
{
-#if __BIG_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
unsigned negative:1;
unsigned exponent:15;
unsigned quiet_nan:1;
uint64_t mant_high:47;
uint64_t mant_low:64;
-#endif
-#if __LITTLE_ENDIAN__
+#else
uint64_t mant_low:64;
uint64_t mant_high:47;
unsigned quiet_nan:1;