Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Oct 2011 04:22:55 +0000 (UTC)
From:      David Schultz <das@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r226373 - head/lib/msun/src
Message-ID:  <201110150422.p9F4Mtfu094661@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: das
Date: Sat Oct 15 04:22:55 2011
New Revision: 226373
URL: http://svn.freebsd.org/changeset/base/226373

Log:
  Add INSERT_WORD64 and EXTRACT_WORD64 macros for use in s_fma.c.

Modified:
  head/lib/msun/src/math_private.h

Modified: head/lib/msun/src/math_private.h
==============================================================================
--- head/lib/msun/src/math_private.h	Sat Oct 15 04:17:20 2011	(r226372)
+++ head/lib/msun/src/math_private.h	Sat Oct 15 04:22:55 2011	(r226373)
@@ -58,6 +58,10 @@ typedef union
     u_int32_t msw;
     u_int32_t lsw;
   } parts;
+  struct
+  {
+    u_int64_t w;
+  } xparts;
 } ieee_double_shape_type;
 
 #endif
@@ -72,6 +76,10 @@ typedef union
     u_int32_t lsw;
     u_int32_t msw;
   } parts;
+  struct
+  {
+    u_int64_t w;
+  } xparts;
 } ieee_double_shape_type;
 
 #endif
@@ -86,6 +94,14 @@ do {								\
   (ix1) = ew_u.parts.lsw;					\
 } while (0)
 
+/* Get a 64-bit int from a double. */
+#define EXTRACT_WORD64(ix,d)					\
+do {								\
+  ieee_double_shape_type ew_u;					\
+  ew_u.value = (d);						\
+  (ix) = ew_u.xparts.w;						\
+} while (0)
+
 /* Get the more significant 32 bit int from a double.  */
 
 #define GET_HIGH_WORD(i,d)					\
@@ -114,6 +130,14 @@ do {								\
   (d) = iw_u.value;						\
 } while (0)
 
+/* Set a double from a 64-bit int. */
+#define INSERT_WORD64(d,ix)					\
+do {								\
+  ieee_double_shape_type iw_u;					\
+  iw_u.xparts.w = (ix);						\
+  (d) = iw_u.value;						\
+} while (0)
+
 /* Set the more significant 32 bits of a double from an int.  */
 
 #define SET_HIGH_WORD(d,v)					\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110150422.p9F4Mtfu094661>