From: Ulrich Drepper Date: Mon, 24 Aug 2009 21:52:49 +0000 (-0700) Subject: Optimize float construction/extraction on x86-64. X-Git-Tag: fedora/glibc-2.10.90-16~1^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a1ea1525eb8e02ce20eb93d65dc880186731bf7;p=thirdparty%2Fglibc.git Optimize float construction/extraction on x86-64. --- diff --git a/ChangeLog b/ChangeLog index bc1c0f17a96..c29660d6525 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-24 Ulrich Drepper + + * sysdeps/x86_64/fpu/math_private.h: Add specialized GET_FLOAT_WORD + and SET_FLOAT_WORD definitions. + 2009-08-24 Roland McGrath * sysdeps/unix/syscall-template.S: New file. diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h index 4febcbb5ec9..8f4b792e776 100644 --- a/sysdeps/x86_64/fpu/math_private.h +++ b/sysdeps/x86_64/fpu/math_private.h @@ -18,4 +18,24 @@ do \ while (0) #include + +/* 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