]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Optimize float construction/extraction on x86-64.
authorUlrich Drepper <drepper@redhat.com>
Mon, 24 Aug 2009 21:52:49 +0000 (14:52 -0700)
committerUlrich Drepper <drepper@redhat.com>
Mon, 24 Aug 2009 21:52:49 +0000 (14:52 -0700)
ChangeLog
sysdeps/x86_64/fpu/math_private.h

index bc1c0f17a962295e48eadcf957c63d16946bfab9..c29660d652591848b224203ff2f9cc116ebb8489 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-24  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/x86_64/fpu/math_private.h: Add specialized GET_FLOAT_WORD
+       and SET_FLOAT_WORD definitions.
+
 2009-08-24  Roland McGrath  <roland@redhat.com>
 
        * sysdeps/unix/syscall-template.S: New file.
index 4febcbb5ec9552984b8e8948c3f37263251a5923..8f4b792e776b59f0f9d2a8da19e16b54e24b28a3 100644 (file)
@@ -18,4 +18,24 @@ do                                                   \
 while (0)
 
 #include <math/math_private.h>
+
+/* We can do a few things better on x86-64.  */
+
+/* Direct movement of float into integer register.  */
+#undef GET_FLOAT_WORD
+#define GET_FLOAT_WORD(i,d) \
+do {                                                           \
+  int i_;                                                      \
+  asm ("movd %1, %0" : "=rm" (i_) : "x" (d));                  \
+  (i) = i_;                                                    \
+} while (0)
+
+/* And the reverse.  */
+#undef SET_FLOAT_WORD
+#define SET_FLOAT_WORD(d,i) \
+do {                                                           \
+  int i_ = i;                                                  \
+  asm ("movd %1, %0" : "=x" (d) : "rm" (i_));                  \
+} while (0)
+
 #endif