]> git.saurik.com Git - apple/libc.git/blobdiff - fbsdcompat/_fpmath.h
Libc-1353.41.1.tar.gz
[apple/libc.git] / fbsdcompat / _fpmath.h
index 3baf93f8d7962ec3b4c2c701649a42240d7727f6..ed38fc5f358d5c4c4116e726de0bdb785551eade 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2003, 2008 Apple Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: /repoman/r/ncvs/src/lib/libc/i386/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $
+ * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.3 2004/01/18 07:57:01 das Exp $
  */
 
+#if defined(__i386__) || defined(__x86_64__)
+
 union IEEEl2bits {
        long double     e;
        struct {
@@ -61,7 +63,43 @@ union IEEEl2bits {
 
 #define        mask_nbit_l(u)  ((u).bits.manh &= 0x7fffffff)
 
+#define        LDBL_MANH_SIZE  32
+#define        LDBL_MANL_SIZE  32
+
 #define        LDBL_TO_ARRAY32(u, a) do {                      \
        (a)[0] = (uint32_t)(u).bits.manl;               \
        (a)[1] = (uint32_t)(u).bits.manh;               \
 } while(0)
+#elif defined(__arm__) || defined(__arm64__)
+
+union IEEEl2bits {
+    long double     e;
+    struct {
+#ifndef __ARMEB__
+       unsigned int    manl    :32;
+       unsigned int    manh    :20;
+       unsigned int    exp     :11;
+       unsigned int    sign    :1;
+#else
+       unsigned int            sign    :1;
+       unsigned int            exp     :11;
+       unsigned int            manh    :20;
+       unsigned int            manl    :32;
+#endif
+    } bits;
+};
+
+#define LDBL_NBIT       0
+#define mask_nbit_l(u)  ((void)0)
+
+#define LDBL_MANH_SIZE  20
+#define LDBL_MANL_SIZE  32
+
+#define LDBL_TO_ARRAY32(u, a) do {                      \
+        (a)[0] = (uint32_t)(u).bits.manl;               \
+        (a)[1] = (uint32_t)(u).bits.manh;               \
+} while(0)
+
+#else
+#error unsupported architecture
+#endif