[netperf-dev] netperf2 commit notice r57 - in trunk: . src

raj at netperf.org raj at netperf.org
Mon Feb 27 10:48:41 PST 2006


Author: raj
Date: 2006-02-27 10:48:38 -0800 (Mon, 27 Feb 2006)
New Revision: 57

Modified:
   trunk/AUTHORS
   trunk/Release_Notes
   trunk/config.h.in
   trunk/configure
   trunk/configure.ac
   trunk/src/netlib.c
Log:
Handle a broader range of floating point formats and display proper
results when the netperf and netserver systems differ in that regard.


Modified: trunk/AUTHORS
===================================================================
--- trunk/AUTHORS	2006-02-24 01:45:06 UTC (rev 56)
+++ trunk/AUTHORS	2006-02-27 18:48:38 UTC (rev 57)
@@ -162,3 +162,6 @@
 Michael Dorff
 Getting netperf/netserver to compile under Windows with MS Visual
 Studio 2003
+
+George Davis
+Changes to deal with different floating-point formats.
\ No newline at end of file

Modified: trunk/Release_Notes
===================================================================
--- trunk/Release_Notes	2006-02-24 01:45:06 UTC (rev 56)
+++ trunk/Release_Notes	2006-02-27 18:48:38 UTC (rev 57)
@@ -1,3 +1,10 @@
+These are the Release Notes for Revision 2.4.2 of netperf:
+
+Things changed in this release:
+
+*) Fixes for floating point format differences, courtesy of George
+   Davis.
+
 These are the Release Notes for Revision 2.4.1 of netperf:
 
 Things changed in this release:

Modified: trunk/config.h.in
===================================================================
--- trunk/config.h.in	2006-02-24 01:45:06 UTC (rev 56)
+++ trunk/config.h.in	2006-02-27 18:48:38 UTC (rev 57)
@@ -12,6 +12,9 @@
 /* Define to 1 if you have the `bzero' function. */
 #undef HAVE_BZERO
 
+/* Define to 1 if you have the <endian.h> header file. */
+#undef HAVE_ENDIAN_H
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 

Modified: trunk/configure
===================================================================
--- trunk/configure	2006-02-24 01:45:06 UTC (rev 56)
+++ trunk/configure	2006-02-27 18:48:38 UTC (rev 57)
@@ -3657,7 +3657,8 @@
 
 
 
-for ac_header in arpa/inet.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h
+
+for ac_header in arpa/inet.h endian.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2006-02-24 01:45:06 UTC (rev 56)
+++ trunk/configure.ac	2006-02-27 18:48:38 UTC (rev 57)
@@ -27,7 +27,7 @@
 # Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h])
+AC_CHECK_HEADERS([arpa/inet.h endian.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h])
 
 # Some platforms require these.  There may be a better way.
 AC_HAVE_LIBRARY(socket)

Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c	2006-02-24 01:45:06 UTC (rev 56)
+++ trunk/src/netlib.c	2006-02-27 18:48:38 UTC (rev 57)
@@ -69,6 +69,9 @@
 #include <math.h>
 #include <string.h>
 #include <assert.h>
+#ifdef HAVE_ENDIAN_H
+#include <endian.h>
+#endif
 
 
 #ifndef WIN32
@@ -547,6 +550,15 @@
     conv_rec.bytes[7-i] = scratch;
   }
   
+#if __FLOAT_WORD_ORDER != __BYTE_ORDER
+  {
+    /* Fixup mixed endian floating point machines */
+    unsigned int scratch = conv_rec.words[0];
+    conv_rec.words[0] = conv_rec.words[1];
+    conv_rec.words[1] = scratch;
+  }
+#endif
+
   return(conv_rec.whole_thing);
   
 }
@@ -581,6 +593,15 @@
     conv_rec.bytes[7-i] = scratch;
   }
   
+#if __FLOAT_WORD_ORDER != __BYTE_ORDER
+  {
+    /* Fixup mixed endian floating point machines */
+    unsigned int scratch = conv_rec.words[0];
+    conv_rec.words[0] = conv_rec.words[1];
+    conv_rec.words[1] = scratch;
+  }
+#endif
+
   /* we know that in the message passing routines htonl will */
   /* be called on the 32 bit quantities. we need to set things up so */
   /* that when this happens, the proper order will go out on the */



More information about the netperf-dev mailing list