rewrite __aeabi_read_tp in asm
[musl] / src / internal / libm.h
index 9f0d3bc..a2505f7 100644 (file)
@@ -28,6 +28,17 @@ union ldshape {
                uint16_t se;
        } i;
 };
+#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __BIG_ENDIAN
+/* This is the m68k variant of 80-bit long double, and this definition only works
+ * on archs where the alignment requirement of uint64_t is <= 4. */
+union ldshape {
+       long double f;
+       struct {
+               uint16_t se;
+               uint16_t pad;
+               uint64_t m;
+       } i;
+};
 #elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __LITTLE_ENDIAN
 union ldshape {
        long double f;
@@ -42,6 +53,20 @@ union ldshape {
                uint64_t hi;
        } i2;
 };
+#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 && __BYTE_ORDER == __BIG_ENDIAN
+union ldshape {
+       long double f;
+       struct {
+               uint16_t se;
+               uint16_t top;
+               uint32_t mid;
+               uint64_t lo;
+       } i;
+       struct {
+               uint64_t hi;
+               uint64_t lo;
+       } i2;
+};
 #else
 #error Unsupported long double representation
 #endif
@@ -128,6 +153,18 @@ do {                                              \
   (d) = __u.f;                                    \
 } while (0)
 
+#undef __CMPLX
+#undef CMPLX
+#undef CMPLXF
+#undef CMPLXL
+
+#define __CMPLX(x, y, t) \
+       ((union { _Complex t __z; t __xy[2]; }){.__xy = {(x),(y)}}.__z)
+
+#define CMPLX(x, y) __CMPLX(x, y, double)
+#define CMPLXF(x, y) __CMPLX(x, y, float)
+#define CMPLXL(x, y) __CMPLX(x, y, long double)
+
 /* fdlibm kernel functions */
 
 int    __rem_pio2_large(double*,double*,int,int,int);
@@ -155,15 +192,4 @@ long double __tanl(long double, long double, int);
 long double __polevll(long double, const long double *, int);
 long double __p1evll(long double, const long double *, int);
 
-#if 0
-/* Attempt to get strict C99 semantics for assignment with non-C99 compilers. */
-#define STRICT_ASSIGN(type, lval, rval) do {    \
-        volatile type __v = (rval);             \
-        (lval) = __v;                           \
-} while (0)
-#else
-/* Should work with -fexcess-precision=standard (>=gcc-4.5) or -ffloat-store */
-#define STRICT_ASSIGN(type, lval, rval) ((lval) = (type)(rval))
-#endif
-
 #endif