]> gcc.gnu.org Git - gcc.git/blobdiff - libgcc/soft-fp/quad.h
PR target/107299: Fix build issue when long double is IEEE 128-bit
[gcc.git] / libgcc / soft-fp / quad.h
index 5002da5a533accd11be91ff96927643b86be01b0..71f87d36ba9801ac0aabc1d87cb947a413b5a9fc 100644 (file)
@@ -1,11 +1,7 @@
 /* Software floating-point emulation.
    Definitions for IEEE Quad Precision.
-   Copyright (C) 1997-2013 Free Software Foundation, Inc.
+   Copyright (C) 1997-2022 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Richard Henderson (rth@cygnus.com),
-                 Jakub Jelinek (jj@ultra.linux.cz),
-                 David S. Miller (davem@redhat.com) and
-                 Peter Maydell (pmaydell@chiark.greenend.org.uk).
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
 
    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/>.  */
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef SOFT_FP_QUAD_H
+#define SOFT_FP_QUAD_H 1
 
 #if _FP_W_TYPE_SIZE < 32
 # error "Here's a nickel, kid. Go buy yourself a real computer."
@@ -66,7 +65,9 @@
 #define _FP_HIGHBIT_DW_Q       \
   ((_FP_W_TYPE) 1 << (_FP_WFRACBITS_DW_Q - 1) % _FP_W_TYPE_SIZE)
 
+#ifndef TFtype
 typedef float TFtype __attribute__ ((mode (TF)));
+#endif
 
 #if _FP_W_TYPE_SIZE < 64
 
@@ -90,26 +91,26 @@ union _FP_UNION_Q
     unsigned exp : _FP_EXPBITS_Q;
     unsigned sign : 1;
 # endif /* not bigendian */
-  } bits __attribute__ ((packed));
+  } bits;
 };
 
 
 # define FP_DECL_Q(X)          _FP_DECL (4, X)
-# define FP_UNPACK_RAW_Q(X, val)       _FP_UNPACK_RAW_4 (Q, X, val)
-# define FP_UNPACK_RAW_QP(X, val)      _FP_UNPACK_RAW_4_P (Q, X, val)
-# define FP_PACK_RAW_Q(val, X) _FP_PACK_RAW_4 (Q, val, X)
+# define FP_UNPACK_RAW_Q(X, val)       _FP_UNPACK_RAW_4 (Q, X, (val))
+# define FP_UNPACK_RAW_QP(X, val)      _FP_UNPACK_RAW_4_P (Q, X, (val))
+# define FP_PACK_RAW_Q(val, X) _FP_PACK_RAW_4 (Q, (val), X)
 # define FP_PACK_RAW_QP(val, X)                        \
   do                                           \
     {                                          \
       if (!FP_INHIBIT_RESULTS)                 \
-       _FP_PACK_RAW_4_P (Q, val, X);           \
+       _FP_PACK_RAW_4_P (Q, (val), X);         \
     }                                          \
   while (0)
 
 # define FP_UNPACK_Q(X, val)                   \
   do                                           \
     {                                          \
-      _FP_UNPACK_RAW_4 (Q, X, val);            \
+      _FP_UNPACK_RAW_4 (Q, X, (val));          \
       _FP_UNPACK_CANONICAL (Q, 4, X);          \
     }                                          \
   while (0)
@@ -117,7 +118,7 @@ union _FP_UNION_Q
 # define FP_UNPACK_QP(X, val)                  \
   do                                           \
     {                                          \
-      _FP_UNPACK_RAW_4_P (Q, X, val);          \
+      _FP_UNPACK_RAW_4_P (Q, X, (val));                \
       _FP_UNPACK_CANONICAL (Q, 4, X);          \
     }                                          \
   while (0)
@@ -125,7 +126,7 @@ union _FP_UNION_Q
 # define FP_UNPACK_SEMIRAW_Q(X, val)           \
   do                                           \
     {                                          \
-      _FP_UNPACK_RAW_4 (Q, X, val);            \
+      _FP_UNPACK_RAW_4 (Q, X, (val));          \
       _FP_UNPACK_SEMIRAW (Q, 4, X);            \
     }                                          \
   while (0)
@@ -133,7 +134,7 @@ union _FP_UNION_Q
 # define FP_UNPACK_SEMIRAW_QP(X, val)          \
   do                                           \
     {                                          \
-      _FP_UNPACK_RAW_4_P (Q, X, val);          \
+      _FP_UNPACK_RAW_4_P (Q, X, (val));                \
       _FP_UNPACK_SEMIRAW (Q, 4, X);            \
     }                                          \
   while (0)
@@ -142,7 +143,7 @@ union _FP_UNION_Q
   do                                           \
     {                                          \
       _FP_PACK_CANONICAL (Q, 4, X);            \
-      _FP_PACK_RAW_4 (Q, val, X);              \
+      _FP_PACK_RAW_4 (Q, (val), X);            \
     }                                          \
   while (0)
 
@@ -151,7 +152,7 @@ union _FP_UNION_Q
     {                                          \
       _FP_PACK_CANONICAL (Q, 4, X);            \
       if (!FP_INHIBIT_RESULTS)                 \
-       _FP_PACK_RAW_4_P (Q, val, X);           \
+       _FP_PACK_RAW_4_P (Q, (val), X);         \
     }                                          \
   while (0)
 
@@ -159,7 +160,7 @@ union _FP_UNION_Q
   do                                           \
     {                                          \
       _FP_PACK_SEMIRAW (Q, 4, X);              \
-      _FP_PACK_RAW_4 (Q, val, X);              \
+      _FP_PACK_RAW_4 (Q, (val), X);            \
     }                                          \
   while (0)
 
@@ -168,7 +169,7 @@ union _FP_UNION_Q
     {                                          \
       _FP_PACK_SEMIRAW (Q, 4, X);              \
       if (!FP_INHIBIT_RESULTS)                 \
-       _FP_PACK_RAW_4_P (Q, val, X);           \
+       _FP_PACK_RAW_4_P (Q, (val), X);         \
     }                                          \
   while (0)
 
@@ -179,15 +180,17 @@ union _FP_UNION_Q
 # define FP_MUL_Q(R, X, Y)             _FP_MUL (Q, 4, R, X, Y)
 # define FP_DIV_Q(R, X, Y)             _FP_DIV (Q, 4, R, X, Y)
 # define FP_SQRT_Q(R, X)               _FP_SQRT (Q, 4, R, X)
-# define _FP_SQRT_MEAT_Q(R, S, T, X, Q)        _FP_SQRT_MEAT_4 (R, S, T, X, Q)
+# define _FP_SQRT_MEAT_Q(R, S, T, X, Q)        _FP_SQRT_MEAT_4 (R, S, T, X, (Q))
 # define FP_FMA_Q(R, X, Y, Z)          _FP_FMA (Q, 4, 8, R, X, Y, Z)
 
-# define FP_CMP_Q(r, X, Y, un)         _FP_CMP (Q, 4, r, X, Y, un)
-# define FP_CMP_EQ_Q(r, X, Y)          _FP_CMP_EQ (Q, 4, r, X, Y)
-# define FP_CMP_UNORD_Q(r, X, Y)       _FP_CMP_UNORD (Q, 4, r, X, Y)
+# define FP_CMP_Q(r, X, Y, un, ex)     _FP_CMP (Q, 4, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_Q(r, X, Y, ex)      _FP_CMP_EQ (Q, 4, (r), X, Y, (ex))
+# define FP_CMP_UNORD_Q(r, X, Y, ex)   _FP_CMP_UNORD (Q, 4, (r), X, Y, (ex))
 
-# define FP_TO_INT_Q(r, X, rsz, rsg)   _FP_TO_INT (Q, 4, r, X, rsz, rsg)
-# define FP_FROM_INT_Q(X, r, rs, rt)   _FP_FROM_INT (Q, 4, X, r, rs, rt)
+# define FP_TO_INT_Q(r, X, rsz, rsg)   _FP_TO_INT (Q, 4, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_Q(r, X, rsz, rsg)     \
+  _FP_TO_INT_ROUND (Q, 4, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_Q(X, r, rs, rt)   _FP_FROM_INT (Q, 4, X, (r), (rs), rt)
 
 # define _FP_FRAC_HIGH_Q(X)    _FP_FRAC_HIGH_4 (X)
 # define _FP_FRAC_HIGH_RAW_Q(X)        _FP_FRAC_HIGH_4 (X)
@@ -219,21 +222,21 @@ union _FP_UNION_Q
 };
 
 # define FP_DECL_Q(X)          _FP_DECL (2, X)
-# define FP_UNPACK_RAW_Q(X, val)       _FP_UNPACK_RAW_2 (Q, X, val)
-# define FP_UNPACK_RAW_QP(X, val)      _FP_UNPACK_RAW_2_P (Q, X, val)
-# define FP_PACK_RAW_Q(val, X) _FP_PACK_RAW_2 (Q, val, X)
+# define FP_UNPACK_RAW_Q(X, val)       _FP_UNPACK_RAW_2 (Q, X, (val))
+# define FP_UNPACK_RAW_QP(X, val)      _FP_UNPACK_RAW_2_P (Q, X, (val))
+# define FP_PACK_RAW_Q(val, X) _FP_PACK_RAW_2 (Q, (val), X)
 # define FP_PACK_RAW_QP(val, X)                        \
   do                                           \
     {                                          \
       if (!FP_INHIBIT_RESULTS)                 \
-       _FP_PACK_RAW_2_P (Q, val, X);           \
+       _FP_PACK_RAW_2_P (Q, (val), X);         \
     }                                          \
   while (0)
 
 # define FP_UNPACK_Q(X, val)                   \
   do                                           \
     {                                          \
-      _FP_UNPACK_RAW_2 (Q, X, val);            \
+      _FP_UNPACK_RAW_2 (Q, X, (val));          \
       _FP_UNPACK_CANONICAL (Q, 2, X);          \
     }                                          \
   while (0)
@@ -241,7 +244,7 @@ union _FP_UNION_Q
 # define FP_UNPACK_QP(X, val)                  \
   do                                           \
     {                                          \
-      _FP_UNPACK_RAW_2_P (Q, X, val);          \
+      _FP_UNPACK_RAW_2_P (Q, X, (val));                \
       _FP_UNPACK_CANONICAL (Q, 2, X);          \
     }                                          \
   while (0)
@@ -249,7 +252,7 @@ union _FP_UNION_Q
 # define FP_UNPACK_SEMIRAW_Q(X, val)           \
   do                                           \
     {                                          \
-      _FP_UNPACK_RAW_2 (Q, X, val);            \
+      _FP_UNPACK_RAW_2 (Q, X, (val));          \
       _FP_UNPACK_SEMIRAW (Q, 2, X);            \
     }                                          \
   while (0)
@@ -257,7 +260,7 @@ union _FP_UNION_Q
 # define FP_UNPACK_SEMIRAW_QP(X, val)          \
   do                                           \
     {                                          \
-      _FP_UNPACK_RAW_2_P (Q, X, val);          \
+      _FP_UNPACK_RAW_2_P (Q, X, (val));                \
       _FP_UNPACK_SEMIRAW (Q, 2, X);            \
     }                                          \
   while (0)
@@ -266,7 +269,7 @@ union _FP_UNION_Q
   do                                           \
     {                                          \
       _FP_PACK_CANONICAL (Q, 2, X);            \
-      _FP_PACK_RAW_2 (Q, val, X);              \
+      _FP_PACK_RAW_2 (Q, (val), X);            \
     }                                          \
   while (0)
 
@@ -275,7 +278,7 @@ union _FP_UNION_Q
     {                                          \
       _FP_PACK_CANONICAL (Q, 2, X);            \
       if (!FP_INHIBIT_RESULTS)                 \
-       _FP_PACK_RAW_2_P (Q, val, X);           \
+       _FP_PACK_RAW_2_P (Q, (val), X);         \
     }                                          \
   while (0)
 
@@ -283,7 +286,7 @@ union _FP_UNION_Q
   do                                           \
     {                                          \
       _FP_PACK_SEMIRAW (Q, 2, X);              \
-      _FP_PACK_RAW_2 (Q, val, X);              \
+      _FP_PACK_RAW_2 (Q, (val), X);            \
     }                                          \
   while (0)
 
@@ -292,7 +295,7 @@ union _FP_UNION_Q
     {                                          \
       _FP_PACK_SEMIRAW (Q, 2, X);              \
       if (!FP_INHIBIT_RESULTS)                 \
-       _FP_PACK_RAW_2_P (Q, val, X);           \
+       _FP_PACK_RAW_2_P (Q, (val), X);         \
     }                                          \
   while (0)
 
@@ -303,15 +306,17 @@ union _FP_UNION_Q
 # define FP_MUL_Q(R, X, Y)             _FP_MUL (Q, 2, R, X, Y)
 # define FP_DIV_Q(R, X, Y)             _FP_DIV (Q, 2, R, X, Y)
 # define FP_SQRT_Q(R, X)               _FP_SQRT (Q, 2, R, X)
-# define _FP_SQRT_MEAT_Q(R, S, T, X, Q)        _FP_SQRT_MEAT_2 (R, S, T, X, Q)
+# define _FP_SQRT_MEAT_Q(R, S, T, X, Q)        _FP_SQRT_MEAT_2 (R, S, T, X, (Q))
 # define FP_FMA_Q(R, X, Y, Z)          _FP_FMA (Q, 2, 4, R, X, Y, Z)
 
-# define FP_CMP_Q(r, X, Y, un)         _FP_CMP (Q, 2, r, X, Y, un)
-# define FP_CMP_EQ_Q(r, X, Y)          _FP_CMP_EQ (Q, 2, r, X, Y)
-# define FP_CMP_UNORD_Q(r, X, Y)       _FP_CMP_UNORD (Q, 2, r, X, Y)
+# define FP_CMP_Q(r, X, Y, un, ex)     _FP_CMP (Q, 2, (r), X, Y, (un), (ex))
+# define FP_CMP_EQ_Q(r, X, Y, ex)      _FP_CMP_EQ (Q, 2, (r), X, Y, (ex))
+# define FP_CMP_UNORD_Q(r, X, Y, ex)   _FP_CMP_UNORD (Q, 2, (r), X, Y, (ex))
 
-# define FP_TO_INT_Q(r, X, rsz, rsg)   _FP_TO_INT (Q, 2, r, X, rsz, rsg)
-# define FP_FROM_INT_Q(X, r, rs, rt)   _FP_FROM_INT (Q, 2, X, r, rs, rt)
+# define FP_TO_INT_Q(r, X, rsz, rsg)   _FP_TO_INT (Q, 2, (r), X, (rsz), (rsg))
+# define FP_TO_INT_ROUND_Q(r, X, rsz, rsg)     \
+  _FP_TO_INT_ROUND (Q, 2, (r), X, (rsz), (rsg))
+# define FP_FROM_INT_Q(X, r, rs, rt)   _FP_FROM_INT (Q, 2, X, (r), (rs), rt)
 
 # define _FP_FRAC_HIGH_Q(X)    _FP_FRAC_HIGH_2 (X)
 # define _FP_FRAC_HIGH_RAW_Q(X)        _FP_FRAC_HIGH_2 (X)
@@ -319,3 +324,5 @@ union _FP_UNION_Q
 # define _FP_FRAC_HIGH_DW_Q(X) _FP_FRAC_HIGH_4 (X)
 
 #endif /* not _FP_W_TYPE_SIZE < 64 */
+
+#endif /* !SOFT_FP_QUAD_H */
This page took 0.038494 seconds and 5 git commands to generate.