]> sourceware.org Git - glibc.git/commitdiff
Optimize x86-64 signbit{,f} a bit.
authorUlrich Drepper <drepper@redhat.com>
Mon, 24 Aug 2009 17:20:58 +0000 (10:20 -0700)
committerUlrich Drepper <drepper@redhat.com>
Mon, 24 Aug 2009 17:20:58 +0000 (10:20 -0700)
ChangeLog
sysdeps/x86_64/fpu/bits/mathinline.h

index 9f63c4db05bd894d6456c621ad9054ffd2356506..45ff958cb89f1683192fca4db68537404005bb81 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-24  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/x86_64/fpu/bits/mathinline.h (__signbit): Optimize.
+       (__signbitf): Likewise.
+
 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
 
        * posix/regcomp.c (parse_dup_op): Verify the expression is correctly
index e8a919fe923a09278c8808c4bd5787f135f8872b..8d4850dfc00b062ba3d9caf59787a851a5de463d 100644 (file)
@@ -1,5 +1,5 @@
 /* Inline math functions for x86-64.
-   Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 2002.
 
 __MATH_INLINE int
 __NTH (__signbitf (float __x))
 {
-  __extension__ union { float __f; int __i; } __u = { __f: __x };
-  return __u.__i < 0;
+  int __m;
+  asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
+  return __m & 0x8;
 }
 __MATH_INLINE int
 __NTH (__signbit (double __x))
 {
-  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
-  return __u.__i[1] < 0;
+  int __m;
+  asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
+  return __m & 0x80;
 }
 __MATH_INLINE int
 __NTH (__signbitl (long double __x))
This page took 0.05686 seconds and 5 git commands to generate.