aboutsummaryrefslogtreecommitdiff
path: root/soft-fp/extended.h
diff options
context:
space:
mode:
Diffstat (limited to 'soft-fp/extended.h')
-rw-r--r--soft-fp/extended.h62
1 files changed, 58 insertions, 4 deletions
diff --git a/soft-fp/extended.h b/soft-fp/extended.h
index d34df5d..0f2060e 100644
--- a/soft-fp/extended.h
+++ b/soft-fp/extended.h
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Definitions for IEEE Extended Precision.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek (jj@ultra.linux.cz).
@@ -39,16 +39,22 @@
#define _FP_QNANBIT_E \
((_FP_W_TYPE)1 << (_FP_FRACBITS_E-2) % _FP_W_TYPE_SIZE)
+#define _FP_QNANBIT_SH_E \
+ ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-2+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
#define _FP_IMPLBIT_E \
((_FP_W_TYPE)1 << (_FP_FRACBITS_E-1) % _FP_W_TYPE_SIZE)
+#define _FP_IMPLBIT_SH_E \
+ ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-1+_FP_WORKBITS) % _FP_W_TYPE_SIZE)
#define _FP_OVERFLOW_E \
((_FP_W_TYPE)1 << (_FP_WFRACBITS_E % _FP_W_TYPE_SIZE))
+typedef float XFtype __attribute__((mode(XF)));
+
#if _FP_W_TYPE_SIZE < 64
union _FP_UNION_E
{
- long double flt;
+ XFtype flt;
struct
{
#if __BYTE_ORDER == __BIG_ENDIAN
@@ -143,10 +149,22 @@ union _FP_UNION_E
#define FP_UNPACK_EP(X,val) \
do { \
- FP_UNPACK_RAW_2_P(X,val); \
+ FP_UNPACK_RAW_EP(X,val); \
_FP_UNPACK_CANONICAL(E,4,X); \
} while (0)
+#define FP_UNPACK_SEMIRAW_E(X,val) \
+ do { \
+ _FP_UNPACK_RAW_E(X,val); \
+ _FP_UNPACK_SEMIRAW(E,4,X); \
+ } while (0)
+
+#define FP_UNPACK_SEMIRAW_EP(X,val) \
+ do { \
+ _FP_UNPACK_RAW_EP(X,val); \
+ _FP_UNPACK_SEMIRAW(E,4,X); \
+ } while (0)
+
#define FP_PACK_E(val,X) \
do { \
_FP_PACK_CANONICAL(E,4,X); \
@@ -159,6 +177,18 @@ union _FP_UNION_E
FP_PACK_RAW_EP(val,X); \
} while (0)
+#define FP_PACK_SEMIRAW_E(val,X) \
+ do { \
+ _FP_PACK_SEMIRAW(E,4,X); \
+ _FP_PACK_RAW_E(val,X); \
+ } while (0)
+
+#define FP_PACK_SEMIRAW_EP(val,X) \
+ do { \
+ _FP_PACK_SEMIRAW(E,4,X); \
+ _FP_PACK_RAW_EP(val,X); \
+ } while (0)
+
#define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,4,X)
#define FP_NEG_E(R,X) _FP_NEG(E,4,R,X)
#define FP_ADD_E(R,X,Y) _FP_ADD(E,4,R,X,Y)
@@ -235,7 +265,7 @@ union _FP_UNION_E
#else /* not _FP_W_TYPE_SIZE < 64 */
union _FP_UNION_E
{
- long double flt /* __attribute__((mode(TF))) */ ;
+ XFtype flt;
struct {
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned long pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
@@ -324,6 +354,18 @@ union _FP_UNION_E
_FP_UNPACK_CANONICAL(E,2,X); \
} while (0)
+#define FP_UNPACK_SEMIRAW_E(X,val) \
+ do { \
+ _FP_UNPACK_RAW_E(X,val); \
+ _FP_UNPACK_SEMIRAW(E,2,X); \
+ } while (0)
+
+#define FP_UNPACK_SEMIRAW_EP(X,val) \
+ do { \
+ _FP_UNPACK_RAW_EP(X,val); \
+ _FP_UNPACK_SEMIRAW(E,2,X); \
+ } while (0)
+
#define FP_PACK_E(val,X) \
do { \
_FP_PACK_CANONICAL(E,2,X); \
@@ -336,6 +378,18 @@ union _FP_UNION_E
FP_PACK_RAW_EP(val,X); \
} while (0)
+#define FP_PACK_SEMIRAW_E(val,X) \
+ do { \
+ _FP_PACK_SEMIRAW(E,2,X); \
+ _FP_PACK_RAW_E(val,X); \
+ } while (0)
+
+#define FP_PACK_SEMIRAW_EP(val,X) \
+ do { \
+ _FP_PACK_SEMIRAW(E,2,X); \
+ _FP_PACK_RAW_EP(val,X); \
+ } while (0)
+
#define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,2,X)
#define FP_NEG_E(R,X) _FP_NEG(E,2,R,X)
#define FP_ADD_E(R,X,Y) _FP_ADD(E,2,R,X,Y)