aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/alpha/soft-fp/local-soft-fp.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/alpha/soft-fp/local-soft-fp.h')
-rw-r--r--sysdeps/alpha/soft-fp/local-soft-fp.h63
1 files changed, 37 insertions, 26 deletions
diff --git a/sysdeps/alpha/soft-fp/local-soft-fp.h b/sysdeps/alpha/soft-fp/local-soft-fp.h
index e93a2ad064..d562e0829e 100644
--- a/sysdeps/alpha/soft-fp/local-soft-fp.h
+++ b/sysdeps/alpha/soft-fp/local-soft-fp.h
@@ -5,40 +5,51 @@
/* Helpers for the Ots functions which receive long double arguments
in two integer registers, and return values in $16+$17. */
-#undef _FP_UNPACK_RAW_2
-#define _FP_UNPACK_RAW_2(fs, X, val) \
- do { \
- union _FP_UNION_##fs _flo; \
+#define AXP_UNPACK_RAW_Q(X, val) \
+ do { \
+ union _FP_UNION_Q _flo; \
_flo.longs.a = val##l; \
_flo.longs.b = val##h; \
- X##_f0 = _flo.bits.frac0; \
- X##_f1 = _flo.bits.frac1; \
- X##_e = _flo.bits.exp; \
- X##_s = _flo.bits.sign; \
+ FP_UNPACK_RAW_QP(X, &_flo); \
} while (0)
-#undef _FP_PACK_RAW_2
-#define _FP_PACK_RAW_2(fs, val, X) \
- do { \
- union _FP_UNION_##fs _flo; \
- _flo.bits.frac0 = X##_f0; \
- _flo.bits.frac1 = X##_f1; \
- _flo.bits.exp = X##_e; \
- _flo.bits.sign = X##_s; \
- val##l = _flo.longs.a; \
- val##h = _flo.longs.b; \
+#define AXP_UNPACK_SEMIRAW_Q(X, val) \
+ do { \
+ union _FP_UNION_Q _flo; \
+ _flo.longs.a = val##l; \
+ _flo.longs.b = val##h; \
+ FP_UNPACK_SEMIRAW_QP(X, &_flo); \
+ } while (0)
+
+#define AXP_UNPACK_Q(X, val) \
+ do { \
+ AXP_UNPACK_RAW_Q(X, val); \
+ _FP_UNPACK_CANONICAL(Q, 2, X); \
+ } while (0)
+
+#define AXP_PACK_RAW_Q(val, X) FP_PACK_RAW_QP(&val##_flo, X)
+
+#define AXP_PACK_SEMIRAW_Q(val, X) \
+ do { \
+ _FP_PACK_SEMIRAW(Q, 2, X); \
+ AXP_PACK_RAW_Q(val, X); \
} while (0)
-#define FP_DECL_RETURN(X) \
- long X##l, X##h
+#define AXP_PACK_Q(val, X) \
+ do { \
+ _FP_PACK_CANONICAL(Q, 2, X); \
+ AXP_PACK_RAW_Q(val, X); \
+ } while (0)
+
+#define AXP_DECL_RETURN_Q(X) union _FP_UNION_Q X##_flo
/* ??? We don't have a real way to tell the compiler that we're wanting
to return values in $16+$17. Instead use a volatile asm to make sure
that the values are live, and just hope that nothing kills the values
in between here and the end of the function. */
-#define FP_RETURN(X) \
-do { \
- register long r16 __asm__("16") = X##l; \
- register long r17 __asm__("17") = X##h; \
- asm volatile ("" : : "r"(r16), "r"(r17)); \
-} while (0)
+#define AXP_RETURN_Q(X) \
+ do { \
+ register long r16 __asm__("16") = X##_flo.longs.a; \
+ register long r17 __asm__("17") = X##_flo.longs.b; \
+ asm volatile ("" : : "r"(r16), "r"(r17)); \
+ } while (0)